interface Loopback0 ip address 192.168.45.1 255.255.255.0 ! interface Ethernet0 ip address 10.10.10.1 255.255.255.0 ! router ospf 1 network 10.10.10.0 0.0.0.255 area 0 !
Router2
interface Loopback0 ip address 172.16.10.1 255.255.255.0 ! interface Ethernet0 ip address 10.10.10.2 255.255.255.0 ! router ospf 1 network 10.10.10.0 0.0.0.255 area 0
验证 此部分提供您能使用确认您的配置适当地工作的信息。
输出解释器工具 支持 某些show命令 (注册的用户 ),答应您查看show命令输出分析 。
使用 show ip ospf neighbor命 令,您能验证router ospf的邻接关系状态的状况。在 Router1发出的 show ip ospf neighbor命令的输出,如下 所示。 Router1#show ip ospf neighbor Neighbor ID PRi State Dead Time Address Interface 172.16.10.1 1 FULL/BDR 00:00:38 10.10.10.2 Ethernet0
从特定输出,相邻状态是 充分的在Router1关于相邻ID是172.16.10.1的Router2。 Router2是一个备份指定路由(BDR)在此广播网络。了解更多关于什么 show ip ospf neighbor命令显示,提到 什么执行show ip ospf neighbor命令显示?
OSPF特定数据与接口(例如,链 路的有关网络类型)可以用show ip ospf interface命令 遵守。下列是在 Router1 以太网接口发出的 show ip ospf interface命令的 输出。 Router1#show ip ospf interface ethernet 0 Ethernet0 is up, line protocol is up Internet Address 10.10.10.1/24, Area 0 Process ID 1, Router ID 192.168.45.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 192.168.45.1, Interface address 10.10.10.1 Backup Designated router (ID) 172.16.10.1, Interface address 10.10.10.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:00 Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 2, maximum is 2 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 172.16.10.1 (Backup Designated Router) Suppress hello for 0 neighbor(s)
从特定输出,您知道网络类型 为以太网0个接口是广播。了解更多关于什么 show ip ospf interface 命令显示,提到 什么执行show ip ospf interface命令显示?
同样地,输出为 show命令在 Router2如下所示。 Router2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.45.1 1 FULL/DR 00:00:31 10.10.10.1 Ethernet0
从上述输出,您知道Router1是指定路由器(DR)在此广播网络。 Router2#show ip ospf interface ethernet 0 Ethernet0 is up, line protocol is up Internet Address 10.10.10.2/24, Area 0 Process ID 1, Router ID 172.16.10.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) 192.168.45.1, Interface address 10.10.10.1 Backup Designated router (ID) 172.16.10.1, Interface address 10.10.10.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:00 Index 1/1, 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 192.168.45.1 (Designated Router) Suppress hello for 0 neighbor(s)
当邻接形成在二个路由器之间 时,有多种状态。您能使用 debug ip ospf adjacency命令发现多种状态并且在 广播OSPF网络发生的DR和BDR选举。 以下输出是从Router1 透视图。粗体部分在输出是邻接进程经历的多种状态。 Router1#debug ip ospf adjacency OSPF adjacency events debugging is on 1d02h: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1FB0 opt 0x42 flag 0x7 len 32 mtu 1500 state INIT 1d02h: OSPF: 2 Way Communication to 172.16.10.1 on Ethernet0, state 2WAY 1d02h: OSPF: Neighbor change Event on interface Ethernet0 1d02h: OSPF: DR/BDR election on Ethernet0 1d02h: OSPF: Elect BDR 172.16.10.1 1d02h: OSPF: Elect DR 192.168.45.1 1d02h: DR: 192.168.45.1 (Id) BDR: 172.16.10.1 (Id) 1d02h: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x1FEC opt 0x42 flag 0x7 len 32 1d02h: OSPF: First DBD and we are not SLAVE 1d02h: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1FEC opt 0x42 flag 0x2 len 52 mtu 1500 state EXSTART 1d02h: OSPF: NBR Negotiation Done. We are the MASTER 1d02h: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x1FED opt 0x42 flag 0x3 len 52 1d02h: OSPF: Database request to 172.16.10.1 1d02h: OSPF: sent LS REQ packet to 10.10.10.2, length 12 1d02h: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1FED opt 0x42 flag 0x0 len 32 mtu 1500 state EXCHANGE 1d02h: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x1FEE opt 0x42 flag 0x1 len 32 1d02h: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1FEE opt 0x42 flag 0x0 len 32 mtu 1500 state EXCHANGE 1d02h: OSPF: Exchange Done with 172.16.10.1 on Ethernet0 1d02h: OSPF: Synchronized with 172.16.10.1 on Ethernet0, state FULL 1d02h: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.10.1 on Ethernet0 from LOADING to FULL, Loading Done 1d02h: OSPF: Build router LSA for area 0, router ID 192.168.45.1, seq 0x80000041 1d02h: OSPF: Neighbor change Event on interface Ethernet0 1d02h: OSPF: DR/BDR election on Ethernet0 1d02h: OSPF: Elect BDR 172.16.10.1 1d02h: OSPF: Elect DR 192.168.45.1 1d02h: DR: 192.168.45.1 (Id) BDR: 172.16.10.1 (Id) 1d02h: OSPF: Build network LSA for Ethernet0, router ID 192.168.45.1
验证hello计时器值, 用于 debug ip ospf events 命令。 该命令的以下输出如下所示。 Router1#debug ip ospf events OSPF events debugging is on Router1# 21:48:36: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 21:48:36: OSPF: End of hello processing