H3C 路由备份&聚合实验
实验拓扑
实验需求
- 按照图示配置 IP 地址,R3 上连接
192.168.X.X/24
4个业务网段 - 配置 RIPv2 协议使全网互通,R1 和 R3 的直连链路不运行 RIP
- R1 上配置静态路由直接经过 R3 到达所有业务网段
- R1 和 R2 上不允许出现业务网段的明细路由
- 要求 R1 上到达所有业务网段优先走 R2,当 R2 的链路故障时,自动切换到走 R3
实验步骤
设备IP地址配置
R1 IP地址配置
[R1]display ip interface brief
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP address/Mask VPN instance Description
GE0/0 up up 200.1.1.1/24 -- --
GE0/1 up up 200.3.3.1/24 -- --
GE0/2 down down -- -- --
GE5/0 down down -- -- --
GE5/1 down down -- -- --
GE6/0 down down -- -- --
GE6/1 down down -- -- --
Ser1/0 down down -- -- --
Ser2/0 down down -- -- --
Ser3/0 down down -- -- --
Ser4/0 down down -- -- --
R2 IP地址配置
[R2]display ip interface brief
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP address/Mask VPN instance Description
GE0/0 up up 200.1.1.2/24 -- --
GE0/1 up up 200.2.2.2/24 -- --
GE0/2 down down -- -- --
GE5/0 down down -- -- --
GE5/1 down down -- -- --
GE6/0 down down -- -- --
GE6/1 down down -- -- --
Ser1/0 down down -- -- --
Ser2/0 down down -- -- --
Ser3/0 down down -- -- --
Ser4/0 down down -- -- --
R3 IP地址配置
[R3]display ip interface brief
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP address/Mask VPN instance Description
GE0/0 up up 200.3.3.3/24 -- --
GE0/1 up up 200.2.2.3/24 -- --
GE0/2 down down -- -- --
GE5/0 down down -- -- --
GE5/1 down down -- -- --
GE6/0 down down -- -- --
GE6/1 down down -- -- --
Loop0 up up(s) 192.168.0.1/24 -- --
Loop1 up up(s) 192.168.1.1/24 -- --
Loop2 up up(s) 192.168.2.1/24 -- --
Loop3 up up(s) 192.168.3.1/24 -- --
Ser1/0 down down -- -- --
Ser2/0 down down -- -- --
Ser3/0 down down -- -- --
Ser4/0 down down -- -- --
RIPV2配置
依据需求配置:配置 RIPv2 协议使全网互通,R1 和 R3 的直连链路不运行 RIP
R1 RIPV2配置
#
rip 1
undo summary
version 2
network 200.1.1.0
R2 RIPV2配置
#
rip 1
undo summary
version 2
network 200.1.1.0
network 200.2.2.0
R3 RIPV2配置
#
rip 1
undo summary
version 2
network 192.168.0.0
network 192.168.1.0
network 192.168.2.0
network 192.168.3.0
network 200.2.2.0
依据需求配置:R1 和 R2 上不允许出现业务网段的明细路由
R1和R2所获取的业务网段路由,是由R3 G0/1接口所告知的,所以在R3的G0/1接口上运行路由聚合,从而告知给R2
#
interface GigabitEthernet0/1
rip summary-address 192.168.0.0 255.255.252.0
静态路由配置
依据需求配置:R1 上配置静态路由直接经过 R3 到达所有业务网段,且R1 和 R2 上不允许出现业务网段的明细路由
依据路由表写表规则:不同来源的路由优先级高(数字小)的优先
;而静态路由默认优先级为60,RIP路由默认优先级为100,静态路由默认优先与RIP路由;
可修改静态路由优先级数值大于RIP路由优先级,以此满足需求。
R1 静态路由配置
#
ip route-static 192.168.0.0 22 200.3.3.3 preference 120
实验验证
依据需求验证:在链路正常情况下,R1 上到达所有业务网段优先走 R2
[R1]tracert 192.168.0.1
traceroute to 192.168.0.1 (192.168.0.1), 30 hops at most, 40 bytes each packet, press CTRL+C to break
1 200.1.1.2 (200.1.1.2) 1.000 ms 0.000 ms 0.000 ms
2 200.2.2.3 (200.2.2.3) 1.000 ms 1.000 ms 0.000 ms
[R1]tracert 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 30 hops at most, 40 bytes each packet, press CTRL+C to break
1 200.1.1.2 (200.1.1.2) 0.000 ms 0.000 ms 1.000 ms
2 200.2.2.3 (200.2.2.3) 0.000 ms 2.000 ms 1.000 ms
[R1]tracert 192.168.2.1
traceroute to 192.168.2.1 (192.168.2.1), 30 hops at most, 40 bytes each packet, press CTRL+C to break
1 200.1.1.2 (200.1.1.2) 0.000 ms 1.000 ms 0.000 ms
2 200.2.2.3 (200.2.2.3) 0.000 ms 1.000 ms 0.000 ms
[R1]tracert 192.168.3.1
traceroute to 192.168.3.1 (192.168.3.1), 30 hops at most, 40 bytes each packet, press CTRL+C to break
1 200.1.1.2 (200.1.1.2) 0.000 ms 1.000 ms 0.000 ms
2 200.2.2.3 (200.2.2.3) 0.000 ms 1.000 ms 1.000 ms
依据需求验证:当 R2 的链路故障时,自动切换到走 R3
当R2链路故障
[R2]interface GigabitEthernet 0/0
[R2-GigabitEthernet0/0]shutdown
[R2-GigabitEthernet0/0]%Feb 20 14:31:16:802 2024 R2 IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet0/0 changed to down.
%Feb 20 14:31:16:802 2024 R2 IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet0/0 changed to down.
R1访问业务网段,则直接走R3
路由表:
[R1]display ip routing-table
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/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
192.168.0.0/22 Static 120 0 200.3.3.3 GE0/1
200.3.3.0/24 Direct 0 0 200.3.3.1 GE0/1
200.3.3.1/32 Direct 0 0 127.0.0.1 InLoop0
200.3.3.255/32 Direct 0 0 200.3.3.1 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]tracert 192.168.0.1
traceroute to 192.168.0.1 (192.168.0.1), 30 hops at most, 40 bytes each packet, press CTRL+C to break
1 200.3.3.3 (200.3.3.3) 0.000 ms 0.000 ms 0.000 ms
[R1]tracert 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 30 hops at most, 40 bytes each packet, press CTRL+C to break
1 200.3.3.3 (200.3.3.3) 0.000 ms 0.000 ms 1.000 ms
[R1]tracert 192.168.2.1
traceroute to 192.168.2.1 (192.168.2.1), 30 hops at most, 40 bytes each packet, press CTRL+C to break
1 200.3.3.3 (200.3.3.3) 0.000 ms 1.000 ms 0.000 ms
[R1]tracert 192.168.3.1
traceroute to 192.168.3.1 (192.168.3.1), 30 hops at most, 40 bytes each packet, press CTRL+C to break
1 200.3.3.3 (200.3.3.3) 0.000 ms 1.000 ms 0.000 ms
配置建议
建议在R3设备上配置一条黑洞路由,可防止因路由聚合导致的环路问题。
#
ip route-static 192.168.0.0 22 NULL0
实验附件