3.1 RIP版本1&2配置
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://sharkii.blog.51cto.com/325987/64019 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
下面分别看看R1、R2、R3的路由表
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
R 23.0.0.0/8 [120/1] via 12.1.1.2, 00:00:19, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/1
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/0
R 12.0.0.0/8 [120/1] via 23.1.1.2, 00:00:17, Serial1/0
查看RIP的运行情况
R1#show ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 25 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
Serial1/1 1 1 2 #RIPv1发送版本1,介绍版本1、2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
12.0.0.0
Routing Information Sources:
Gateway Distance Last Update
12.1.1.2 120 00:00:12
Distance: (default is 120) #……………rip默认管理距离120
R1#ping 23.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/80/136 ms
用Debug可以打开RIP的排错功能
R1#debug ip rip ?
database RIP database events
events RIP protocol events
trigger RIP trigger extension
R1#debug ip rip
RIP protocol debugging is on
R1#
*Feb 17 18:22:56.755: RIP: received v1 update from 12.1.1.2 on Serial1/1
*Feb 17 18:22:56.759: 23.0.0.0 in 1 hops
*Feb 17 18:23:06.247: RIP: sending v1 update to 255.255.255.255 via Serial1/1 (12.1.1.1)
*Feb 17 18:23:06.247: RIP: build update entries - suppressing null update
R1#un all
All possible debugging has been turned off
RIPv2
下面看看R1的情况,R2、R3类似省略
R1#show ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 2 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 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
Serial1/1 2 2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
12.0.0.0
Routing Information Sources:
Gateway Distance Last Update
12.1.1.2 120 00:00:13
Distance: (default is 120)
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
R 23.0.0.0/8 [120/1] via 12.1.1.2, 00:00:00, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/1
R1#debug ip rip
RIP protocol debugging is on
R1#
*Mar 3 23:22:26.671: RIP: received v2 update from 12.1.1.2 on Serial1/1
*Mar 3 23:22:26.675: 23.0.0.0/8 via 0.0.0.0 in 1 hops
R1#
*Mar 3 23:22:45.099: RIP: sending v2 update to 224.0.0.9 via Serial1/1 (12.1.1.1)
*Mar 3 23:22:45.099: RIP: build update entries - suppressing null update
RIP版本1、版本2、默认互操作
首先我们来看看R1、R2、R3的路由表情况
R1#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/1
R1没有学习到路由
R2#show ip route
R 1.0.0.0/8 [120/1] via 12.1.1.1, 00:00:13, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
R 3.0.0.0/8 [120/1] via 23.1.1.3, 00:00:13, Serial1/1
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
R2学习到了R1、R3的路由
R3#show ip route
R 1.0.0.0/8 [120/2] via 23.1.1.2, 00:00:20, Serial1/0
R 2.0.0.0/8 [120/1] via 23.1.1.2, 00:00:20, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/0
R 12.0.0.0/8 [120/1] via 23.1.1.2, 00:00:20, Serial1/0
R3学到了R1、R2的路由
出现上面路由表的结果原因在于:
1:R1#show ip protocols
Default version control: send version 2, receive version 2
R1运行的是版本2,只会发送版本2和接受版本2
2:R2#show ip protocols
Default version control: send version 1, receive any version
R2是默认的版本,它可以发送版本1和接受到任何版本
所以R2能够接受到来自R1和R3的路由
3: R3#show ip protocols
Default version control: send version 1, receive version 1
R3运行指定是版本1,只会发生和接受版本1
所以R3只能够收到版本1的路由。
4:细心留意会发现,R3只会接受版本1,为什么会学到R1的路由??这是因为R2学到了R1的路由后,发送给R3,所以R3也学到了R1的路由。
下面使用Debug看看各个路由器的信息:
R1#debug ip rip events
RIP event debugging is on
R1#
*Mar 4 00:11:52.275: RIP: ignored v1 packet from 12.1.1.2 (illegal version) #可以看到R1忽略了R2发过来版本1的数据
R1#
*Mar 4 00:12:02.851: RIP: sending v2 update to 224.0.0.9 via Serial1/1 (12.1.1.1)
*Mar 4 00:12:02.851: RIP: Update contains 1 routes
*Mar 4 00:12:02.855: RIP: Update queued
*Mar 4 00:12:02.855: RIP: Update sent via Serial1/1
*Mar 4 00:12:03.047: RIP: sending v2 update to 224.0.0.9 via Loopback0 (1.1.1.1)
*Mar 4 00:12:03.047: RIP: Update contains 1 routes
*Mar 4 00:12:03.051: RIP: Update queued
*Mar 4 00:12:03.051: RIP: Update sent via Loopback0
*Mar 4 00:12:03.055: RIP: ignored v2 packet from 1.1.1.1 (sourced from one of our addresses) #源来自同一个路由器也忽略
R2#debug ip rip events
RIP event debugging is on
R2#
*Mar 4 00:12:07.783: RIP: received v2 update from 12.1.1.1 on Serial1/0 #收到来自R1的更新
*Mar 4 00:12:07.787: RIP: Update contains 1 routes
*Mar 4 00:12:07.903: RIP: received v1 update from 23.1.1.3 on Serial1/1 #收到来自R3的更新
*Mar 4 00:12:07.907: RIP: Update contains 1 routes
R2#
*Mar 4 00:12:21.715: RIP: sending v1 update to 255.255.255.255 via Loopback0 (2.2.2.2)
*Mar 4 00:12:21.719: RIP: Update contains 4 routes
*Mar 4 00:12:21.719: RIP: Update queued
*Mar 4 00:12:21.719: RIP: Update sent via Loopback0
R2#
*Mar 4 00:12:24.571: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (12.1.1.2)
*Mar 4 00:12:24.575: RIP: Update contains 3 routes
*Mar 4 00:12:24.575: RIP: Update queued
*Mar 4 00:12:24.575: RIP: Update sent via Serial1/0
R2#
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||



