RIP V1 /V2兼容实验
拓扑图:
R1运行RIP V1 ,R2 运行 RIP V2
R1的配置:
Router>EN
Router#conf t
Router(config)#host R1
R1(config)#int fa0/0
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo 0
R1(config-if)#ip add 172.16.2.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo 1
R1(config-if)#ip add 172.16.3.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exi
R1(config)#router rip
R1(config-router)#net 172.16.0.0
R1(config-router)#end
R1#sh ip
*Sep 9 14:29:39.243: %SYS-5-CONFIG_I: Configured from console by console
查看协议
R1#R1#show ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 14 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0 1 1 2
Loopback0 1 1 2
Loopback1 1 1 2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
172.16.0.0
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 120)
R2的配置:
Router>en
Router#conf t
Router(config)#host R2
R2(config)#int fa0/0
R2(config-if)#ip add 172.16.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo 0
R2(config-if)#ip add 172.16.4.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exi
R2(config)#router rip
R2(config-router)#ver 2
R2(config-router)#net 172.16.0.0
R2(config-router)#end
查看协议
R2#show ip protocols
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0 2 2
Loopback0 2 2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
172.16.0.0
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 120)
此时看到R1是发v1,收v1和v2,R2是只发v2且只收收v2,因此R2不能学到R1发的更新,R1可以收到R2发的更新
R1#sh ip route
172.16.0.0/24 is subnetted, 4 subnets
R 172.16.4.0 [120/1] via 172.16.1.2, 00:00:04, FastEthernet0/0
C 172.16.1.0 is directly connected, FastEthernet0/0
C 172.16.2.0 is directly connected, Loopback0
C 172.16.3.0 is directly connected, Loopback1
R2#sh ip route
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.4.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, FastEthernet0/0 只有直连的没有RIP更新
此时只需分别在R1 R2上做这样的配置即可完成v1和v2的兼容
R1(config)#int fa0/0
R1(config-if)#ip rip send version 1 2
R1(config-if)#ip rip receive version 1 2
R2(config)#int fa0/0
R2(config-if)#ip rip send version 1 2
R2(config-if)#ip rip receive version 1 2
在查看
R1#sh ip pro
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0 1 2 1 2
R2#sh ip protocols
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0 1 2 1 2
在R2上查看路由表发现R2已经学到R1发的路由更新了
R2#sh ip route
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.4.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, FastEthernet0/0
R 172.16.2.0 [120/1] via 172.16.1.1, 00:00:06, FastEthernet0/0
R 172.16.3.0 [120/1] via 172.16.1.1, 00:00:06, FastEthernet0/0
在R2上查看路由表发现R2已经学到R1发的路由更新了
R2#sh ip route
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.4.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, FastEthernet0/0
R 172.16.2.0 [120/1] via 172.16.1.1, 00:00:06, FastEthernet0/0
R 172.16.3.0 [120/1] via 172.16.1.1, 00:00:06, FastEthernet0/0