实验预配置R1(config)#int lo0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config)#int s3/0R1(config-if)#en
.
实验预配置
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config)#int s3/0
R1(config-if)#en fr
R1(config-if)#no fr inv
R1(config-if)#no sh
R1(config-if)#exi
R1(config)#int s3/0.1 m
R1(config-subif)#ip add 123.1.1.1 255.255.255.0
R1(config-subif)#no fr inv
R1(config-subif)#fr map ip 123.1.1.2 102 b
R1(config-subif)#fr map ip 123.1.1.3 103 b
R1(config-subif)#end
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#int s3/0
R2(config-if)#ip add 123.1.1.2 255.255.255.0
R2(config-if)#en fr
R2(config-if)#no fr inv
R2(config-if)#fr map ip 123.1.1.1 201 b
R2(config-if)#fr map ip 123.1.1.3 201 b
R2(config-if)#no sh
R3(config-if)#int s3/0
R3(config-if)#en fr
R3(config-if)#no fr inv
R3(config-if)#fr map ip 123.1.1.1 301 b
R3(config-if)#fr map ip 123.1.1.2 301 b
R3(config-if)#ip add 123.1.1.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#
第二步:在各路由器上运行ospf
R1(config)#router os 11
R1(config-router)#router-id 1.1.1.1
R1(config-router)#net 1.1.1.1 0.0.0.255 a 0
R1(config-router)#net 123.1.1.1 0.0.0.255 a 0
R1(config-router)#end
R2(config)#router os 11
R2(config-router)#router-id 2.2.2.2
R2(config-router)#net 2.2.2.2 0.0.0.255 a 0
R2(config-router)#net 123.1.1.2 0.0.0.255 a 0
R2(config-router)#end
R3(config)#router os 11
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 3.3.3.3 0.0.0.255 a 0
R3(config-router)#net 123.1.1.3 0.0.0.255 a 0
R3(config-router)#end
第三步:查看邻居并分析其原因
//查看到邻居表为空,我们自然地会想到接口的网络类型不同
经过查看后,接口的网络类型都为
第四步:为R1手动添加邻居并查看邻居关系
//也可以将接口网络类型改为,这个我们将在物理接口实验中演示
R1(config-router)#nei 123.1.1.2 pr 0
R1(config-router)#nei 123.1.1.3 pr 0
//这里的Priority 0不会改变R2和R3中接口的实际优先级,它只是相对自己而言的
我们在这里查看一个R2的接口的实验优先级
第五步:查看邻居并测试连通性
R1#sh ip o n
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 1 FULL/DR 00:01:44 123.1.1.3 Serial3/0.1
2.2.2.2 1 FULL/DROTHER 00:01:42 123.1.1.2 Serial3/0.1
//但在实际工程中我们不希望R2和R2选举DR或BDR,我们要改她们接口的实际优先级,我们在第六步中做出结果
R2#ping 3.3.3.3 sou 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/63/104 ms
第六步:修改R2和R3接口的优先级来影响她们使之不参于DR和BDR的选举
R2(config)#int s3/0
R2(config-if)#ip o p 0
R3(config)#int s3/0
R3(config-if)#ip o p 0
//这里我们修改了两个路由器接口的优先级
第七步:清除邻居关系并查看
R1#cle ip o p
Reset ALL OSPF processes? [no]: y
R1#sh ip o nei
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/DROTHER 00:01:41 123.1.1.3 Serial3/0.1
2.2.2.2 0 FULL/DROTHER 00:01:41 123.1.1.2 Serial3/0.1
R1#
第八步:小小的测试