OSPF 邻居关系不能正常建立的原因和解决方法

如题所述

OSPF 邻居关系
(1)接口上没有激活 ospf就是在 network 语句的时候没有匹配清楚,比如配置了错误的反掩码不对,在 show ip ospfinterface 的时候不会显示你希望激活的接口。使用 show ip ospfinterface 来验证。这时候的邻居表是空的R2#show ip ospf neighbor
(2)物理层或者是数据链路层协议 down.使用 show ip int brief 或者是 show int type nomber 会导致 ospfpacket 封装失败。
(3)建立邻居的接口被 passive 掉R2#show ip ospf interface Ethernet 0Ethernet0 is up, line protocol is upInternet Address 131.108.1.2/24, Area 0Process ID 1, Router ID 131.108.1.2, Network Type BROADCAST,Cost: 10Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 131.108.1.2, Interface address131.108.1.2No backup designated router on this networkTimer intervals configured, Hello 10, Dead 40, Wait 40,Retransmit 5No Hellos (Passive interface)Neighbor Count is 0, Adjacent neighbor count is 0Suppress hello for 0 neighbor(s)
(4)OSPF 的 hello 组播地址被 ACL BlockR1#interface Ethernet0ip address 131.108.1.1 255.255.255.0ip access-group 100 inaccess-list 100 permit tcp any anyaccess-list 100 permit udp any anyaccess-list 101 permit ip 131.108.1.0 0.0.0.255 host 224.0.0.5R2#interface Ethernet0ip address 131.108.1.2 255.255.255.0ip access-group 100 inaccess-list 100 permit tcp any any access-list 100 permit udp any anyaccess-list 101 permit ip131.108.1.0 0.0.0.255 host 224.0.0.5R2#debug ip packet 101 detailIP packet debugging is on (detailed) for access list 101IP: s=131.108.1.2 (Ethernet0), d=224.0.0.5, len 68, accessdenied, proto=89这时候的邻居关系是 INITR2#show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface131.108.2.1 1 INIT/- 00:00:33 131.108.1.1 Ethernet0R1#show access-list 101Extended IP access list 101permit ip 131.108.1.0 0.0.0.3 host 224.0.0.5 (8 matches)R1#debug ip packet 101 detailIP packet debugging is on (detailed) for access list 101R1#IP: s=131.108.1.1 (local), d=224.0.0.5 (Ethernet0), len 60,sending broad/multicast,proto=89IP: s=131.108.1.2 (Ethernet0), d=224.0.0.5, len 82, accessdenied, proto=89IP: s=131.108.1.1 (local), d=224.0.0.5 (Ethernet0), len 60, sending broad/multicast,proto=89IP: s=131.108.1.2 (Ethernet0), d=224.0.0.5, len 82,accessdenied, proto=89
(5)在 broadcast 链路上的子网掩码不匹配
(6)Hello/dead 间隔不匹配
(7)认证方式或者是认证密码不匹配使用 debug ip ospf adj 来查看,可以自己使用不同的情况来验证
(8)两台路由器处于不同的 AREAR1#debug ip ospf adjOSPF adjacency events debugging is onR1#OSPF: Rcv pkt from 131.108.1.2, Ethernet0, area 0.0.0.0 mismatch area 0.0.0.1 in the headerR2#show log%OSPF-4-ERRRCV: Received invalid packet: mismatch area ID,from backbone area must bevirtual-link but not found from 131.108.1.1, Ethernet0
(9)Stub/transit/NSSA 区域类型不匹配这个是常常不小心会被忘记的。R1#debug ip ospf adjOSPF adjacency events debugging is onR1#OSPF: Rcv hello from 131.108.0.1 area 1 from Ethernet0131.108.1.2OSPF: Hello from 131.108.1.2 with mismatched Stub/Transit areaoption bitR1#debug ip ospf adjOSPF adjacency events debugging is onR1#OSPF: Rcv hello from 131.108.0.1 area 1 from Ethernet0131.108.1.2OSPF: Hello from 131.108.1.2 with mismatched NSSA option bit
(10)使用 secondary IP 来建立 OSPF adjacencyR2#interface FastEthernet0/0ip address 131.108.1.2 255.255.255.0 secondaryip address 131.108.4.2 255.255.255.0R1#interface Ethernet0ip address 131.108.1.1 255.255.255.0R2#debug ip ospf adjOSPF adjacency events debugging is onR2#OSPF: Rcv pktfrom 131.108.1.1, FastEthernet0/0, area 0.0.0.1 :src not on the same network
(11)OSPF 网络类型不匹配(P-TO-P 和 P-TO-M 网络类型在 hello 时间间隔相同的情况下可以建立 full 关系,但是会缺少一条路由可以做一下相关使用验证)
(12)NBMA (Frame Relay, X.25, SMDS, and so on)网络类型上没有手动指定 neighbor ip 地址邻居一直都是 ATTEMPT 状态
(13)在 Router 两边的 frame-relay map/dialer map 语句声明中缺少了 broadcast 参数
(14)接口两边的 MTU 不匹配在 cisco ios 12.0.3 中加入了对 mtu 的检测,而低于这个版本的ios 会忽略 mtu 检测,需要查看router 的 ios version,debug ip ospf adj 的结果是发现有大量的 dbd 重传,出现 loading 的原因就是一边的 router 需要对 mtu 进行检测,而一边忽略。R2#debug ip ospf adjOSPF adjacency events debugging is onR2#OSPF: Retransmitting request to 131.108.2.1 on Serial0OSPF: Database request to 131.108.2.1OSPF: sent LS REQ packet to 131.108.1.1, length 12OSPF: Retransmitting request to 131.108.2.1 on Serial0解决方法是接口命令:mtu 4470 而不是:ip mtu 4470这时候的状态是 loading 。R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface131.108.2.1 1 LOADING/- 00:00:37 131.108.1.1 Serial0还有一种 mtu 不匹配的情况是邻居关系是 EXSTART,因为两边的 mtu都需要检测,而 mtu 大小又不匹配.R2#show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface131.108.2.1 1 EXSTART/- 00:00:33 131.108.1.1 Serial0R1#debug ip ospf adjOSPF: Retransmitting DBD to 131.108.1.2 on Serial0.1OSPF: Send DBD to 131.108.1.2 on Serial0.1 seq 0x1E55 opt 0x2flag 0x7 len 32OSPF: Rcv DBD from 131.108.1.2 on Serial0.1 seq 0x22AB opt 0x2flag 0x7 len 32 mtu 1500state EXSTARTOSPF: Nbr 131.108.1.2 has larger interface MTU
(15)在 broadcast 网络上需要选举 dr,而这时候两边的优先级又都是 0
温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜