HCNA-27 RIP的水平分割及触发更新
基本地址配置和RIPv2搭建 <Huawei>system-view [Huawei]sysnamer3 [r3]interfaceGigabitEthernet 0/0/0 [r3-GigabitEthernet0/0/0]ipaddress 192.168.10.1 24 [r3-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1 [r3-GigabitEthernet0/0/1]ipaddress 172.16.10.3 24 [r3-GigabitEthernet0/0/1]quit [r3]rip1 [r3-rip-1]version2 [r3-rip-1]network192.168.10.0 [r3-rip-1]network172.16.0.0 [r3-rip-1]quit <Huawei>system-view [Huawei]sysnamer1 [r1]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]ipaddress 172.16.10.1 24 [r1-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]ipaddress 172.16.20.1 24 [r1-GigabitEthernet0/0/1]quit [r1]rip1 [r1-rip-1]version2 [r1-rip-1]network172.16.0.0 [r1-rip-1]quit <Huawei>system-view [rw]sysnamer2 [r2]interfaceGigabitEthernet 0/0/0 [r2-GigabitEthernet0/0/0]ipaddress 192.168.20.1 24 [r2-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]ipaddress 172.16.20.2 24 [r2-GigabitEthernet0/0/1]quit [r2]rip1 [r2-rip-1]version2 [r2-rip-1]network192.168.20.0 [r2-rip-1]network172.16.0.0 [r2-rip-1]quit 验证触发更新 删除R3与S1之间的连接线,然后在RIP收敛前查看R2的路路由表 [r2]display ip routing-table RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 12 Routes : 12 Destination/Mask Proto Pre Cost Flags NextHop Interface 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.10.0/24 RIP 100 1 D 172.16.20.1 GigabitEthernet 0/0/1 172.16.20.0/24 Direct 0 0 D 172.16.20.2 GigabitEthernet 0/0/1 172.16.20.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 172.16.20.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 192.168.10.0/24 RIP 100 2 D 172.16.20.1 GigabitEthernet 0/0/1 192.168.20.0/24 Direct 0 0 D 192.168.20.1 GigabitEthernet 0/0/0 192.168.20.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 192.168.20.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 查看路由表后发觉得192.168.10.0/24的网段依旧存在,这是由于刚才删除的连接线不是R1的直连接口,所以R1此时无法直接感知到故障已经发生,路由条目需要等待180S默认老化计时器超时后,此路由条目(192.168.10.0/24)才会在路由表中被删除。 下面恢复R3与S1之间的连接。 在RIP重新收敛过后(路由表恢复正常),再断掉R1与S1之间的链路,查看R2的路由表。 <r2>displayip routing-table RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 10 Routes : 10 Destination/Mask Proto Pre Cost Flags NextHop Interface 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.20.0/24 Direct 0 0 D 172.16.20.2 GigabitEthernet 0/0/1 172.16.20.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 172.16.20.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 192.168.20.0/24 Direct 0 0 D 192.168.20.1 GigabitEthernet 0/0/0 192.168.20.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 192.168.20.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 查看R2的路由表后发现,172.16.20.0/24和192.168.20.0/24的两个网段在路由表中会马上被删除,因为这次断掉的是R1的直连接口,所以R1能够直接感知到链路发生故障,在R1删除以上两个路由条目的同时会触发更新,使得R2上的路由表为最新状态。 验证水平分割 <r2>debuggingrip 1 sendGigabitEthernet 0/0/1 //debugging是一个调试命令组;此命令意思是在GE0/0/1接口上调试发送RIP 1数据包信息 <r2>terminalmonitor //监视终端信息 <r2>terminaldebugging //调试终端信息 Jun17 2020 22:58:46.771.1-08:00 r2 RIP/7/DBG: 6: 13456: RIP 1: Sending response on interface GigabitEthernet0/0/1 from172.16.20.2 to 224.0.0.9 Jun17 2020 22:58:46.771.2-08:00 r2 RIP/7/DBG: 6: 13476: Packet: Version 2, Cmd response,Length 24 Jun17 2020 22:58:46.771.3-08:00 r2 RIP/7/DBG: 6: 13546: Dest 192.168.20.0/24, N exthop0.0.0.0, Cost 1, Tag 0 从debug的信息中可以观察到R2发送给R1的路由条目中没有包含192.168.10.0/24网段的路由信息,因为该条目是从R1发过来的,因为华为接口默认开启了水平分割,所以RIP从某接口接收到的路由信息,不会从该接口再发回给邻居设备。 下面关闭debug并在R2的GE0/0/1和R1 GE 0/0/1接口下使用undo rip split-horizon关闭水平分割功能。 <r2>undo debugging all //取消所有调式命令 <r2>system-view [r2]interfaceGigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]undorip split-horizon //取消rip水平分割功能 [r2-GigabitEthernet0/0/1]return <r1>system-view [r1]interfaceGigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]undorip split-horizon [r1-GigabitEthernet0/0/1]return <r2>debuggingrip 1 send GigabitEthernet 0/0/1 <r2>terminalmonitor <r2>terminal debugging Jun17 2020 23:18:44.311.4-08:00 r2 RIP/7/DBG: 6: 13546: Dest 172.16.0.0/16, Nex thop0.0.0.0, Cost 1, Tag 0 [r2-GigabitEthernet0/0/1] Jun17 2020 23:18:44.311.5-08:00 r2 RIP/7/DBG: 6: 13546: Dest 192.168.10.0/24, N exthop0.0.0.0, Cost 3, Tag 0 [r2-GigabitEthernet0/0/1] Jun17 2020 23:18:44.311.6-08:00 r2 RIP/7/DBG: 6: 13546: Dest 192.168.20.0/24, N exthop0.0.0.0, Cost 1, Tag 0 从debug信息中发现此时R2发送给R1的路由条目中包含有192.168.10.0/24的网段,这是因为此时RIP接口上的水平分割功能不再生效。 验证毒性逆转 先关闭所有debug然后重新运行水平分割功能。 <r2>undodebugging all <r2>system-view [r2]interface GigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/0]ripsplit-horizon //配置接口开启水平分割 [r2-GigabitEthernet0/0/0]return <r1>system-view [r1]interface GigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]rip split-horizon [r1-GigabitEthernet0/0/1]return 重新开启debugging查看情况: <r2>debuggingrip 1 send GigabitEthernet 0/0/1 <r2>terminalmonitor <r2>terminaldebugging Jun17 2020 23:52:09.441.1-08:00 r2 RIP/7/DBG: 6: 13456: RIP 1: Sending response on interface GigabitEthernet0/0/1 from172.16.20.2 to 224.0.0.9 Jun17 2020 23:52:09.441.2-08:00 r2 RIP/7/DBG: 6: 13476: Packet: Version 2, Cmd response,Length 24 Jun17 2020 23:52:09.441.3-08:00 r2 RIP/7/DBG: 6: 13546: Dest 192.168.20.0/24, N exthop0.0.0.0, Cost 1, Tag 0 开启了水平分割后,R2不再回发R1的路由条目192.168.1.0/24网段。 下面关闭debug,然后在R2的GE 0/0/1接口下使用rippoison-reverse命令开启毒性逆转功能。 <r2>undodebugging all <r2>system-view [r2]interfaceGigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]rippoison-reverse //接口配置为开启RIP 毒性逆转 [r2-GigabitEthernet0/0/1]return 再打开debug查看R2发送给R1的路由信息 <r2>debuggingrip 1 send GigabitEthernet 0/0/1 <r2>terminalmonitor <r2>terminaldebugging Jun18 2020 00:04:42.761.2-08:00 r2 RIP/7/DBG: 6: 13476: Packet: Version 2, Cmd response,Length 64 <r2> Jun18 2020 00:04:42.761.3-08:00 r2 RIP/7/DBG: 6: 13546: Dest 172.16.10.0/24, Ne xthop172.16.20.1, Cost 16,Tag 0 <r2> Jun18 2020 00:04:42.761.4-08:00 r2 RIP/7/DBG: 6: 13546: Dest 192.168.10.0/24, N exthop172.16.20.1, Cost 16,Tag 0 <r2> Jun18 2020 00:04:42.761.5-08:00 r2 RIP/7/DBG: 6: 13546: Dest 192.168.20.0/24, N exthop0.0.0.0, Cost 1, Tag 0 可以观察到,R2发送给R1的路由条目中包含了192.168.10.0/24的网段,但是COST值(跳路)为16,即为可达。说明在毒性逆转和水平分割同时开启的情况下,简单的水平分割行为会被毒性逆转行为代替。(从某个接口学到的路由再从这个接口发布时将会被抑制。)
|