连载 :RIP offset-list
[font=Times New Roman]RIP[/font][font=宋体]的[/font][font=Times New Roman]offset-list[/font][b][font=宋体][size=16pt]实验拓扑图如下:[/size][/font][/b][size=12pt][img=537,270]http://www.one-tom.com/bbs/uploads/20070726_121944_123.JPG[/img]
[/size][size=12pt][font=Times New Roman] [/font][/size][font=宋体][size=12pt]图[/size][/font][size=12pt][font=Times New Roman]1[/font][/size][font=宋体][size=12pt]:[/size][/font][size=12pt][font=Times New Roman]offset-list[/font][/size][font=宋体][size=12pt]实验拓扑图[/size][/font][size=12pt][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[b][font=宋体][size=12pt]首先[/size][/font][/b][b][size=12pt][font=Times New Roman],[/font][/size][/b][b][font=宋体][size=12pt]按照上图配置一下,把[/size][/font][/b][b][size=12pt][font=Times New Roman]RIP[/font][/size][/b][b][font=宋体][size=12pt]配通。这是基本配置具体的可以参照等级一实验手册里实验[/size][/font][/b][b][size=12pt][font=Times New Roman]1.7[/font][/size][/b][b][font=宋体][size=12pt],这里就不做详细的说明了。[/size][/font][/b][b][size=12pt][/size][/b]
[b][size=12pt][font=Times New Roman] [/font][/size][/b]
[b][font=宋体][size=16pt]配置[/size][/font][/b][b][size=16pt][font=Times New Roman]offset-list[/font][/size][/b][b][font=宋体][size=16pt]:[/size][/font][/b][b][size=16pt][/size][/b]
[b][size=12pt][font=Times New Roman]r1(config)#router rip[/font][/size][/b]
[b][size=12pt][font=Times New Roman]r1(config-router)#offset-l 1 in 16 s1/0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]r1(config-router)#end[/font][/size][/b]
[b][size=12pt][font=Times New Roman]r1#sh ip ro[/font][/size][/b]
[b][size=12pt][font=Times New Roman]Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area [/font][/size][/b]
[b][size=12pt][font=Times New Roman]
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
* - candidate default, U - per-user static route, o - ODR[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
P - periodic downloaded static route[/font][/size][/b]
[b][size=12pt][font=Times New Roman] [/font][/size][/b]
[b][size=12pt][font=Times New Roman]Gateway of last resort is not set[/font][/size][/b]
[b][size=12pt][font=Times New Roman] [/font][/size][/b]
[font=Times New Roman][b][size=12pt]
[/size][/b][b][size=12pt]
1.0.0.0/24 is subnetted, 1 subnets [/size][/b][b][size=12pt]
//[/size][/b][/font][b][font=宋体][size=12pt]所有的[/size][/font][/b][b][size=12pt][font=Times New Roman]RIP[/font][/size][/b][b][font=宋体][size=12pt]的路由信息都没有了,因为已经把跳数改为[/size][/font][/b][b][size=12pt][font=Times New Roman]16[/font][/size][/b][b][font=宋体][size=12pt]跳,即不可达。[/size][/font][/b][b][size=12pt][/size][/b]
[b][size=12pt][font=Times New Roman]C
1.1.1.0 is directly connected, Loopback0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
12.0.0.0/24 is subnetted, 1 subnets[/font][/size][/b]
[b][size=12pt][font=Times New Roman]C
12.1.1.0 is directly connected, Serial1/0[/font][/size][/b]
[b][size=12pt][font=Times New Roman] [/font][/size][/b]
[b][size=12pt][font=Times New Roman]r1#sh ru[/font][/size][/b]
[b][size=12pt][font=Times New Roman]Building configuration...[/font][/size][/b]
[b][size=12pt][font=Times New Roman] [/font][/size][/b]
[b][size=12pt][font=Times New Roman]Current configuration : 614 bytes[/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]version 12.2[/font][/size][/b]
[b][size=12pt][font=Times New Roman]service timestamps debug datetime msec[/font][/size][/b]
[b][size=12pt][font=Times New Roman]service timestamps log datetime msec[/font][/size][/b]
[b][size=12pt][font=Times New Roman]no service password-encryption[/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]hostname r1[/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]clock timezone CST 8[/font][/size][/b]
[b][size=12pt][font=Times New Roman]ip subnet-zero[/font][/size][/b]
[b][size=12pt][font=Times New Roman]no ip domain lookup[/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]interface Loopback0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
ip address 1.1.1.1 255.255.255.0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]![/font][/size][/b]
[b][size=12pt][font=Times New Roman]interface Ethernet0/0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
no ip address[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
shutdown [/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]interface Serial1/0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
ip address 12.1.1.1 255.255.255.0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]interface Serial2/0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
no ip address[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
shutdown [/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]router rip[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
offset-list 1 in 16 Serial1/0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
network 1.0.0.0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
network 12.0.0.0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]ip classless[/font][/size][/b]
[b][size=12pt][font=Times New Roman]no ip http server[/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]line con 0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
exec-timeout 0 0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]
logging synchronous[/font][/size][/b]
[b][size=12pt][font=Times New Roman]line aux 0[/font][/size][/b]
[b][size=12pt][font=Times New Roman]line vty 0 4[/font][/size][/b]
[b][size=12pt][font=Times New Roman]!
[/font][/size][/b]
[b][size=12pt][font=Times New Roman]End[/font][/size][/b]
[b][size=12pt][font=Times New Roman] [/font][/size][/b] Offset-list命令就是手工把协议的Matric值修改了。
通过这个实验得知,在正常没有人工配置任何破环机制的情况下,RIP知道一个接口或网断16跳,即不可达。它会立即删除路由表里的对应项,然后把这个信息转发给自己的下一跳路由器。
删除16跳修改取消后在改为8跳。
用offset-list 1 in 8 Serial1/0在原来的基础之上加8跳,而不是改为8跳。
r1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
r1(config)#router rip
r1(config-router)#offset-l 1 in 8 s1/0
r1(config-router)#end
更新前:
r1#sh ip rou
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, 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
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
R 2.0.0.0/8 [120/1] via 12.1.1.2, 00:00:27, Serial1/0
R 3.0.0.0/8 [120/2] via 12.1.1.2, 00:00:27, Serial1/0
R 5.0.0.0/8 [120/1] via 12.1.1.2, 00:00:27, Serial1/0
R 23.0.0.0/8 [120/1] via 12.1.1.2, 00:00:27, Serial1/0
R 8.0.0.0/8 [120/1] via 12.1.1.2, 00:00:27, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
更新后:
r1#sh ip rou
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, 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
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
R 2.0.0.0/8 [120/9] via 12.1.1.2, 00:00:05, Serial1/0
R 3.0.0.0/8 [120/10] via 12.1.1.2, 00:00:05, Serial1/0
R 5.0.0.0/8 [120/9] via 12.1.1.2, 00:00:05, Serial1/0
R 23.0.0.0/8 [120/9] via 12.1.1.2, 00:00:05, Serial1/0
R 8.0.0.0/8 [120/9] via 12.1.1.2, 00:00:05, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
把更新前和更新后的路由表对比一下便不难得出结论。他自己的路由表全加上了8跳。
R2的路由表信息
r2#sh ip rou
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, 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 1.0.0.0/8 [120/1] via 12.1.1.1, 00:00:09, Serial2/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:24, Serial1/0
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback1
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/0
8.0.0.0/24 is subnetted, 1 subnets
C 8.8.8.0 is directly connected, Loopback2
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial2/0
R3的路由表信息
r3# sh ip rou
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, 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 1.0.0.0/8 [120/2] via 23.1.1.2, 00:00:00, Serial2/0
R 2.0.0.0/8 [120/1] via 23.1.1.2, 00:00:00, Serial2/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
R 5.0.0.0/8 [120/1] via 23.1.1.2, 00:00:00, Serial2/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial2/0
R 8.0.0.0/8 [120/1] via 23.1.1.2, 00:00:00, Serial2/0
R 12.0.0.0/8 [120/1] via 23.1.1.2, 00:00:00, Serial2/0
把R2和R3的路由表信息与R1的信息对比便知,如果命令里是in那么R2的R3的路由表里的跳数是不会变的。
要取消修改用r1(config-router)#no offset-l 1 in 8 s1/0
下面在看一下修改为out的情况
在R1上:
r1(config)#router rip
r1(config-router)#offset-l 1 out 8 s1/0
r1(config-router)#end
R1的路由表信息
r1#sh ip rou
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, 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
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
R 2.0.0.0/8 [120/1] via 12.1.1.2, 00:00:02, Serial1/0
R 3.0.0.0/8 [120/2] via 12.1.1.2, 00:00:02, Serial1/0
R 5.0.0.0/8 [120/1] via 12.1.1.2, 00:00:02, Serial1/0
R 23.0.0.0/8 [120/1] via 12.1.1.2, 00:00:02, Serial1/0
R 8.0.0.0/8 [120/1] via 12.1.1.2, 00:00:02, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/0
R1自身路由表的信息没有变化。
R2的路由表信息
r2#sh ip rou
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, 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 1.0.0.0/8 [120/9] via 12.1.1.1, 00:00:04, Serial2/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:23, Serial1/0
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback1
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/0
8.0.0.0/24 is subnetted, 1 subnets
C 8.8.8.0 is directly connected, Loopback2
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial2/0
R3的路由表信息
r3# sh ip rou
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, 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 1.0.0.0/8 [120/10] via 23.1.1.2, 00:00:18, Serial2/0
R 2.0.0.0/8 [120/1] via 23.1.1.2, 00:00:18, Serial2/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
R 5.0.0.0/8 [120/1] via 23.1.1.2, 00:00:18, Serial2/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial2/0
R 8.0.0.0/8 [120/1] via 23.1.1.2, 00:00:18, Serial2/0
R 12.0.0.0/8 [120/1] via 23.1.1.2, 00:00:18, Serial2/0
而其他的路由器针对R1的条目信息发生了变化。
通过上边的两个尝试得知,命令中in和out的区别:
区别是in或out都是把定义自己是第8跳。所不同的是in是在路由表信息进来的时候那个接口改的,自然其它路由器就不改了,当自身路由器的路由更新发出去的时候再减回去;而out是把发给其他路由器的条目修改了,所以其他路由器的条目也就随之更新了,而自己却不做任何修改,其他路由器更新发回来时它再减回去。也可以理解为in是在接口告诉进来的更新自己是第8跳,出去时再告诉更新自己是第0跳;而out则相反只告诉出去的更新自己是第8跳,进来的更新会告诉它自己是第0跳。
所以就出现下列现象,
In时R1认为,R2是9,R3是10;而R3认为R2是1,R1是2;
Out时R1认为,R2是1,R3是2;而R3认为R2是9,R1是10。
IP已记录
页:
[1]
