影响OSPF邻居建立的因素有:
<1>路由器ID --header
a.相邻路由器的router-id 不能相同,相同不能建立邻居
b.同一个区域不相邻设备的router-id可以相同,但是影响路由学习
c.不同区域不相邻的设备的router-id可以相同,不会影响路由学习
2 : Router id confusion
Feb 23 2019 16:00:58-08:00 AR1 %%01OSPF/4/CONFLICT_ROUTERID_INTF(l)[3]:OSPF Router id conflict is detected on interface. (ProcessId=256, RouterId=1.1.1.11, AreaId=0.0.0.0, InterfaceName=Serial4/0/1, IpAddr=1.1.1.12, PacketSrcIp=2.1.1.12)
<2>接口的区域ID ---header 报文
相邻的直连接口区域ID一定要相同
3 : Bad area id
<3>接口的地址掩码(如果是MA网络) ---hello报文
a.接口网络类型如果是Broadcast,MA网络,掩码长度必须一致
b.接口网络类型如果是P2P,P2P网络,掩码长度可以不同
c.接口网络类型如果是P2MP,P2MP网络,掩码长度可以不同(通过在接口下配置ospf p2mp-mask-ignore命令忽略检查掩码长度)
interface Serial4/0/1
link-protocol ppp
ip address 12.1.1.1 255.255.255.0
ospf network-type p2mp //修改网络类型为P2MP
ospf p2mp-mask-ignore //忽略检查掩码长度
15 : Netmask mismatch
Bad packet index: 1 Received time: 2019-02-23 16:26:43-08:00
Src 10.1.1.2 -> Dst 224.0.0.5, interface GigabitEthernet0/0/1, length 64
45 c0 40 00 06 cf 00 00 01 59 c6 ce 0a 01 01 02
e0 00 00 05 02 01 00 2c 16 01 01 01 00 00 00 01
d9 a8 00 00 00 00 00 00 00 00 00 00 ff ff ff f0
00 0a 02 01 00 00 00 28 0a 01 01 02 00 00 00 00
FileId 0, Line 5550.
Error Reason: NetMask ERROR !
<4>接口的认证 ----header报文
<5>接口的 hello interval and dead interval ----hello报文
两端设备的hello时间和dead 时间必须相同
dead时间是hello时间的4倍关系。
当修改hello时间dead 时间自动变化,为hello时间的4倍
如果只修改dead时间,hello时间是不会自动变化的。
interface Serial4/0/1
ospf timer hello 5 //修改hello时间为5s dead time 20s
interface Serial4/0/1
ospf timer dead 20 //修改dead time,hello时间不会变化
[AR1]dis ospf int s4/0/1
OSPF Process 1 with Router ID 11.1.1.1
Interfaces
Interface: 12.1.1.1 (Serial4/0/1) --> 12.1.1.2
Cost: 48 State: P-2-P Type: P2P MTU: 1500
Timers: Hello 5 , Dead 20 , Poll 120 , Retransmit 5 , Transmit Delay 1
34 : Hello timer mismatch
4 : Dead timer mismatch
<6>OPTION字段的E位和N位,即area type
OSPF的特殊区域有STUB和NSSA,分别对应如下的情况:
STUB区域:E 比特位= 0
NSSA区域:E 比特位= 0 N比特位=1
DD报文中影响OSPF邻居建立的因素有:
<7>接口MTU不同(华为设备默认不检查MTU,可手工开启检查)
帧中继环境中影响OSPF邻居建立的因素有:
<8>帧中继map映射缺少broadcast关键字
<9> silent-interface 静默端口
不发送且不接收hello报文,但是不会影响路由的通告
一般配置在连接终端设备的接口,千万不要配置在路由器相直连的接口
[AR3]dis ospf brief
Interface: 10.1.1.3 (GigabitEthernet0/0/1)
Cost: 1 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 10.1.1.3
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Silent interface, No hellos
<10> ACL 过滤
过滤OSPF 流量
acl number 3000
rule 10 deny ospf //过滤OSPF流量,放行其他所有
rule 20 permit ip
interface GigabitEthernet0/0/1
traffic-filter inbound acl 3000 //在in方向进行调用ACL
Total quantity of nonempty ACL number is 1
Advanced ACL 3000, 2 rules
Acl's step is 5
rule 10 deny ospf (4 matches)
rule 20 permit ip (19 matches)
<11> 网络类型是NBMA时候,必须手工指定邻居关系,两端设备都需要制定
AR2:
interface GigabitEthernet0/0/1
ospf network-type nbma
ospf 1 router-id 22.1.1.1
peer 10.1.1.3 //手工指定邻居
=======================================================
OSPF Process 1 with Router ID 11.1.1.1
OSPF error statistics
General packet errors:
0 : IP: received my own packet 0 : Bad packet
0 : Bad version 0 : Bad checksum
0 : Bad area id 0 : Drop on unnumbered interface
0 : Bad virtual link 0 : Bad authentication type
0 : Bad authentication key 0 : Packet too small
0 : Packet size > ip length 0 : Transmit error
0 : Interface down 0 : Unknown neighbor
0 : Bad net segment 0 : Extern option mismatch
Info: Current terminal debugging is on.
Info: Current terminal monitor is on.
Feb 23 2019 16:00:38.621.2-08:00 AR1 RM/6/RMDEBUG: Source Address: 12.1.1.1
Feb 23 2019 16:00:38.621.3-08:00 AR1 RM/6/RMDEBUG: Destination Address: 224.0.0.5
Feb 23 2019 16:00:38.621.4-08:00 AR1 RM/6/RMDEBUG: Ver# 2, Type: 1 (Hello)
Feb 23 2019 16:00:38.621.5-08:00 AR1 RM/6/RMDEBUG: Length: 44, Router: 11.1.1.1
Feb 23 2019 16:00:38.621.6-08:00 AR1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: f09c
Feb 23 2019 16:00:38.621.7-08:00 AR1 RM/6/RMDEBUG: AuType: 00
Feb 23 2019 16:00:38.621.8-08:00 AR1 RM/6/RMDEBUG: Key(ascii): * * * * * * * *
Feb 23 2019 16:00:38.621.9-08:00 AR1 RM/6/RMDEBUG: Net Mask: 255.255.255.0
Feb 23 2019 16:00:38.621.10-08:00 AR1 RM/6/RMDEBUG: Hello Int: 10, Option: _E_
Feb 23 2019 16:00:38.621.11-08:00 AR1 RM/6/RMDEBUG: Rtr Priority: 1, Dead Int: 40
Feb 23 2019 16:00:38.621.12-08:00 AR1 RM/6/RMDEBUG: DR: 0.0.0.0
Feb 23 2019 16:00:38.621.13-08:00 AR1 RM/6/RMDEBUG: BDR: 0.0.0.0