19 浮动静态路由/负载分担 配置浮动静态路由 <H3C>system-view [H3C]sysname r1 [r1]interface gigabitethernet 0/0 [r1-GigabitEthernet0/0]ip address 10.10.12.1 24 [r1-GigabitEthernet0/0] [r1-GigabitEthernet0/0]interface gigabitethernet 0/1 [r1-GigabitEthernet0/1]ip address 10.10.13.1 24 [r1-GigabitEthernet0/1]interface loopback 0 [r1-LoopBack0]ip address 100.100.100.100 32 [r1-LoopBack0]quit 配置R1的两个下一跳,把R3的路由优先级配置为100(默认优先级为60,所以100会成为inactive的备份链路) [r1]ip route-static 200.200.200.200 255.255.255.25510.10.12.2 [r1]ip route-static 200.200.200.200 255.255.255.25510.10.13.3 preference 100 <H3C>system-view [H3C]sysname r2 [r2]interface gigabitethernet 0/0 [r2-GigabitEthernet0/0]ip address 10.10.12.2 24 [r2-GigabitEthernet0/0]interface gigabitethernet 0/1 [r2-GigabitEthernet0/1]ip address 10.10.24.2 24 [r2-GigabitEthernet0/1]quit 配置R2两个方向的静态路由 [r2]ip route-static 100.100.100.100 255.255.255.25510.10.12.1 [r2]ip route-static 200.200.200.200 255.255.255.25510.10.24.4 <H3C>system-view [H3C]sysname r3 [r3]interface gigabitethernet 0/0 [r3-GigabitEthernet0/0]ip address 10.10.34.3 24 [r3-GigabitEthernet0/0]interface gigabitethernet 0/1 [r3-GigabitEthernet0/1]ip address 10.10.13.3 24 [r3-GigabitEthernet0/1]quit 配置R2两个方向的静态路由 [r3]ip route-static 100.100.100.100 255.255.255.25510.10.13.1 [r3]ip route-static 200.200.200.200 255.255.255.25510.10.34.4 <H3C>system-view [H3C]sysname r3 [r3]sysname r4 [r4]interface gigabitethernet 0/0 [r4-GigabitEthernet0/0]ip address 10.10.24.4 24 [r4-GigabitEthernet0/0]interface gigabitethernet 0/1 [r4-GigabitEthernet0/1]ip address 10.10.34.4 24 [r4-GigabitEthernet0/1]interface loopback 0 [r4-LoopBack0]ip address 200.200.200.200 32 [r4-LoopBack0]quit 配置R4的两个下一跳,把R3的路由优先级配置为100(默认优先级为60,所以100会成为inactive的备份链路) [r4]ip route-static 100.100.100.100 255.255.255.25510.10.24.2 [r4]ip route-static 100.100.100.100 255.255.255.25510.10.34.3 preference 100 查看路由表 [r1]display ip routing-table Destinations : 15 Routes : 15 Destination/Mask Proto Pre Cost NextHop Interface …… 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 200.200.200.200/32 Static 60 0 10.10.12.2 GE0/0 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 …… [r1]display route-static routing-table Total number of routes: 2 Status: * - valid *Destination: 200.200.200.200/32 NibID:0x11000000 NextHop: 10.10.12.2 MainNibID:N/A BkNextHop: N/A BkNibID:N/A Interface: N/A TableID:0x2 BkInterface: N/A Flag:0x2d01 BfdSrcIp: N/A DbIndex:0x1 BfdIfIndex: 0x0 Type:Normal BfdVrfIndex: 0 TrackIndex:0xffffffff Label: NULL Preference: 60 vrfIndexDst: 0 BfdMode:N/A vrfIndexNH: 0 Permanent:0 Tag: 0 Destination:200.200.200.200/32 NibID:0x11000001 NextHop: 10.10.13.3 MainNibID:N/A BkNextHop: N/A BkNibID:N/A Interface: N/A TableID:0x2 BkInterface: N/A Flag:0x2401 BfdSrcIp: N/A DbIndex:0x1 BfdIfIndex: 0x0 Type:Normal BfdVrfIndex: 0 TrackIndex:0xffffffff Label: NULL Preference: 100 vrfIndexDst: 0 BfdMode:N/A vrfIndexNH: 0 Permanent:0 Tag: 0 [r1]display ip routing-table 200.200.200.200 verbose Summary count : 1 Destination: 200.200.200.200/32 Protocol: Static Process ID: 0 SubProtID:0x1 Age: 00h07m16s Cost: 0 Preference: 60 IpPre:N/A QosLocalID: N/A Tag: 0 State: Active Adv OrigTblID:0x0 OrigVrf: default-vrf TableID:0x2 OrigAs: 0 NibID:0x11000000 LastAs: 0 AttrID:0xffffffff Neighbor: 0.0.0.0 Flags:0x10060 OrigNextHop: 10.10.12.2 Label:NULL RealNextHop: 10.10.12.2 BkLabel: NULL BkNextHop: N/A SRLabel:NULL BkSRLabel: NULL SIDIndex:NULL InLabel: NULL Tunnel ID:Invalid Interface:GigabitEthernet0/0 BkTunnel ID: Invalid BkInterface: N/A FtnIndex:0x0 TrafficIndex: N/A Connector:N/A VpnPeerId: N/A Dscp:N/A Exp: N/A 断掉R2与R2之前的链路,测试备份链路连通性。 [r1]display ip routing-table Destinations : 12 Routes : 12 Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 10.10.13.0/24 Direct 0 0 10.10.13.1 GE0/1 10.10.13.1/32 Direct 0 0 127.0.0.1 InLoop0 10.10.13.255/32 Direct 0 0 10.10.13.1 GE0/1 100.100.100.100/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 200.200.200.200/32 Static 100 0 10.10.13.3 GE0/1 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 配置负载分担;把R1与R4路由器的两个静态路由下一跳设置为相同的60优先级; 配置R2和R4的两个下一跳,不配置静态路由器优先级(默认优先级为60,所以在路由表中会出现两条等价路由) [r1]undo ip route-static 200.200.200.200 32 10.10.13.3preference 100 [r1]ip route-static 200.200.200.200 255.255.255.25510.10.13.3 [r4]undo ip route-static 100.100.100.100 32 10.10.34.3preference 100 [r4]ip route-static 100.100.100.100 255.255.255.25510.10.34.3 [r4]display ip routing-table Destinations : 15 Routes : 16 Destination/Mask Proto Pre Cost NextHop Interface …… 10.10.34.255/32 Direct 0 0 10.10.34.4 GE0/1 100.100.100.100/32 Static 60 0 10.10.24.2 GE0/0 Static 60 0 10.10.34.3 GE0/1 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 …… 路由表中出现两条等价静态路由,同一个目标同时出现两个下一跳,此时会同时进行数据转发,这样就是静态路由分担。 |