RIP基本配置实验拓扑:
实验环境:
路由器两台R1、R2
主机:Host1、Host2
实验步骤:
1.主机IP地址配置:
2.基本接口配置:
R1:
[H3C]sysname R1
[R1]int s1/0
[R1-Serial1/0]ip add 192.168.1.1 255.255.255.0 [R1-Serial1/0]undo shutdown
[R1-Serial1/0]quit
[R1]int g0/0
[R1-GigabitEthernet0/0]ip add 192.168.0.1 255.255.255.0
[R1-GigabitEthernet0/0]undo shutdown
[R1-GigabitEthernet0/0]
R2:
System View: return to User View with Ctrl+Z.
[H3C]sysname R2
[R2]int s1/0
[R2-Serial1/0]ip add 192.168.1.2 255.255.255.0
[R2-Serial1/0]undo shutdown
[R2-Serial1/0]quit
[R2]int g0/0
[R2-GigabitEthernet0/0]ip add 192.168.2.1 255.255.255.0
[R2-GigabitEthernet0/0]undo shutdown
[R2-GigabitEthernet0/0]
使用displayer ip routing-table查看路由表:
R1通过路由学到了直连的路由及网段-192.168.0.0/24、192.168.0.1/32、192.168.1.0/24、192.168.1.0/32、192.168.1.1/32、192.168.1.2/32,但是发现没有学到对端路由器192.168.2.0/24网段
R2通过路由学到了直连的路由及网段-192.168.1.0/24、192.168.1.0/32、192.168.2.0/32、192.168.2.0/24、192.168.2.1/32、,但是发现没有学到对端路由器192.168.0.0/24网段
在Hots1上使用ping命令测试网络连通性:
C:\Users\qikang>ping -S 192.168.0.2 192.168.0.1
正在Ping 192.168.0.1 从192.168.0.2 具有32 字节的数据:
来自192.168.0.1 的回复: 字节=32 时间<1ms TTL=255
来自192.168.0.1 的回复: 字节=32 时间<1ms TTL=255
来自192.168.0.1 的回复: 字节=32 时间<1ms TTL=255
来自192.168.0.1 的回复: 字节=32 时间<1ms TTL=255
192.168.0.1 的Ping 统计信息:
数据包: 已发送= 4,已接收= 4,丢失= 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短= 0ms,最长= 0ms,平均= 0ms
C:\Users\qikang>ping -S 192.168.0.2 192.168.1.1
正在Ping 192.168.1.1 从192.168.0.2 具有32 字节的数据:
来自192.168.1.1 的回复: 字节=32 时间<1ms TTL=255
来自192.168.1.1 的回复: 字节=32 时间<1ms TTL=255
来自192.168.1.1 的回复: 字节=32 时间<1ms TTL=255
来自192.168.1.1 的回复: 字节=32 时间<1ms TTL=255
192.168.1.1 的Ping 统计信息:
数据包: 已发送= 4,已接收= 4,丢失= 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短= 0ms,最长= 0ms,平均= 0ms
C:\Users\qikang>ping -S 192.168.0.2 192.168.1.2
正在Ping 192.168.1.2 从192.168.0.2 具有32 字节的数据:
请求超时。
请求超时。
请求超时。
请求超时。
192.168.1.2 的Ping 统计信息:
数据包: 已发送= 4,已接收= 0,丢失= 4 (100% 丢失),
C:\Users\qikang>ping -S 192.168.0.2 192.168.2.1
正在Ping 192.168.2.1 从192.168.0.2 具有32 字节的数据:
请求超时。
请求超时。
请求超时。
192.168.2.1 的Ping 统计信息:
数据包: 已发送= 3,已接收= 0,丢失= 3 (100% 丢失),
通过上述测试,发现host1无法到达R2,因为没有R1到R2的路由,当R1收到Host1的请求后,查看路由表,没有找到去往R2的路由,就选择丢弃此请求,并告知Host1此主机不可达。
3.在R1和R2上配置RIP协议
[R1]rip
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 192.168.0.0
[R1-rip-1]quit
[R2]rip
[R2-rip-1]
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 192.168.1.0
[R2-rip-1]
在R1上查看RIP协议:
通过上述信息可以看出,运行的RIP为rip V1,自动汇总功能是启用状态、路由更新周期是30S,超时时间是180S,所指定的网段为192.168.0.0 192.168.1.0
测试网络连通性:
C:\Users\qikang>ping -S 192.168.0.2 192.168.2.1
正在Ping 192.168.2.1 从192.168.0.2 具有32 字节的数据:
来自192.168.2.1 的回复: 字节=32 时间=1ms TTL=254
来自192.168.2.1 的回复: 字节=32 时间<1ms TTL=254
来自192.168.2.1 的回复: 字节=32 时间=1ms TTL=254
来自192.168.2.1 的回复: 字节=32 时间=1ms TTL=254
192.168.2.1 的Ping 统计信息:
数据包: 已发送= 4,已接收= 4,丢失= 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短= 0ms,最长= 1ms,平均= 0ms
C:\Users\qikang>ping -S 192.168.0.2 192.168.2.2
正在Ping 192.168.2.2 从192.168.0.2 具有32 字节的数据:
来自192.168.2.2 的回复: 字节=32 时间=1ms TTL=62
来自192.168.2.2 的回复: 字节=32 时间=1ms TTL=62
来自192.168.2.2 的回复: 字节=32 时间=1ms TTL=62
来自192.168.2.2 的回复: 字节=32 时间=1ms TTL=62
192.168.2.2 的Ping 统计信息:
数据包: 已发送= 4,已接收= 4,丢失= 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短= 1ms,最长= 1ms,平均= 1ms
此时发现,运行RIP后,网络可以正常互通了
使用debug调试,查看RIP信息
4.查看水平分割和毒性逆转
取消水平分割:
[R1]int s1/0
[R1-Serial1/0]undo rip split-horizon
[R1-Serial1/0]
查看debug调试日志:
发现路由器会将接收到的请求再次从接收的端口发出去
配置毒性逆转:
[R1-Serial1/0]rip poison-reverse
[R1-Serial1/0]
在R1的ints1/0口启用毒性逆转,在接口信息中包含了192.168.2.0,但是cost为16,相当于告诉R2,R1到192.168.2.0为不可达。
5.使用silent-interface设置接口只接收RIP协议报文,不发送协议报文
[R1-rip-1]silent-interface g0/0
[R1-rip-1]
此时发现RIP不再从g0/0发送RIP协议报文了。
RIP V2配置
R1:
System View: return to User View with Ctrl+Z.
[H3C]sysname R1
[R1]int s1/0
[R1-Serial1/0]ip add 192.168.1.1 255.255.255.0
[R1-Serial1/0]undo shut
[R1-Serial1/0]quit
[R1]int g0/0
[R1-GigabitEthernet0/0]ip add 192.168.0.1 255.255.255.0 [R1-GigabitEthernet0/0]undo shut
[R1-GigabitEthernet0/0]quit
[R1]rip
[R1-rip-1]ver
[R1-rip-1]version 2
[R1-rip-1]net 192.168.1.0
[R1-rip-1]net 192.168.0.0
[R1-rip-1]
System View: return to User View with Ctrl+Z.
[H3C]sysname R2
[R2]int s1/0
[R2-Serial1/0]ip add 192.168.1.2 255.255.255.0
[R2-Serial1/0]undo shut
[R2-Serial1/0]quit
[R2]int g0/0
[R2-GigabitEthernet0/0]ip add 192.168.2.1 255.255.255.0 [R2-GigabitEthernet0/0]undo shu
[R2-GigabitEthernet0/0]undo shutdown
[R2-GigabitEthernet0/0]quit
[R2]
[R2]rip
[R2-rip-1]ver
[R2-rip-1]version 2
[R2-rip-1]net 192.168.1.0
[R2-rip-1]net 192.168.2.0
[R2-rip-1]quit
[R2]
[R2]
查看路由表:
使用ping命令测试连通性:
C:\Users\qikang>ping -S 192.168.0.2 192.168.2.2