目录
实验一:ripv1的基本功能
以下实验可以证明的rip1性质如下:
1.以“跳数”为距离。路由器到直接连接的网络的距离定义为 1,从一个路由器到非直接连接的网络的距离定义为所经过的路由器数 加1。允许一条路径最多只能包含15个路由器。最大值为16时,相当于网络不可达。
2.定期更新路由。RIP1按固定的时间间隔(例如每 30 秒)与所有相邻路由器以广播方式交换路由信息,更新路由。交换的信息是当前路由器所知道的全部信息,即完整路由表。当网络拓扑发生变化时,路由器也立即向相邻路由器通告拓扑变化后的路由信息。
3.RIP进程基于UDP实现通信,使用的端口号为520。
PC配置如下
配置路由器RTA
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTA
[RTA]int g0/0/2
[RTA-GigabitEthernet0/0/2]ip address 10.1.10.1 24
Sep 18 2023 21:51:46-08:00 RTA %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[RTA-GigabitEthernet0/0/2]qu
[RTA]interface g0/0/0
[RTA-GigabitEthernet0/0/0]ip address 172.16.101.1 24
Sep 18 2023 21:52:25-08:00 RTA %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[RTA-GigabitEthernet0/0/0]qu
配置路由器RTB
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTB
[RTB]interface g0/0/0
[RTB-GigabitEthernet0/0/0]ip address 172.16.101.2 24
Sep 18 2023 22:02:33-08:00 RTB %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[RTB-GigabitEthernet0/0/0]qu
[RTB]int g0/0/1
[RTB-GigabitEthernet0/0/1]ip address 172.16.102.2 24
[RTB-GigabitEthernet0/0/1]
Sep 18 2023 22:03:00-08:00 RTB %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[RTB-GigabitEthernet0/0/1]qu
[RTB]
配置路由器RTC
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTC
[RTC]int g0/0/2
[RTC-GigabitEthernet0/0/2]ip address 11.1.50.1 24
Sep 18 2023 22:05:17-08:00 RTC %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[RTC-GigabitEthernet0/0/2]qu
[RTC]int g0/0/0
[RTC-GigabitEthernet0/0/0]ip address 172.16.102.1 24
Sep 18 2023 22:05:43-08:00 RTC %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[RTC-GigabitEthernet0/0/0]qu
配置路由器RIPv1基本功能
#RTA中rip的配置
<RTA>sys
Enter system view, return user view with Ctrl+Z.
#在指定网段上使能RIP进程,指定RIP进程号为1
#RIP进程号取值范围为1~65535,默认值是1
[RTA]rip 1
#对指定网段接口使能RIP路由,地址必须是不带子网的地址段,使用点分十进制数形式
#network 0.0.0.0可以在所有接口上使能RIP
[RTA-rip-1]network 10.0.0.0
[RTA-rip-1]network 172.16.0.0
[RTA-rip-1]qu
[RTA]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
10.1.10.0/24 Direct 0 0 D 10.1.10.1 GigabitEthernet
0/0/2
10.1.10.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
10.1.10.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
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.101.0/24 Direct 0 0 D 172.16.101.1 GigabitEthernet
0/0/0
172.16.101.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.101.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
[RTA]display IP routing-table protocol rip
#只有在RTB配置rip时,才会显示,只有RTA配置rip时没有rip路由表
[RTA]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
172.16.102.0/24 RIP 100 1 D 172.16.101.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
#RTB中rip的配置
<RTB>sys
Enter system view, return user view with Ctrl+Z.
[RTB]rip 1
[RTB-rip-1]network 172.16.0.0
[RTB-rip-1]qu
[RTB]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/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
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.16.101.0/24 Direct 0 0 D 172.16.101.2 GigabitEthernet
0/0/0
172.16.101.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.101.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.102.0/24 Direct 0 0 D 172.16.102.2 GigabitEthernet
0/0/1
172.16.102.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
172.16.102.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
#查看路由器IP路由表中的RIP路由
[RTB]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
#RTC中rip的配置
<RTC>sys
Enter system view, return user view with Ctrl+Z.
[RTC]rip 1
[RTC-rip-1]network 11.0.0.0
[RTC-rip-1]network 172.16.0.0
[RTC-rip-1]qu
[RTC]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
11.1.50.0/24 Direct 0 0 D 11.1.50.1 GigabitEthernet
0/0/2
11.1.50.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
11.1.50.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
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.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.102.0/24 Direct 0 0 D 172.16.102.1 GigabitEthernet
0/0/0
172.16.102.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.102.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
[RTC]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
以RTA为例,有以下查看RIP配置结果的命令
# 查看 RIP 进程的当前运行状态及配置信息
<RTA> display rip
<RTA> display rip 1# 查看 RIP 的接口信息
<RTA> display rip linterface gigabitethernet 0/0/0
# 查看 RIP的邻居信息。
<RTA> display rip 1 neighbor# 查看 RIP 发布数据库的所有激活路由。这些路由以 RIP 更新报文的形式发送
<RTA> display rip l database# 查看所有从其他路由器学来的 RIP 路由信息,以及与每条路由相关的不同定时器的值
<RTA> display rip 1 route# 查看 RIP 接口上的统计信息,包括从接口上收到和发送的报文数量
<RTA> display rip statistics interface all<RTA> display rip l statistics interface gigabitethernet 0/0/0
# 查看路由器 IP路由表。
<RTA> display IP routing-table# 查看路由器 IP路由表详细信息
<RTA> display IP routing-table verbose# 查看 IPv4 路由表的综合路由统计信息
<RTA> display ip routing-table statistics# 查看路由器IP路由表中的RIP路由
<RTA> display IP routing-table protocol rip
两个主机互ping结果如下:
PC>ping 11.1.50.11
Ping 11.1.50.11: 32 data bytes, Press Ctrl_C to break
From 11.1.50.11: bytes=32 seq=1 ttl=125 time=16 ms
From 11.1.50.11: bytes=32 seq=2 ttl=125 time=31 ms
From 11.1.50.11: bytes=32 seq=3 ttl=125 time=16 ms
From 11.1.50.11: bytes=32 seq=4 ttl=125 time=31 ms
From 11.1.50.11: bytes=32 seq=5 ttl=125 time=16 ms
--- 11.1.50.11 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 16/22/31 ms
#PC-50-1
PC>ping 10.1.10.11
Ping 10.1.10.11: 32 data bytes, Press Ctrl_C to break
From 10.1.10.11: bytes=32 seq=1 ttl=125 time=16 ms
From 10.1.10.11: bytes=32 seq=2 ttl=125 time=31 ms
From 10.1.10.11: bytes=32 seq=3 ttl=125 time=31 ms
From 10.1.10.11: bytes=32 seq=4 ttl=125 time=16 ms
From 10.1.10.11: bytes=32 seq=5 ttl=125 time=16 ms
--- 10.1.10.11 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 16/22/31 ms
PC>tracert 10.1.10.11
traceroute to 10.1.10.11, 8 hops max
(ICMP), press Ctrl+C to stop
1 11.1.50.1 <1 ms 16 ms <1 ms
2 172.16.102.2 31 ms 16 ms 15 ms
3 172.16.101.1 32 ms 31 ms 31 ms
4 10.1.10.11 16 ms 15 ms 16 ms
对RTB的0/0/0端口进行抓包
可以看到Destination:255.255.255.255,因为RIP1用的是广播更新
对RTB的 g0/0/1端口数据抓包
下图可以看出RIP1使用的是UDP的520端口
下图表示路由器到直接连接的网络的距离定义为 1
实验二:ripv2的基本功能
以下实验展示rip2的功能
各路由器功能如实验一配置,先配置RTA的RIP2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTA
[RTA]int g0/0/2
[RTA-GigabitEthernet0/0/2]ip address 10.1.10.1 24
Sep 19 2023 08:33:15-08:00 RTA %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[RTA-GigabitEthernet0/0/2]qu
[RTA]int g0/0/0
[RTA-GigabitEthernet0/0/0]ip address 172.16.101.1 24
Sep 19 2023 08:33:30-08:00 RTA %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[RTA-GigabitEthernet0/0/0]qu
[RTA]
# 在指定网段上使能 RIP 进程,指定 RIP 进程号为 1
# RIP 进程号取值范围是 1~65535。默认值是 1。
# undo rip 命令用来去使能指定的 RIP 进程
[RTA]rip 1
[RTA-rip-1]version 2
# 对指定网段接口使能 RIP 路由。地址必须是不带子网的地址段,使用点分十进制数形式
# 命令 network 0.0.0.0 可以在所有接口上使能 RIP。
# undo network 命今用来对指定网段接口去使能 RIP路由
[RTA-rip-1]network 10.0.0.0
[RTA-rip-1]network 172.16.0.0
[RTA-rip-1]qu
[RTA]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
10.1.10.0/24 Direct 0 0 D 10.1.10.1 GigabitEthernet
0/0/2
10.1.10.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
10.1.10.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
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.101.0/24 Direct 0 0 D 172.16.101.1 GigabitEthernet
0/0/0
172.16.101.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.101.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
[RTA]display IP routing-table protocol rip
[RTA]display IP routing-table protocol rip
#只有在创建RTB的rip后才有rip的路由表,只有RTA创建则还没有路由表
[RTA]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
172.16.102.0/24 RIP 100 1 D 172.16.101.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
配置RTB的rip
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTB
[RTB]int g0/0/0
[RTB-GigabitEthernet0/0/0]ip address 172.16.101.2 24
[RTB-GigabitEthernet0/0/0]
Sep 19 2023 08:34:06-08:00 RTB %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[RTB-GigabitEthernet0/0/0]qu
[RTB]int g0/0/1
[RTB-GigabitEthernet0/0/1]ip address 172.16.102.2 24
Sep 19 2023 08:34:26-08:00 RTB %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[RTB-GigabitEthernet0/0/1]qu
[RTB]
<RTB>sys
Enter system view, return user view with Ctrl+Z.
[RTB]rip 1
[RTB-rip-1]version 2
[RTB-rip-1]network 172.16.0.0
[RTB-rip-1]qu
[RTB]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.10.0/24 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/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
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.16.101.0/24 Direct 0 0 D 172.16.101.2 GigabitEthernet
0/0/0
172.16.101.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.101.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.102.0/24 Direct 0 0 D 172.16.102.2 GigabitEthernet
0/0/1
172.16.102.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
172.16.102.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[RTB]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.10.0/24 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
配置RTC的rip
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTC
[RTC]int g0/0/2
[RTC-GigabitEthernet0/0/2]ip address 11.1.50.1 24
Sep 19 2023 08:34:56-08:00 RTC %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[RTC-GigabitEthernet0/0/2]qu
[RTC]int g0/0/0
[RTC-GigabitEthernet0/0/0]ip address 172.16.102.1 24
Sep 19 2023 08:35:12-08:00 RTC %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[RTC-GigabitEthernet0/0/0]qu
<RTC>sys
Enter system view, return user view with Ctrl+Z.
[RTC]rip 1
[RTC-rip-1]version 2
[RTC-rip-1]network 11.0.0.0
[RTC-rip-1]network 172.16.0.0
[RTC-rip-1]qu
[RTC]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.10.0/24 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
11.1.50.0/24 Direct 0 0 D 11.1.50.1 GigabitEthernet
0/0/2
11.1.50.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
11.1.50.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
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.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.102.0/24 Direct 0 0 D 172.16.102.1 GigabitEthernet
0/0/0
172.16.102.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.102.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
[RTC]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.10.0/24 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
可以用以下命令查看配置
# 查看 RIP 进程的当前运行状态及配置信息
<RTA> display rip
<RTA> display rip 1# 查看 RIP的接口信息。
<RTA> display rip l interface gigabitethernet 0/0/0# 查看 RIP 的邻居信息
<RTA> display rip 1 neighbor# 查看 RIP 发布数据库的所有激活路由。这些路由以 RIP 更新报文的形式发送
<RTA> display rip l database# 查看所有从其他路由器学来的 RIP 路由信息,以及与每条路由相关的不同定时器的值
<RTA> display rip l route# 查看 RIP 接口上的统计信息,包括从接口上收到和发送的报文数量
<RTA> display rip l statistics interface all
<RTA> display rip l statistics interface gigabitethernet 0/0/0# 查看路由器 IP路由表。
<RTA> display IP routing-table
<RTA> display IP routing-table
两台PC互ping
PC>ping 11.1.50.11
Ping 11.1.50.11: 32 data bytes, Press Ctrl_C to break
From 11.1.50.11: bytes=32 seq=1 ttl=125 time=16 ms
From 11.1.50.11: bytes=32 seq=2 ttl=125 time=31 ms
From 11.1.50.11: bytes=32 seq=3 ttl=125 time=16 ms
From 11.1.50.11: bytes=32 seq=4 ttl=125 time=31 ms
From 11.1.50.11: bytes=32 seq=5 ttl=125 time=31 ms
--- 11.1.50.11 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 16/25/31 ms
PC>tracert 11.1.50.11
traceroute to 11.1.50.11, 8 hops max
(ICMP), press Ctrl+C to stop
1 10.1.10.1 15 ms 16 ms 16 ms
2 172.16.101.2 15 ms 16 ms 31 ms
3 172.16.102.1 31 ms 32 ms 15 ms
4 11.1.50.11 16 ms 31 ms 31 ms
#PC-50-1
PC>ping 11.1.50.11
Ping 11.1.50.11: 32 data bytes, Press Ctrl_C to break
From 11.1.50.11: bytes=32 seq=1 ttl=125 time=16 ms
From 11.1.50.11: bytes=32 seq=2 ttl=125 time=31 ms
From 11.1.50.11: bytes=32 seq=3 ttl=125 time=16 ms
From 11.1.50.11: bytes=32 seq=4 ttl=125 time=31 ms
From 11.1.50.11: bytes=32 seq=5 ttl=125 time=31 ms
--- 11.1.50.11 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 16/25/31 ms
PC>tracert 11.1.50.11
traceroute to 11.1.50.11, 8 hops max
(ICMP), press Ctrl+C to stop
1 10.1.10.1 15 ms 16 ms 16 ms
2 172.16.101.2 15 ms 16 ms 31 ms
3 172.16.102.1 31 ms 32 ms 15 ms
4 11.1.50.11 16 ms 31 ms 31 ms
对RTA进行抓包,Destination是224.0.0.9,这表示ripv2的更新方式是组播更新
对RTB进行抓包
ripV1和ripV2的rip路由表对比如下
rip2用的是UDP的520端口
wireshark查看信息的步骤
rip1和rip2的区别和联系
联系
1.rip1和rip2都采用UDP封装,报文的源,目的端口均为520端口
2.RIP 通过广播UDP报文来交换路由信息,每30秒发送一次路由信息更新。RIP最多支持的跳数为15,即在源和目的网间所要经过的最多路由器的数目为15,跳数16表示不可达。
可以通过display rip查看,例如rip1
其中
“RIP process: 1” 表示RIP的进程编号为1 ;
“RIP version : 1” 表示运行的是RIPv1 ;
“Preference:100” 表示RIP的协议优先级的值为100 ;
“Update time : 30 sec” :表示更新定时器的周期值为30秒;
“Age time:180 sec” :表示无效定时器的周期值为180秒,也称为老化定时器;
“Garbage-collect time :120 sec” : 表示垃圾收集定时器的初始值为120秒
这些是从http://t.csdn.cn/u0ACa学习到的,里面还有更多详细的抓包信息,推荐看看!
区别
1.rip1发送更新包时采用广播包,而rip2采用组播包
2.rip1是一个有类路由协议,不支持VLSM,rip2是一个无类路由协议,支持VLSM
实验三:路由器配置RIPv2鉴别
RIP路由更新报文以明文形式广播或组播给所有的RIP路由器,任何 RIP路由器都可以发送和接收路由更新报文,从而改变或影响RIP路由器 的路由选择结果。攻击者经常利用该特性对网络发动攻击。通过发送非 法的路由更新报文,欺骗路由器更新路由表,将分组转发到错误的目的 地。防止这种攻击的一种方法是使用鉴别。
RIPv1不支持鉴别,RIPv2支持报文的鉴别。RIPv2协议能够通过路由更新消息所包含的密码来验证该路由更新来源是否合法,其方式有两种
简单(Simple)鉴别和MD5(Message Digest 5)密文鉴别。当一方开启鉴别之后,另一方也同样需要开启鉴别,且只有密码一致时,路由更新才生效。
在简单鉴别方式中,鉴别使用的密码以明文随着路由更新报文一起发送出去,因此安全性较低。在MD5鉴别方式中,不发送鉴别使用的密码,而是使用MD5算法根据一个随意长度的明文消息和密码产生一个哈希摘要,然后将该摘要随着路由更新报文一起发送出去,以确保不能通过窃听获取密码。拥有相同密码的接收者会计算它自己的哈希摘要,如 果内容没有被更改,接收者计算的哈希摘要应该和发送的哈希摘要相 等。MD5报文认证主要用于对安全性要求较高的内部网络中。
案例如下:
在实验二的基础上配置
在RTA上配置鉴别
[RTA]rip 1
[RTA-rip-1]version 2
[RTA-rip-1]network 10.0.0.0
[RTA-rip-1]network 172.16.0.0
[RTA-rip-1]qu
#配置与路由器RTB通信时使用的鉴别方法
[RTA]int g0/0/0
#使用简单鉴别,密码为12345678,配置文件中的密码显示明文
#两端的鉴别方法和密码必须一致,否则不能通过验证导致鉴别失败
[RTA-GigabitEthernet0/0/0]rip authentication-mode simple 12345678
#或者,使用简单鉴别,密码为12345678,配置文件中的密码显示密文
#[RTA-GigabitEthernet0/0/0]rip authentication-mode simple cipher 12345678
[RTA-GigabitEthernet0/0/0]qu
在RTB上配置鉴别
[RTB]rip 1
[RTB-rip-1]version 2
[RTB-rip-1]network 172.16.0.0
[RTB-rip-1]qu
#配置与路由器RTA通信时使用的鉴别方法
[RTB]int g0/0/0
[RTB-GigabitEthernet0/0/0]rip authentication-mode simple 12345678
[RTB-GigabitEthernet0/0/0]rip authentication-mode simple cipher 12345678
[RTB-GigabitEthernet0/0/0]qu
#配置与路由器RTC通信时使用的鉴别方法
[RTB]int g0/0/1
#使用MD5鉴别,配置文件中的密码显示明文,使用通用报文格式
[RTB-GigabitEthernet0/0/1]rip authentication-mode md5 usual 12345678
#显示密文
#[RTB-GigabitEthernet0/0/1]rip authentication-mode md5 usual cipher 12345678
[RTB-GigabitEthernet0/0/1]qu
在RTC上鉴别
[RTC]rip 1
[RTC-rip-1]version 2
[RTC-rip-1]network 11.0.0.0
[RTC-rip-1]network 172.16.0.0
[RTC-rip-1]qu
[RTC]int g0/0/0
[RTC-GigabitEthernet0/0/0]rip authentication-mode md5 usual 12345678
#使用密文
#[RTC-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 12345678
[RTC-GigabitEthernet0/0/0]qu
可用以下配置检查配置结果
# 查看 RIP 进程的当前运行状态及配置信息
<RTA> display rip
<RTA> display rip1
# 查看 RIP 的接口信息
<RTA> display rip 1 interface gigabitethernet 0/0/0
# 查看 RIP 的邻居信息
<RTA> display rip 1 neighbor
# 查看 RIP 发布数据库的所有激活路由。这些路由以 RIP 更新报文的形式发送
<RTA> display rip 1 database
# 查看所有从其他路由器学来的 RIP 路由信息,以及与每条路由相关的不同定时器的值。
<RTA> display rip route
# 查看 RIP 接口上的统计信息,包括从接口上收到和发送的报文数量
<RTA> display rip 1 statistics interface all
<RTA> display rip l statistics interface gigabitethernet 0/0/0# 查看路由器 IP路由表
<RTA> display IP routing-table
<RTA> display IP routing-table protocol rip
PC-10-1与 PC-50-1互ping,可以ping通,鉴别配置无误
PC>ping 11.1.50.11
Ping 11.1.50.11: 32 data bytes, Press Ctrl_C to break
From 11.1.50.11: bytes=32 seq=1 ttl=125 time=16 ms
From 11.1.50.11: bytes=32 seq=2 ttl=125 time=31 ms
From 11.1.50.11: bytes=32 seq=3 ttl=125 time=16 ms
From 11.1.50.11: bytes=32 seq=4 ttl=125 time=31 ms
From 11.1.50.11: bytes=32 seq=5 ttl=125 time=15 ms
--- 11.1.50.11 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/21/31 ms
PC>ping 10.1.10.11
Ping 10.1.10.11: 32 data bytes, Press Ctrl_C to break
From 10.1.10.11: bytes=32 seq=1 ttl=125 time=32 ms
From 10.1.10.11: bytes=32 seq=2 ttl=125 time=15 ms
From 10.1.10.11: bytes=32 seq=3 ttl=125 time=31 ms
From 10.1.10.11: bytes=32 seq=4 ttl=125 time=32 ms
From 10.1.10.11: bytes=32 seq=5 ttl=125 time=15 ms
--- 10.1.10.11 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/25/32 ms
PC-10-1 ping PC-50-1 即ping 11.1.50.11 -t
对RTB的g0/0/0端口抓包如下:
其中RTA和RTB之间采用的鉴别方式如下:
同理,对RTB的g0/0/1端口抓包 ,Authentication:Keyed Message Digest 表示鉴别类型为MD5
修改rip2的鉴别配置,以RTA为例
[RTA]int g0/0/0
[RTA-GigabitEthernet0/0/0]undo rip authentication-mode
#使用明文
[RTA-GigabitEthernet0/0/0]rip authentication-mode simple 1234
#使用密文
#[RTA-GigabitEthernet0/0/0]rip authentication-mode simple cipher 1234
[RTA-GigabitEthernet0/0/0]qu
用PC-10-1 ping PC-50-1,对RTB的g0/0/0端口抓包
密码变为1234
查看RTA中的rip配置结果
[RTA]display rip 1
Public VPN-instance
RIP process : 1
RIP version : 2
Preference : 100
Checkzero : Enabled
Default-cost : 0
Summary : Enabled
Host-route : Enabled
Maximum number of balanced paths : 8
Update time : 30 sec Age time : 180 sec
Garbage-collect time : 120 sec
Graceful restart : Disabled
BFD : Disabled
Silent-interfaces : None
Default-route : Disabled
Verify-source : Enabled
Networks :
172.16.0.0 10.0.0.0
Configured peers : None
Number of routes in database : 7
Number of interfaces enabled : 2
Triggered updates sent : 4
Number of route changes : 7
Number of replies to queries : 1
[RTA]display rip 1 int g0/0/0
--------------------------------------------------------------------------
Interface IP Address State Protocol MTU
--------------------------------------------------------------------------
GE0/0/0 172.16.101.1 UP RIPv2 Multicast 500
# 查看所有从其他路由器学来的 RIP 路由信息,以及与每条路由相关的不同定时器的值
[RTA]display rip 1 route
Route Flags : R - RIP
A - Aging, G - Garbage-collect
----------------------------------------------------------------------------
Peer 172.16.101.2 on GigabitEthernet0/0/0
Destination/Mask Nexthop Cost Tag Flags Sec
172.16.102.0/24 172.16.101.2 16 0 RG 59
11.1.50.0/24 172.16.101.2 16 0 RG 59
#查看路由器IP路由表
## RIP 的路由更新要花费一定的时间,需要等待一段时间(3 分钟左右)后才能在路由表中看到配置是否生效
[RTA]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
10.1.10.0/24 Direct 0 0 D 10.1.10.1 GigabitEthernet
0/0/2
10.1.10.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
10.1.10.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
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.101.0/24 Direct 0 0 D 172.16.101.1 GigabitEthernet
0/0/0
172.16.101.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
172.16.101.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
#鉴别方法和密码不一致,鉴别失败,所以没有rip的路由显示
[RTA]display IP routing-table protocol rip
此时PC-10-1与PC-50-1 ping 不通
因为鉴定方式改变后,两端的鉴别方法和密码不一致了,不能通过验证鉴别失败
PC>ping 11.1.50.11
Ping 11.1.50.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
--- 11.1.50.11 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
PC>ping 10.1.10.11
Ping 10.1.10.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
--- 10.1.10.11 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
实验四: RIP路由环路和慢收敛
RIP 存在这样一个特点:当网络出现故障时,要经过比较长的时间 才能将此信息传送到所有的路由器,但如果一个路由器发现了更短的路 由,那么这种更新信息就传播得很快。RIP的这一特点叫作:好消息传 播得快,而坏消息传播得慢。“坏消息传播得慢”有可能会产生路由环路。为了使坏消息传播得更快些,加快收敛,消除路由环路,可以采取以下机制:
•将距离等于 16 的路由定义为不可达(Infinity)。在链路断 开或路由环路发生时,路由的距离将会增加到16,该路由被认为不可 达。
•触发更新(Triggered Updates):若网络拓扑没有变化,则按 通常的间隔发送路由更新报文。一旦网络拓扑有变化,例如某条路由的 距离发生了变化,就立刻向邻居路由器发布路由更新报文,而不是等到 更新周期的到来。
•水平分割(Split Horizon):RIP从某个端口学到的路由,不会从该端口再发回给邻居路由器。这样不但减少了带宽消耗,还可以防 止路由环路。
•毒性逆转(Poison Reverse):RIP从某个端口学到路由后,将 该路由的距离设置为16(不可达),并从原端口发回邻居路由器。利用这种方式,可以清除对方路由表中的无用信息。
RIPv1和RIPv2都支持水平分割、毒性反转和触发更新。
在华为设备上,水平分割默认是开启的,毒性逆转默认是关闭的。 如果同时开启了水平分割和毒性逆转,则毒性逆转替代水平分割。
案例如下:这里以rip1为例
按照实验一配置rip1
关闭RTA自动地址聚合,且关闭与路由器RTB之间的水平分割和毒性逆转
<RTA>sys
Enter system view, return user view with Ctrl+Z.
#关闭自动地址聚集功能
[RTA]rip 1
[RTA-rip-1]undo summary
[RTA-rip-1]qu
#关闭水平分割和毒性逆转
[RTA]interface g0/0/0
[RTA-GigabitEthernet0/0/0]undo rip split-horizon
[RTA-GigabitEthernet0/0/0]undo rip poison-reverse
[RTA-GigabitEthernet0/0/0]qu
同理, 关闭RTB自动地址聚合,且关闭与路由器RTA与RTC之间的水平分割和毒性逆转
<RTB>sys
Enter system view, return user view with Ctrl+Z.
[RTB]rip 1
[RTB-rip-1]undo summary
[RTB-rip-1]qu
[RTB]int g0/0/0
[RTB-GigabitEthernet0/0/0]undo rip split-horizon
[RTB-GigabitEthernet0/0/0]undo rip poison-reverse
[RTB-GigabitEthernet0/0/0]qu
[RTB]int g0/0/1
[RTB-GigabitEthernet0/0/1]undo rip split-horizon
[RTB-GigabitEthernet0/0/1]undo rip poison-reverse
[RTB-GigabitEthernet0/0/1]qu
关闭RTC自动地址聚合,且关闭与路由器RTB之间的水平分割和毒性逆转
<RTC>sys
Enter system view, return user view with Ctrl+Z.
[RTC]rip 1
[RTC-rip-1]undo summary
[RTC-rip-1]qu
[RTC]int g0/0/0
[RTC-GigabitEthernet0/0/0]undo rip split-horizon
[RTC-GigabitEthernet0/0/0]undo rip poison-reverse
[RTC-GigabitEthernet0/0/0]qu
数据抓包
同时开启了水平分割和毒性逆转,则毒性逆转替代水平分割。
RIP从某个端口学到路由后,将该路由的距离设置为16(不可达),并从原端口发回邻居路由器,例如从RTA的g0/0/0端口学习到172.16.101.0的路由,就将路由距离设为不可达,并从RTB的g0/0/0发回去
对RTB的g0/0/0端口抓包,源地址为172.16.101.1
没有关闭水平分割和毒性逆转之前
对RTB的g0/0/0端口抓包,源地址为172.16.101.2
没有关闭水平分割和毒性逆转之前
对RTB的g0/0/1端口抓包,源地址为172.16.102.1
没有关闭水平分割和毒性逆转之前
对RTB的g0/0/1端口抓包,源地址为172.16.102.2
没有关闭水平分割和毒性逆转之前
关闭路由器RTC端口GE 0/0/2,模拟与计算机PC-50-1之间的链 路断开(模拟坏消息)。
[RTC]int g0/0/2
[RTC-GigabitEthernet0/0/2]shutdown
Sep 20 2023 01:35:29-08:00 RTC %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEther
net0/0/2 has turned into DOWN state.
[RTC-GigabitEthernet0/0/2]
[RTC-GigabitEthernet0/0/2]qu
在路由器RTB端口GE 0/0/0上抓包
到达计算机PC-50-1的路由的距离变为了16
以下为各路由的路由表
[RTA]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.101.2 GigabitEthernet
0/0/0
172.16.102.0/24 RIP 100 1 D 172.16.101.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
#RTB
[RTB]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
#RTC
[RTC]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
对RTB的g0/0/0端口抓包可以看到 ,经过80次更新,距离才变为16
打开路由器RTC端口GE 0/0/2,模拟与计算机PC-50-1之间的链路连通(模拟好消息)。
[RTC]int g0/0/2
[RTC-GigabitEthernet0/0/2]undo shutdown
[RTC-GigabitEthernet0/0/2]qu
[RTC]
Sep 20 2023 01:46:01-08:00 RTC %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEther
net0/0/2 has turned into UP state.
[RTC]
Sep 20 2023 01:46:01-08:00 RTC %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
再次观察路由表
[RTA]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 3 Routes : 3
RIP routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.101.2 GigabitEthernet
0/0/0
11.0.0.0/8 RIP 100 2 D 172.16.101.2 GigabitEthernet
0/0/0
172.16.102.0/24 RIP 100 1 D 172.16.101.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
#RTB
[RTB]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/0/0
11.0.0.0/8 RIP 100 1 D 172.16.102.1 GigabitEthernet
0/0/1
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
#RTC
[RTC]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 3 Routes : 3
RIP routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
11.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
对RTB的g0/0/0端口抓包,速度远比传播坏消息快得多
对于好消息传得快,坏消息传得慢:
实验五:验证水平分割对路由环路和慢收敛的影响
打开路由器的水平分割功能
[RTA]int g0/0/0
[RTA-GigabitEthernet0/0/0]rip split-horizon
[RTA-GigabitEthernet0/0/0]qu
[RTB]int g0/0/0
[RTB-GigabitEthernet0/0/0]rip split-horizon
[RTB-GigabitEthernet0/0/0]qu
[RTB]int g0/0/1
[RTB-GigabitEthernet0/0/1]rip split-horizon
[RTB-GigabitEthernet0/0/1]qu
[RTC]int g0/0/0
[RTC-GigabitEthernet0/0/0]rip split-horizon
[RTC-GigabitEthernet0/0/0]qu
关闭路由器RTC端口GE 0/0/2,模拟与PC-50-1之间的链路断开 (模拟坏消息)。
查看路由器的路由表
[RTA]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
172.16.102.0/24 RIP 100 1 D 172.16.101.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
#RTB
[RTB]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
#RTC
[RTC-GigabitEthernet0/0/2]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
对RTB的g0/0/0抓包,源端口172.16.101.1
打开水平分割后,接受坏消息时收敛速度明显增加
打开路由器RTC端口GE 0/0/2,模拟与计算机PC-50-1之间的链 路连通(模拟好消息)。
各路由器的路由表如下
[RTA]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
11.0.0.0/8 RIP 100 2 D 172.16.101.2 GigabitEthernet
0/0/0
172.16.102.0/24 RIP 100 1 D 172.16.101.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[RTB]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/0/0
11.0.0.0/8 RIP 100 1 D 172.16.102.1 GigabitEthernet
0/0/1
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[RTC]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
对RTB的g0/0/0端口抓包,接收好消息的速度很快
实验六:验证毒性逆转对路由环路和慢收敛的影响
开启各路由器毒性逆转功能
[RTA]int g0/0/0
[RTA-GigabitEthernet0/0/0]undo rip split-horizon
[RTA-GigabitEthernet0/0/0]rip poison-reverse
[RTA-GigabitEthernet0/0/0]qu
[RTA]
[RTB]int g0/0/0
[RTB-GigabitEthernet0/0/0]undo rip split-horizon
[RTB-GigabitEthernet0/0/0]rip poison-reverse
[RTB-GigabitEthernet0/0/0]qu
[RTB]int g0/0/1
[RTB-GigabitEthernet0/0/1]undo rip split-horizon
[RTB-GigabitEthernet0/0/1]rip poison-reverse
[RTB-GigabitEthernet0/0/1]qu
[RTC]int g0/0/0
[RTC-GigabitEthernet0/0/0]undo rip split-horizon
[RTC-GigabitEthernet0/0/0]rip poison-reverse
[RTC-GigabitEthernet0/0/0]qu
关闭路由器RTC端口GE 0/0/2,模拟与计算机PC-50-1之间的链 路断开(模拟坏消息)。
各路由器路由表如下:
[RTA]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
172.16.102.0/24 RIP 100 1 D 172.16.101.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
<RTB>sys
Enter system view, return user view with Ctrl+Z.
[RTB]display IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
<RTC>sys
Enter system view, return user view with Ctrl+Z.
[RTC]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
接受坏消息的收敛速度也很快
打开路由器RTC端口GE 0/0/2,模拟与计算机PC-50-1之间的链 路连通(模拟好消息)
各路由器rip路由表如下
[RTA]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
11.0.0.0/8 RIP 100 2 D 172.16.101.2 GigabitEthernet
0/0/0
172.16.102.0/24 RIP 100 1 D 172.16.101.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[RTB]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 1 D 172.16.101.1 GigabitEthernet
0/0/0
11.0.0.0/8 RIP 100 1 D 172.16.102.1 GigabitEthernet
0/0/1
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[RTC]dis IP routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 RIP 100 2 D 172.16.102.2 GigabitEthernet
0/0/0
172.16.101.0/24 RIP 100 1 D 172.16.102.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
接收好消息也很快
虽然水平分割和毒性逆转可以加速接收“坏消息”的速度,但是两者原理不同
水平分割是指从某一个邻居获得的路由信息不再向这个邻居发送回去,而毒性逆转则是将这样的路由信息METRIC置为16(不可达),再发送回去。
水平分割下,对g0/0/0端口抓包,Source为172.16.101.1
毒性逆转下,对g0/0/0端口抓包,Source为172.16.101.1
在毒性逆转下可以看到Meric=16(不可达)的消息,即坏消息
但是毒性逆转过多地浪费了链路的带宽,增大了路由表的大小,通常情况下不提倡使用。
以上实验是rip1和rip2的基本操作
链接:https://pan.baidu.com/s/1IfGscad619c9_hoKXkfhrw
提取码:0854
这是配置到最后一步的链接,但是还是提倡自己多练习,多抓包看现象,其实还可以看到很多细节,后续会补充,祝大家学习顺利!!
如有错误,请佬们不吝赐教!!💖💖💖