// 清除OSPF进程:只有清除OSPF进程后,自定义的RID才会生效
R1#clear ip ospf x process
Reset OSPF process x?[no]: yes
// 定义OSPF的优先级:之后清除OSPF进程,用于重新选举DR/BDRR1(config-if)#ip ospf priority x
// 修改发送Hello包时间和失效时间间隔R1(config-if)#ip ospf hello-interval {time}R1(config-if)#ip ospf dead-interval {time}
读懂show命令
1.show ip protocols:
Routing Protocol is "ospf 2"//主要看到这里的OSPF进程号
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 12.12.12.2//这里查看RID
It is an area border router
Number of areas in this router is 2.2 normal 0 stub 0 nssa
Maximum path:4
Routing for Networks://这里看到发hello包的接口,以及区域12.12.12.20.0.0.0 area 023.23.23.20.0.0.0 area 1
Reference bandwidth unit is 100 mbps
Routing Information Sources:
Gateway Distance Last Update
34.34.34.311000:01:0046.46.46.611000:01:0046.46.46.411000:01:00
Distance:(default is 110)2.show ip ospf neighbor:
Neighbor ID Pri State Dead Time Address Interface
46.46.46.40 FULL/-46.46.46.4 OSPF_VL1
12.12.12.11 FULL/DR 00:00:3212.12.12.1 FastEthernet0/046.46.46.61 FULL/BDR 00:00:3626.26.26.6 FastEthernet2/034.34.34.31 FULL/BDR 00:00:3623.23.23.3 FastEthernet1/034.34.34.31 FULL/BDR 00:00:3623.23.23.3 FastEthernet1/0// State 可以看到建立邻居的状态Full和角色DR/BDR3.show ip ospf database router:
OSPF Router with ID (12.12.12.2)(Process ID 2)//这里可以看到RID和进程ID
Router Link States (Area 0)//这里看到区域
LS age:368
Options:(No TOS-capability, DC)
LS Type: Router Links //这里看到LSA的类型
Link State ID:12.12.12.1
Advertising Router:12.12.12.1
LS Seq Number:80000004
Checksum:0xEDAD
Length:36
Number of Links:1
Link connected to: a Transit Network
(Link ID) Designated Router address:12.12.12.1(Link Data) Router Interface address:12.12.12.1
Number of TOS metrics:0
TOS 0 Metrics:1//这里可以看到Metric值