预配置
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#int s2/1
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config)#router os 11
R1(config-router)#net 1.1.1.1 0.0.0.255 a 0
R1(config-router)#net 12.1.1.1 0.0.0.255 a 0
R1(config-router)#end
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#int s2/1
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config)#router os 11
R2(config-router)#net 2.2.2.2 0.0.0.255 a 0
R2(config-router)#net 12.1.1.2 0.0.0.255 a 0
R2(config-router)#end
R2(config-router)#end
R1#sh ip o i s2/1
Serial2/1 is up, line protocol is up
Internet Address 12.1.1.1/24, Area 0
Process ID 11, Router ID 1.1.1.1, , Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:07
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
R1#sh ip ospf nei
//这里为点到点的类型,所以没有选择DR和BDR
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:33 12.1.1.2 Serial2/1
点到点不选择DR/BDR所以state下面是一条横线“-”
第二步:修改网络类型为广播
R2(config)#int s2/1
R2(config-if)#ip o n b
R1(config)#int s2/1
R1(config-if)#ip o n b
*Nov 21 22:10:49.683: %OSPF-5-ADJCHG: Process 11, Nbr 2.2.2.2 on Serial2/1 from LOADING to FULL, Loading Done
//看到了这样的日志。ospf正常
第三步:查看修改后的网络类型和邻居关系
R1#sh ip o i s2/1
R2#sh ip o i s2/1
R1#sh ip o n
Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/DR 00:00:39 12.1.1.2 Serial2/1 //广播的类型选出了DR和BDR
简单总结:
在ospf中可以将ospf的网络类型修改为
具体的我们在帧中继实验中演示