RIP配置详解

一.RIP协议概述

1.RIP是Routing Information Protocol(路由信息协议)的简称;

2.RIP是一种基于距离矢量(Distance-Vector)算法的路由协议;

3.RIP协议适用与中小型网络,分为RIPv1和RIPv2;

4.RIP支持水平分割,毒性逆转和出发更新等工作机制,防止路由环路;

5.RIP协议基于UDP传输,端口号是520.

二.RIP工作原理

1.RIP路由表的初始化

RIP配置详解-LMLPHP

2.RIP路由表的更新

RIP配置详解-LMLPHP

3.路由表的维护

RIP路由信息维护是由定时器完成的:

update定时器:定义了发送路由更新的时间间隔 30s

timeout定时器:定义了路由老化时间,如果在老化时间内没有收到关于某条路由的更新报文,则该条路由的度量值会被设置的无穷大(16),并且从IP路由表中撤销,定时器默认值是180s.

Garbage-Collect定时器:定义了一条路由从度量值变为16开始,直到它从路由表里面被彻底删除所经过的时间,如果Garbage-Collect超时,该路由仍没有得到更新,则该路由将被车垫删除,默认值是120s.

总结:RIP路由如果没有更新,300s后会被彻底删除,180s内如果没有更新,丢到回收站,180-300内还没有更新,彻底删除。

RIP配置详解-LMLPHP

4.拓扑变化在网络中的扩散

RIP配置详解-LMLPHP

三.RIP的防环路机制

1.路由毒化

  所谓网络毒化(route poisoning)就是路由器主动把路由表中发生故障的路由项以度量值无穷大(16)的形式通告给RIP邻居,以使邻居能够及时得知网络发生故障。

  比如:当与RTC相连接的路由器10.4.0.0网络发生故障,他就会告诉他最近的路由器说这这个网段不好使了,并将其设置为毒性路由,RTB也会告知他与它相近的路由器RTA,最终大家都知道后会将10.4.0.0网段的标记为“inf”,最终将删除这条路由。

RIP配置详解-LMLPHP

2.水平分割

  路由器从某个接口学到的路由不会将来路由发送给发给他的路由器,比如说RTB开始仅仅只有10.2.0.0和10.3.0.0网段,通过RIP协议从S0/0口学习到了10.1.0.0的路由,他就把送S0/0口学到的10.1.0.0的路由发送给RTA,同理,它也可以通过s1/0口学习到10.4.0.0网段的路由,学到后,将路由保存到自己的路由表中,不会讲10.4.0.0通过s1/0告知给RTC,但是他会通过s1/0告诉到他学习到的路由和自身的路由,也就是刚刚学习到的10.1.0.0和自身的路由10.2.0.0与10.3.0.0通过s1/0口告知给RTC.

  总结起来就一句话:路由器中某接口发送出去的路由,不会再从该接口接收。

RIP配置详解-LMLPHP

3.毒性逆转

  还是就着上面的例子,RTB开始的路由是10.2.0.0和10.3.0.0,RTB会通过RIP协议学习到相邻路由中不同网段的路由信息,当RTB学习到RTC的路由信息10.4.0.0网段的时候,当RTB要发送他自己的路由信息时,会自动将之前在s1/0口学习到的10.4.0.0的度量值为16,这就意味着RTB是不可能到达RTC的(RIP最大跳数是16)

  注意:毒性逆转可以超越水平分割,不受水平分割的影响。

RIP配置详解-LMLPHP

4.定义最大跳数:

  默认15跳,16跳不可达,RIP机制本身定义的。

RIP配置详解-LMLPHP

5.抑制时间

  1>.抑制时间和路由毒化结合使用,能够在一定程度上避免路由环路产生。

   2>.抑制时间规定,当一条路由的度量值变为无穷大(16)时,该路由进入抑制状态。在被抑制状态,只有来自同一邻居且度量值小鱼无穷大(16)的路由更新才会被路由器接受,取代不可达路由。

timeout:180s

回收站清空时间:120s

  如下图:当RTC路由器10.4.0.0网段发生故障的时候,他就会告知RTB说网络不可达,这个时候RTB就会把RTC发来关于10.4.0.0网段的路由器的度量值变为“inf”,与此同时会产生一个抑制时间,在这个抑制时间内,如果接受到了其他路由(RTA)关于10.4.0.0网段的路由信息,RTB不会去理会他,他会自动忽略RTA关于10.4.0.0网段的路由信息,因为在这个抑制时间内他只会等待RTC的路由更新,如果在这个抑制时间内,接受到关于10.4.0.0的路由的度量值小鱼16,那么RTB久会恢复RTB到RTC的路由,将不可达(inf)的cost值【度量值】更新,如果在这个时间内,RTC始终没有发送10.4.0.0的路由给RTB,那么过来抑制时间就会自动接受其他的路由关于10.4.0.0的路由信息,也就是说,过了抑制时间的话RTA发送路由信息10.4.0.0给RTB时,RTB会接受该信息哟~并更新自己的路由表。

RIP配置详解-LMLPHP

6.触发更新

  触发更新是指,当路由表中路由信息差生变化是,路由器不必等到更新周期到来,而立即发送路由更新给相邻路由器。路由更新中包含网络不可达信息迅速传播全网。让全网知道该路由信息时不可达的。

RIP配置详解-LMLPHP

多路径网络环路避免操作示例

RIP配置详解-LMLPHP

四.RIPv1与RIPv2的介绍

RIPv1的缺点

RIP配置详解-LMLPHP

RIPv2的改进

RIP配置详解-LMLPHP

五.配置RIP实验

实验要求:

  需要配置北京的客户端能够访问菲律宾的服务器,通过RIP协议使其互通。拓扑图如下:

RIP配置详解-LMLPHP

配置过程如下:

  注意:由于我用的是ENSP模拟器,这是一款华为的模拟器,所以命令和H3C在配置上是有点区别的,但是在配置RIP中的区别并不大,主要是在宣告自己路由的时候回有点差异,我在配置完毕后会有关于配置H3C设备是应该注意的地方。

“北京核心交换机”配置如下:

 “北京核心交换机”配置如下:

 [Huawei]sysname core
[core]interface Ethernet 0/0/10
[core-Ethernet0/0/10]port link-type trunk
[core-Ethernet0/0/10]quit

“北京网关地址”配置如下:

 “北京网关地址”配置如下:
[Huawei]sysname beijing
[beijing]interface Ethernet 0/0/0
[beijing-Ethernet0/0/0]ip address 172.30.1.254 24
[beijing-Ethernet0/0/0]quit
[beijing]interface GigabitEthernet 0/0/0
[beijing-GigabitEthernet0/0/0]ip address 36.110.101.138 24
[beijing-GigabitEthernet0/0/0]undo shutdown
[beijing-GigabitEthernet0/0/0]quit
[beijing]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------- -----------------
Routing Tables: Public
Destinations : 6 Routes : 6 Destination/Mask Proto Pre Cost Flags NextHop Interface 36.110.101.0/24 Direct 0 0 D 36.110.101.138 GigabitEthernet0/0/0
36.110.101.138/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
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
172.30.1.0/24 Direct 0 0 D 172.30.1.254 Ethernet0/0/0
172.30.1.254/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
[beijing]
[beijing]display ip interface brief
*down: administratively down
!down: FIB overload down
^down: standby
(l): loopback
(s): spoofing
(d): Dampening Suppressed
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 8
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 8 Interface IP Address/Mask Physical Protocol
Ethernet0/0/0 172.30.1.254/24 up up
Ethernet0/0/1 unassigned down down
GigabitEthernet0/0/0 36.110.101.138/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
GigabitEthernet0/0/3 unassigned down down
NULL0 unassigned up up(s)
Serial0/0/0 unassigned down down
Serial0/0/1 unassigned down down
Serial0/0/2 unassigned down down
Serial0/0/3 unassigned down down
[beijing]
[beijing]rip #启动RIP功能
[beijing-rip-1]version 2 #指定RIP版本
[beijing-rip-1]undo summary #关闭自动汇总,如果开启的话,他会默认把一些子网汇聚成一个共同的网络。
[beijing-rip-1]network 172.30.0.0 #宣告所拥有的路由
[beijing-rip-1]network 36.0.0.0

“上海骨干网”配置如下:

 “上海骨干网”配置如下:
[Huawei]sysname shanghai
[shanghai]interface GigabitEthernet 0/0/0
[shanghai-GigabitEthernet0/0/0]ip address 36.110.101.139 24
[shanghai-GigabitEthernet0/0/0]undo shutdown
[shanghai-GigabitEthernet0/0/0]quit
[shanghai]interface GigabitEthernet 0/0/1
[shanghai-GigabitEthernet0/0/1]ip address 180.168.255.118 24
[shanghai-GigabitEthernet0/0/1]undo shutdown
[shanghai-GigabitEthernet0/0/1]quit
[shanghai]rip
[shanghai-rip-1]version 2
[shanghai-rip-1]undo summary
[shanghai-rip-1]network 36.0.0.0
[shanghai-rip-1]network 180.168.0.0
[shanghai-rip-1]quit

“香港骨干网”配置如下:

 [Huawei]sysname hongkong
[hongkong]interface GigabitEthernet 0/0/1
[hongkong-GigabitEthernet0/0/1]ip address 180.168.255.119 24
[hongkong-GigabitEthernet0/0/1]undo shutdown
[hongkong-GigabitEthernet0/0/1]quit
[hongkong]interface GigabitEthernet 0/0/0
[hongkong-GigabitEthernet0/0/0]ip address 202.14.67.4 24
[hongkong-GigabitEthernet0/0/0]undo shutdown
[hongkong-GigabitEthernet0/0/0]quit
[hongkong]rip
[hongkong-rip-1]version 2
[hongkong-rip-1]undo summary
[hongkong-rip-1]network 180.168.0.0
[hongkong-rip-1]network 202.14.67.0
[hongkong-rip-1]quit

“海南岛骨干网”配置如下:

 [huawei]sysname hainan
[hainan]interface GigabitEthernet 0/0/0
[hainan-GigabitEthernet0/0/0]ip address 202.14.67.5 24
[hainan-GigabitEthernet0/0/0]undo shutdown
[hainan-GigabitEthernet0/0/0]quit
[hainan]interface GigabitEthernet 0/0/1
[hainan-GigabitEthernet0/0/1]ip address 221.11.132.21 24
[hainan-GigabitEthernet0/0/1]undo shutdown
[hainan-GigabitEthernet0/0/1]quit
[hainan]rip
[hainan-rip-1]version 2
[hainan-rip-1]undo summary
[hainan-rip-1]network 202.14.67.0
[hainan-rip-1]network 221.11.132.0
[hainan-rip-1]quit

“菲律宾路由器”配置如下:

 [Huawei]sysname feilvbin
[feilvbin]interface GigabitEthernet0/0/1
[feilvbin-GigabitEthernet0/0/1]ip address 221.11.132.22 24
[feilvbin-GigabitEthernet0/0/1]undo shutdown
[feilvbin-GigabitEthernet0/0/1]quit
[feilvbin]interface Ethernet 0/0/0
[feilvbin-Ethernet0/0/0]ip address 192.168.1.254 24
[feilvbin-Ethernet0/0/0]undo shutdown
[feilvbin-Ethernet0/0/0]quit
[feilvbin]rip
[feilvbin-rip-1]version 2
[feilvbin-rip-1]undo summary
[feilvbin-rip-1]network 221.11.132.0
[feilvbin-rip-1]network 192.168.1.0
[feilvbin-rip-1]quit
“菲律宾核心交换机”配置如下:
[Huawei]sysname core
[core]interface Ethernet 0/0/10
[core-Ethernet0/0/10]port link-type trunk
[core-Ethernet0/0/10]quit
 
注意,在配置RIP的时候华为交换机在宣告自己的地址的时候是宣告该接口的所属类的地址, 换句话说,也就是华为在宣告的时候,宣告的是以其所属IP类别进行宣告的,比如:
172.30.1.1宣告为172.30.0.0;
192.168.1.1(默认是C类IP)宣告为192.168.1.0;
10.10.10.1(默认是A类IP)宣告为10.0.0.0
但是H3C则不是,H3C直接需要你将每个接口的IP 直接宣告给邻居路由,比如:
172.30.1.1宣告为:172.30.1.1
192.168.1.1宣告为:192.168.1.1 
所以我们配置各个厂商类别的时候要注意哟~
 
 
配置好上面的服务之后,我们需要进行测试:
查看北京路由获取的路由表信息:
 <beijing>display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 10 Destination/Mask Proto Pre Cost Flags NextHop Interface 36.110.101.0/24 Direct 0 0 D 36.110.101.138 GigabitEthernet0
/0/0
36.110.101.138/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0
/0/0
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
172.30.1.0/24 Direct 0 0 D 172.30.1.254 Ethernet0/0/0
172.30.1.254/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
180.168.255.0/24 RIP 100 1 D 36.110.101.139 GigabitEthernet0/0/0
192.168.1.0/24 RIP 100 4 D 36.110.101.139 GigabitEthernet0/0/0
202.14.67.0/24 RIP 100 2 D 36.110.101.139 GigabitEthernet0/0/0
221.11.132.0/24 RIP 100 3 D 36.110.101.139 GigabitEthernet0/0/0
<beijing>

“北京客户端”测试结果如下:

 PC>ipconfig

 Link local IPv6 address...........: fe80::5689:98ff:fe4c:1e69
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 172.30.1.1
Subnet mask.......................: 255.255.255.0
Gateway...........................: 172.30.1.254
Physical address..................: 54-89-98-4C-1E-69
DNS server........................: PC>ping 192.168.1.254 Ping 192.168.1.254: 32 data bytes, Press Ctrl_C to break
From 192.168.1.254: bytes=32 seq=1 ttl=251 time=125 ms
From 192.168.1.254: bytes=32 seq=2 ttl=251 time=110 ms
From 192.168.1.254: bytes=32 seq=3 ttl=251 time=140 ms
From 192.168.1.254: bytes=32 seq=4 ttl=251 time=141 ms
From 192.168.1.254: bytes=32 seq=5 ttl=251 time=109 ms --- 192.168.1.254 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 109/125/141 ms PC>ping 192.168.1.1 Ping 192.168.1.1: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: bytes=32 seq=1 ttl=123 time=156 ms
From 192.168.1.1: bytes=32 seq=2 ttl=123 time=156 ms
From 192.168.1.1: bytes=32 seq=3 ttl=123 time=156 ms
From 192.168.1.1: bytes=32 seq=4 ttl=123 time=125 ms
From 192.168.1.1: bytes=32 seq=5 ttl=123 time=141 ms --- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 125/146/156 ms PC>

六.RIP防环实战演示

1.开启水平分割

接口默认是开启水平分割的,我们直接查看即可:

<beijing>terminal debugging  #开启调试模式

<beijing>debugging rip 1 packet  #观察RIP更新的详细信息

需要等待几秒张就会有包的接受和发送的信息:

 <beijing>
Apr 14 2017 12:53:38.260.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 12:53:38.260.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 12:53:38.260.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:53:38.260.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 12:53:38.260.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 12:53:38.260.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 12:53:40.320.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 12:53:40.320.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 12:53:40.320.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:53:40.320.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:53:40.320.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 12:53:40.320.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 12:53:40.320.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 12:53:40.320.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 12:53:42.280.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 12:53:42.280.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 24
Apr 14 2017 12:53:42.280.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:09.450.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 12:54:09.450.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 12:54:09.450.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:09.450.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 12:54:09.450.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 12:54:09.450.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 12:54:10.400.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 12:54:10.400.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 12:54:10.400.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:10.400.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:10.400.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 12:54:10.400.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 12:54:10.400.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 12:54:10.400.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 12:54:16.400.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 12:54:16.400.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 24
Apr 14 2017 12:54:16.400.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:38.560.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 12:54:38.560.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 12:54:38.560.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:38.560.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 12:54:38.560.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 12:54:38.560.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 12:54:43.540.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 12:54:43.540.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 24
Apr 14 2017 12:54:43.540.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:45.510.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 12:54:45.510.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 12:54:45.510.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:45.510.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 12:54:45.510.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 12:54:45.510.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 12:54:45.510.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 12:54:45.510.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2

输出的调试信息

如果你要关闭水平分割的话:

[beijing]interface GigabitEthernet 0/0/0

[beijing-GigabitEthernet0/0/0]undo rip split-horizon

 <beijing>terminal debugging
Info: Current terminal debugging is on.
<beijing>debugging rip 1 packet
<beijing>
Apr 14 2017 13:00:08.570.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 13:00:08.570.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:00:08.570.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:00:08.570.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:00:08.570.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:00:08.570.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 13:00:08.570.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:00:08.570.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:00:12.810.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 13:00:12.810.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 13:00:12.810.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:00:12.810.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:00:12.810.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:00:12.810.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:00:29.650.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 13:00:29.650.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:00:29.650.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:00:29.650.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:00:29.650.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 36.110.101.139, Cost 2, Tag 0
Apr 14 2017 13:00:29.650.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 36.110.101.139, Cost 5, Tag 0
Apr 14 2017 13:00:29.650.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 36.110.101.139, Cost 3, Tag 0
Apr 14 2017 13:00:29.650.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 36.110.101.139, Cost 4, Tag 0
Apr 14 2017 13:00:40.700.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 13:00:40.700.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:00:40.700.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:00:40.700.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:00:40.700.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:00:40.700.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 13:00:40.700.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:00:40.700.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:00:43.850.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 13:00:43.850.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 13:00:43.850.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:00:43.850.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:00:43.850.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:00:43.850.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0

关闭后的水平分割

  对比2个日志,我们发现开启的水平分割很少不会经常往外放松信息,但是关闭了水平分割就会一直往外发送自己活得的路由信息,这里我们就要结合水平分割的原理来理解了。

2.接口上开启毒性逆转

[beijing]interface GigabitEthernet 0/0/0

[beijing-GigabitEthernet0/0/0]rip poison-reverse

[beijing]quit

<beijing>terminal debugging

<beijing>debugging rip 1 packet

 <beijing>
Apr 14 2017 13:42:05.350.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 13:42:05.350.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:42:05.350.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 16, Tag 0
Apr 14 2017 13:42:05.350.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:42:05.350.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:42:05.350.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:42:05.350.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:42:05.350.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:42:13.70.2-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive respo
nse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 13:42:13.70.3-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2, C
md response, Length 84
Apr 14 2017 13:42:13.70.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:42:13.70.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24,
Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:42:13.70.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24,
Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:42:13.70.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:42:27.450.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 13:42:27.450.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:42:27.450.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:42:27.450.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:42:27.450.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:42:27.450.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 13:42:27.450.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:42:27.450.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:42:34.490.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 13:42:34.490.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:42:34.490.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 16, Tag 0
Apr 14 2017 13:42:34.490.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:42:34.490.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:42:34.490.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:42:34.490.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:42:34.490.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:42:45.150.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 13:42:45.150.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 13:42:45.150.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:42:45.150.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:42:45.150.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:42:45.150.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:42:58.620.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 13:42:58.620.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:42:58.620.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:42:58.620.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:42:58.620.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:42:58.620.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 13:42:58.620.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:42:58.620.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:43:02.620.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 13:43:02.620.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:43:02.620.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 16, Tag 0
Apr 14 2017 13:43:02.620.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:02.620.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:02.620.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:02.620.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:02.620.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:10.260.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 13:43:10.260.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 13:43:10.260.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:10.260.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:43:10.260.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:43:10.260.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:43:23.780.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 13:43:23.780.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:43:23.780.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:23.780.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:23.780.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:43:23.780.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 13:43:23.780.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:43:23.780.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:43:32.820.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 13:43:32.820.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 104
Apr 14 2017 13:43:32.820.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:32.820.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:32.820.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:32.820.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:32.820.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:36.400.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 13:43:36.400.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 13:43:36.400.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:36.400.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:43:36.400.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:43:36.400.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:43:49.870.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface Ethernet0/0/0 from 172.30.1.254 to 224.0.0.9
Apr 14 2017 13:43:49.870.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 124
Apr 14 2017 13:43:49.870.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 36.110.101.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:49.870.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:49.870.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:43:49.870.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 5, Tag 0
Apr 14 2017 13:43:49.870.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 13:43:49.870.8-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:43:59.930.1-08:00 beijing RIP/7/DBG: 6: 12227: RIP 1: Sending resp
onse on interface GigabitEthernet0/0/0 from 36.110.101.138 to 224.0.0.9
Apr 14 2017 13:43:59.930.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 104
Apr 14 2017 13:43:59.930.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:43:59.930.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:59.930.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:59.930.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:43:59.930.7-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 36.110.101.139, Cost 16, Tag 0
Apr 14 2017 13:44:06.460.1-08:00 beijing RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 36.110.101.139 on GigabitEthernet0/0/0
Apr 14 2017 13:44:06.460.2-08:00 beijing RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 84
Apr 14 2017 13:44:06.460.3-08:00 beijing RIP/7/DBG: 6: 12315: Dest 180.168.255.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 13:44:06.460.4-08:00 beijing RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 13:44:06.460.5-08:00 beijing RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 13:44:06.460.6-08:00 beijing RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0

开启毒性逆转输出信息

我们可以发现日志中出现了很多的cost为16的日志信息。

3.接口上配置silent-interface (即被动接口)

  被动接口,如果一个允许了RIP的接口被设置为被动接口,那么该接口只能接收路由更新,但是不发送路由更新。

[shanghai]rip

[shanghai-rip-1]version 2

[shanghai-rip-1]undo summary

[shanghai-rip-1]silent-interface GigabitEthernet 0/0/0  #将这个端口设置为被动端口
[shanghai-rip-1]quit 
[shanghai]quit 
<shanghai>terminal debugging 
<shanghai>debugging rip 1 packet  
<shanghai>debugging rip 1 event 

 <shanghai>
Apr 14 2017 18:41:54.90.1-08:00 shanghai RIP/7/DBG: 25: 4379: RIP 1: Periodic tim
er expired for interface GigabitEthernet0/0/1 (180.168.255.118) and its added to
periodic update queue
Apr 14 2017 18:41:54.90.2-08:00 shanghai RIP/7/DBG: 25: 4707: RIP 1: Interface Gi
gabitEthernet0/0/1 (180.168.255.118) is deleted from the periodic update queue
Apr 14 2017 18:41:54.750.1-08:00 shanghai RIP/7/DBG: 6: 12236: RIP 1: Receive res
ponse from 36.110.101.138 on GigabitEthernet0/0/0
Apr 14 2017 18:41:54.750.2-08:00 shanghai RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 24
Apr 14 2017 18:41:54.750.3-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24
, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:41:55.270.1-08:00 shanghai RIP/7/DBG: 6: 12227: RIP 1: Sending res
ponse on interface GigabitEthernet0/0/1 from 180.168.255.118 to 224.0.0.9
Apr 14 2017 18:41:55.270.2-08:00 shanghai RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 44
Apr 14 2017 18:41:55.270.3-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 36.110.101.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:41:55.270.4-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 18:41:56.60.1-08:00 shanghai RIP/7/DBG: 6: 12236: RIP 1: Receive resp
onse from 180.168.255.119 on GigabitEthernet0/0/1
Apr 14 2017 18:41:56.60.2-08:00 shanghai RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 64
Apr 14 2017 18:41:56.60.3-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 18:41:56.60.4-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24
, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:41:56.60.5-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 221.11.132.0/2
4, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 18:42:23.200.1-08:00 shanghai RIP/7/DBG: 25: 4379: RIP 1: Periodic ti
mer expired for interface GigabitEthernet0/0/1 (180.168.255.118) and its added to
periodic update queue
Apr 14 2017 18:42:23.200.2-08:00 shanghai RIP/7/DBG: 25: 4707: RIP 1: Interface G
igabitEthernet0/0/1 (180.168.255.118) is deleted from the periodic update queue
Apr 14 2017 18:42:23.920.1-08:00 shanghai RIP/7/DBG: 6: 12236: RIP 1: Receive res
ponse from 36.110.101.138 on GigabitEthernet0/0/0
Apr 14 2017 18:42:23.920.2-08:00 shanghai RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 24
Apr 14 2017 18:42:23.920.3-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24
, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:42:24.140.1-08:00 shanghai RIP/7/DBG: 6: 12236: RIP 1: Receive res
ponse from 180.168.255.119 on GigabitEthernet0/0/1
Apr 14 2017 18:42:24.140.2-08:00 shanghai RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 64
Apr 14 2017 18:42:24.140.3-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 192.168.1.0/2
4, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 18:42:24.140.4-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 202.14.67.0/2
4, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:42:24.140.5-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 221.11.132.0/
24, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 18:42:24.380.1-08:00 shanghai RIP/7/DBG: 6: 12227: RIP 1: Sending res
ponse on interface GigabitEthernet0/0/1 from 180.168.255.118 to 224.0.0.9
Apr 14 2017 18:42:24.380.2-08:00 shanghai RIP/7/DBG: 6: 12247: Packet: Version 2,
Cmd response, Length 44
Apr 14 2017 18:42:24.380.3-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 36.110.101.0/
24, Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:42:24.380.4-08:00 shanghai RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24
, Nexthop 0.0.0.0, Cost 2, Tag 0

调试为被动端口后的输出的信息

我们可以从这个日志中看出只有接收路由没有发送路由!

 
 
 六.RIP认证
配置香港的路由和海南的路由进行RIP认证模式。
 
香港 配置如下:

[hongkong]interface GigabitEthernet 0/0/0
[hongkong-GigabitEthernet0/0/0]rip authentication-mode md5 usual yinzhengjie123

海南配置如下:

[hainan]interface GigabitEthernet 0/0/0

[hainan-GigabitEthernet0/0/0]rip authentication-mode md5 usual yinzhengjie123

注意:H3C配置也是这样的格式配置,知识加密的方式变化了而已,注意配置认证的密码“yinzhengjie123”在2个即可要配置成一直才可以哟,不然会报错 
 <hainan>
Apr 14 2017 18:52:10.250.1-08:00 hainan RIP/7/DBG: 6: 12227: RIP 1: Sending respo
nse on interface GigabitEthernet0/0/0 from 202.14.67.5 to 224.0.0.9
Apr 14 2017 18:52:10.250.2-08:00 hainan RIP/7/DBG: 6: 12247: Packet: Version 2, C
md response, Length 68
Apr 14 2017 18:52:10.250.3-08:00 hainan RIP/7/DBG: 6: 12407: Authentication-mode
- MD5 Digest: e7c72b0b.7f7b45b0.93e21a3f.eaee65e1
Apr 14 2017 18:52:10.250.4-08:00 hainan RIP/7/DBG: 6: 12439: Sequence: 00000430
Apr 14 2017 18:52:10.250.5-08:00 hainan RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24, N
exthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 18:52:10.250.6-08:00 hainan RIP/7/DBG: 6: 12315: Dest 221.11.132.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:52:17.490.1-08:00 hainan RIP/7/DBG: 6: 12236: RIP 1: Receive respo
nse from 202.14.67.4 on GigabitEthernet0/0/0
Apr 14 2017 18:52:17.490.2-08:00 hainan RIP/7/DBG: 6: 12247: Packet: Version 2, C
md response, Length 88
Apr 14 2017 18:52:17.490.3-08:00 hainan RIP/7/DBG: 6: 12407: Authentication-mode
- MD5 Digest: 88e8c82a.cba1f8b4.df15be4b.8957aa3f
Apr 14 2017 18:52:17.490.4-08:00 hainan RIP/7/DBG: 6: 12439: Sequence: 0000043b
Apr 14 2017 18:52:17.490.5-08:00 hainan RIP/7/DBG: 6: 12315: Dest 36.110.101.0/24,
Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 18:52:17.490.6-08:00 hainan RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24, Ne
xthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 18:52:17.490.7-08:00 hainan RIP/7/DBG: 6: 12315: Dest 180.168.255.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:52:21.270.1-08:00 hainan RIP/7/DBG: 6: 12227: RIP 1: Sending respo
nse on interface GigabitEthernet0/0/1 from 221.11.132.21 to 224.0.0.9
Apr 14 2017 18:52:21.270.2-08:00 hainan RIP/7/DBG: 6: 12247: Packet: Version 2, C
md response, Length 84
Apr 14 2017 18:52:21.270.3-08:00 hainan RIP/7/DBG: 6: 12315: Dest 36.110.101.0/24
, Nexthop 0.0.0.0, Cost 3, Tag 0
Apr 14 2017 18:52:21.270.4-08:00 hainan RIP/7/DBG: 6: 12315: Dest 172.30.1.0/24,
Nexthop 0.0.0.0, Cost 4, Tag 0
Apr 14 2017 18:52:21.270.5-08:00 hainan RIP/7/DBG: 6: 12315: Dest 180.168.255.0/2
4, Nexthop 0.0.0.0, Cost 2, Tag 0
Apr 14 2017 18:52:21.270.6-08:00 hainan RIP/7/DBG: 6: 12315: Dest 202.14.67.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0
Apr 14 2017 18:52:25.860.2-08:00 hainan RIP/7/DBG: 6: 12236: RIP 1: Receive respo
nse from 221.11.132.22 on GigabitEthernet0/0/1
Apr 14 2017 18:52:25.860.3-08:00 hainan RIP/7/DBG: 6: 12247: Packet: Version 2, C
md response, Length 24
Apr 14 2017 18:52:25.860.4-08:00 hainan RIP/7/DBG: 6: 12315: Dest 192.168.1.0/24,
Nexthop 0.0.0.0, Cost 1, Tag 0

配置认证完毕会发现有认证的日志哟

调试完信息之后,如果不想看的话可以关闭调试信息:

<hainan>undo debugging all  #将所有的调试信息关闭。

 
 
 
 扩展题:
  路由器不收路由更新,180s后才能从IP路由表中丢到回收站,这个时间能不能缩短?
  答:可以的。
 
[beijing]rip 
[beijing-rip-1]version 2
[beijing-rip-1]timers timeout 60 #进程模式下降时间设置成为60s
 
 
 
 
 
 
 
05-06 19:53