OSPF组网中时常会出现OSPF Router ID配置冲突的问题。Router ID是标识OSPF设备的重要依据,一旦冲突会导致OSPF LSA频繁的老化和产生,进而导致网络不稳定。此时通常伴随设备路由频繁刷新、路由计算出错、设备CPU利用率高(route进程高)的问题。
Router ID是标识OSPF设备的重要依据,协议要求OSPF Router ID AS内唯一。Router ID一旦冲突会导致OSPF的LSA频繁的老化和产生,进而导致网络不稳定。这种冲突分为两种情况:
1、区域内Router ID冲突,区域内Router ID冲突又分为直连Router ID冲突和非直连Router ID冲突。
1)直连Router ID冲突
直连Router ID冲突会导致邻居关系无法建立,很好判断;并且在OSPF error统计中也可以看到Router ID confusion计数增加。
例如SW1和SW2直连,Router ID都为1.1.1.1。在区域0内宣告互联网段,发现邻居无法建立,Router ID confusion计数持续增加。
<SW1>display ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbor Brief Information
<SW1>display ospf statistics error
OSPF Process 1 with Router ID 1.1.1.1
OSPF Packet Error Statistics
329 : Router ID confusion 0 : Bad packet
0 : Bad version 0 : Bad checksum
0 : Bad area ID 0 : Drop on unnumbered link
0 : Bad virtual link 0 : Bad authentication type
0 : Bad authentication key 0 : Packet too small
0 : Neighbor state low 0 : Transmit error
……
<SW1>display ospf statistics error
OSPF Process 1 with Router ID 1.1.1.1
OSPF Packet Error Statistics
332 : Router ID confusion 0 : Bad packet
0 : Bad version 0 : Bad checksum
0 : Bad area ID 0 : Drop on unnumbered link
0 : Bad virtual link 0 : Bad authentication type
0 : Bad authentication key 0 : Packet too small
0 : Neighbor state low 0 : Transmit error
……
2)非直连Router ID冲突
设备地址规划如图所示,其中SW1、SW2、SW3都属于区域0,其中因为配置失误,SW1和SW3的Router ID均为1.1.1.1。
在任意一台设备上每隔一秒输入display ospf lsdb,可以看到Router LSA 1.1.1.1的Age字段频繁变化, 同时Sequence字段增加的很快:
<SW1>dis ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 7 48 80000023 0
Router 2.2.2.2 2.2.2.2 160 60 80000008 0
Network 10.0.0.2 2.2.2.2 164 32 80000001 0
Network 20.0.0.1 2.2.2.2 160 32 80000001 0
<SW1>dis ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1 48 80000025 0
Router 2.2.2.2 2.2.2.2 163 60 80000008 0
Network 10.0.0.2 2.2.2.2 167 32 80000001 0
Network 20.0.0.1 2.2.2.2 163 32 80000001 0
<SW1>dis ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 2 48 80000027 0
Router 2.2.2.2 2.2.2.2 173 60 80000008 0
Network 10.0.0.2 2.2.2.2 177 32 80000001 0
Network 20.0.0.1 2.2.2.2 173 32 80000001 0
<SW2>display ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 2 48 8000004A 0
Router 2.2.2.2 2.2.2.2 333 60 80000008 0
Network 10.0.0.2 2.2.2.2 337 32 80000001 0
Network 20.0.0.1 2.2.2.2 333 32 80000001 0
<SW2>display ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1 48 8000004C 0
Router 2.2.2.2 2.2.2.2 336 60 80000008 0
Network 10.0.0.2 2.2.2.2 340 32 80000001 0
Network 20.0.0.1 2.2.2.2 336 32 80000001 0
<SW2>display ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1 48 8000004D 0
Router 2.2.2.2 2.2.2.2 342 60 80000008 0
Network 10.0.0.2 2.2.2.2 346 32 80000001 0
Network 20.0.0.1 2.2.2.2 342 32 80000001 0
造成Router LSA频繁震荡的过程如下(假设初始SW1 Router LSA Sequence数值更大):
SW3收到SW1发布的Router LSA,检查发现该LSA的发布路由器和自身的Router ID一致,都为1.1.1.1,认为该LSA是自身产生的。且该LSA序列号(80000022)更大,SW3认为该LSA比自身数据库安装的更新,SW3将会重新生成一个新的该Router LSA,序列号增加1(80000023),在区域内更新。
同理SW3收到SW1更新的Router LSA,认为该LSA是自身生成,且该LSA序列号80000023比自身80000022更大,序列号增加1(80000024),在区域内更新。
区域内Router ID冲突是否会导致路由学习错误与冲突Router ID是否为DR有关:当冲突Router ID都为非DR,故障现象主要表现为网络中Router LSA频繁震荡,可能引发CPU高。
[SW2]dis ospf peer
OSPF Process 1 with Router ID 2.2.2.2
Neighbor Brief Information
Area: 0.0.30.0
Router ID Address Pri Dead-Time State Interface
1.1.1.1 10.0.0.1 1 38 Full/BDR Vlan2
1.1.1.1 20.0.0.2 1 34 Full/BDR Vlan3
153 16.4% 15.3% 16.1% ospfd(v7设备显示)
当冲突Router ID为DR时,网络中除了Router LSA频繁震荡,还会导致设备路由学习异常。如下所示SW1为10.0.0.0/24网段DR。
[SW2-Vlan-interface2]dis ospf peer
OSPF Process 1 with Router ID 2.2.2.2
Neighbor Brief Information
area: 0.0.0.0
Router ID Address Pri Dead-Time State Interface
1.1.1.1 10.0.0.1 1 35 Full/DR Vlan2
1.1.1.1 20.0.0.2 1 40 Full/BDR Vlan3
在SW3上查看路由表发现没有10.0.0.1 网段路由。查看ospf lsdb,SW3上没有该LSA或该LSA age为3600,而且Sequence字段增加很快。SW3在老化该LSA(age为3600),SW1在重新产生该LSA,这一过程在SW2上更为明显。
<SW3>dis ip routing-table
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.2/32 O_INTRA 10 1 20.0.0.1 Vlan3
20.0.0.0/24 Direct 0 0 20.0.0.2 Vlan3
20.0.0.2/32 Direct 0 0 127.0.0.1 InLoop0
无10.0.0.0/24路由
<SW3>display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 6 48 80000651 0
Router 2.2.2.2 2.2.2.2 1197 60 80000012 0
Network 20.0.0.1 2.2.2.2 1601 32 80000005 0
没有10.0.0.1 Network LSA
<SW3>display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 3 48 80000653 0
Router 2.2.2.2 2.2.2.2 1202 60 80000012 0
Network 10.0.0.1 1.1.1.1 3600 32 80000279 0
Network 20.0.0.1 2.2.2.2 1606 32 80000005 0
10.0.0.1 Network LSA age为3600
<SW2>display ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 7 48 800006D7 0
Router 2.2.2.2 2.2.2.2 127 60 80000013 0
Network 10.0.0.1 1.1.1.1 3600 32 800002AA 0
Network 20.0.0.1 2.2.2.2 531 32 80000006 0
<SW2>display ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1 48 800006D8 0
Router 2.2.2.2 2.2.2.2 129 60 80000013 0
Network 10.0.0.1 1.1.1.1 7 32 800002AB 0
Network 20.0.0.1 2.2.2.2 533 32 80000006 0
SW2上Network LSA 10.0.0.1 Age不断在3600和其他较小值之间切换;AdvRouter一直为1.1.1.1;而且Sequence字段增加很快。
<SW1>display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 9 48 80000765 0
Router 2.2.2.2 2.2.2.2 825 60 80000013 0
Network 10.0.0.1 1.1.1.1 10 32 800002E1 0
Network 20.0.0.1 2.2.2.2 1229 32 80000006 0
<SW1>display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 2 48 80000766 0
Router 2.2.2.2 2.2.2.2 828 60 80000013 0
Network 10.0.0.1 1.1.1.1 1 32 800002E2 0
Network 20.0.0.1 2.2.2.2 1232 32 80000006 0
SW1上Network LSA 10.0.0.1 Age非自然增长,一直为较小值;AdvRouter一直为1.1.1.1;而且Sequence字段增加很快。
原因分析如下:
SW3收到SW1发送的Network LSA(只有DR发送),LSA 1LinkState ID 10.0.0.1,AdvRouter ID为1.1.1.1。SW3发现该LSA AdvRouter ID和自身Router ID一样,认为该LSA是自身产生的。但因为自身不再是该网段的DR,此时会将该LSA的age置为3600,在路由域泛洪。导致SW3上无法学习10.0.0.0网段路由。
而SW1收到该老化的LSA发现是自身产生的,且收到的LSA更新(同等情况下,主要指同sequence和checksum,age为3600的LSA被认为更新),SW1会重新生成该LSA,同时序列号增加1,在区域内泛洪。
总结:区域内Router ID冲突有可能影响路由学习,有可能不会,看冲突设备是否为网段DR,但一定会存在Router LSA震荡。因而还是很好判断。
2、区域间Router ID冲突
设备地址规划如图所示,其中SW1、SW2互联网段位于区域0,SW2、SW3互联网段位于区域1。其中因为配置失误,SW1和SW3的Router ID均为1.1.1.1。
在SW1配置环回口1,IP 8.8.8.8/32,在SW1上引入直连。
在SW3上查看路由表,发现无法学习SW1宣告的外部路由8.8.8.8/32:查看lsdb发现没有对应的5类LSA或者该LSA age为3600。
<SW3>display ip routing-table
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost NextHop 5类 Interface
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.2/32 O_INTER 10 1 20.0.0.1 Vlan3
10.0.0.0/24 O_INTER 10 2 20.0.0.1 Vlan3
20.0.0.0/24 Direct 0 0 20.0.0.2 Vlan3
20.0.0.2/32 Direct 0 0 127.0.0.1 InLoop0
无8.8.8.8/32外部路由
<SW3>dis ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 2750 60 80000018 0
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1361 48 80000007 0
Router 2.2.2.2 2.2.2.2 1362 36 80000004 0
Network 20.0.0.2 1.1.1.1 1352 32 80000002 0
Sum-Net 2.2.2.2 2.2.2.2 1363 28 80000001 0
Sum-Net 10.0.0.0 2.2.2.2 1363 28 80000001 1
Sum-Net 1.1.1.1 2.2.2.2 1363 28 80000001 1
Sum-Asbr 1.1.1.1 2.2.2.2 1213 28 80000001 1
<SW3>dis ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 2753 60 80000018 0
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1364 48 80000007 0
Router 2.2.2.2 2.2.2.2 1365 36 80000004 0
Network 20.0.0.2 1.1.1.1 1355 32 80000002 0
Sum-Net 2.2.2.2 2.2.2.2 1366 28 80000001 0
Sum-Net 10.0.0.0 2.2.2.2 1366 28 80000001 1
Sum-Net 1.1.1.1 2.2.2.2 1366 28 80000001 1
Sum-Asbr 1.1.1.1 2.2.2.2 1216 28 80000001 1
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 10.0.0.0 1.1.1.1 3600 36 8000005E 1
External 8.8.8.8 1.1.1.1 3600 36 8000005E 1
External 1.1.1.1 1.1.1.1 3600 36 8000005E 1
在SW2上查看ospf lsdb发现AS External LSA频繁刷新,age在较小值和3600之间切换,且都来自于1.1.1.1;sequence增长较快。
<SW2>display ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1645 48 8000086D 0
Router 2.2.2.2 2.2.2.2 334 48 8000001C 0
Network 10.0.0.1 1.1.1.1 352 32 8000035F 0
Sum-Net 20.0.0.0 2.2.2.2 94 28 80000002 1
Sum-Net 1.1.1.1 2.2.2.2 86 28 80000002 1
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 94 48 80000008 0
Router 2.2.2.2 2.2.2.2 90 36 80000005 0
Network 20.0.0.2 1.1.1.1 86 32 80000003 0
Sum-Net 2.2.2.2 2.2.2.2 94 28 80000002 0
Sum-Net 10.0.0.0 2.2.2.2 94 28 80000002 1
Sum-Net 1.1.1.1 2.2.2.2 94 28 80000002 1
Sum-Asbr 1.1.1.1 2.2.2.2 1644 28 80000001 1
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 10.0.0.0 1.1.1.1 3600 36 8000007D 1
External 8.8.8.8 1.1.1.1 3600 36 8000007D 1
External 1.1.1.1 1.1.1.1 3600 36 8000007D 1
<SW2>display ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1647 48 8000086D 0
Router 2.2.2.2 2.2.2.2 336 48 8000001C 0
Network 10.0.0.1 1.1.1.1 354 32 8000035F 0
Sum-Net 20.0.0.0 2.2.2.2 96 28 80000002 1
Sum-Net 1.1.1.1 2.2.2.2 88 28 80000002 1
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 96 48 80000008 0
Router 2.2.2.2 2.2.2.2 92 36 80000005 0
Network 20.0.0.2 1.1.1.1 88 32 80000003 0
Sum-Net 2.2.2.2 2.2.2.2 96 28 80000002 0
Sum-Net 10.0.0.0 2.2.2.2 96 28 80000002 1
Sum-Net 1.1.1.1 2.2.2.2 96 28 80000002 1
Sum-Asbr 1.1.1.1 2.2.2.2 1646 28 80000001 1
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 10.0.0.0 1.1.1.1 10 36 8000007E 1
External 8.8.8.8 1.1.1.1 10 36 8000007E 1
External 1.1.1.1 1.1.1.1 10 36 8000007E 1
在SW1上查看ospf lsdb发现AS External LSA频繁刷新,age非自然增长,一直为较小值;AdvRouter一直为1.1.1.1;而且Sequence字段增加较快。
<SW1>display ospf lsdb
OSPF Process 11 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1353 48 80000870 0
Router 2.2.2.2 2.2.2.2 45 48 8000001F 0
Network 10.0.0.1 1.1.1.1 61 32 80000362 0
Sum-Net 20.0.0.0 2.2.2.2 1506 28 80000004 1
Sum-Net 1.1.1.1 2.2.2.2 1498 28 80000004 1
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 10.0.0.0 1.1.1.1 12 36 800001EA 1
External 8.8.8.8 1.1.1.1 12 36 800001EA 1
External 1.1.1.1 1.1.1.1 12 36 800001EA 1
<SW1>display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 1.1.1.1 1.1.1.1 1356 48 80000870 0
Router 2.2.2.2 2.2.2.2 48 48 8000001F 0
Network 10.0.0.1 1.1.1.1 64 32 80000362 0
Sum-Net 20.0.0.0 2.2.2.2 1509 28 80000004 1
Sum-Net 1.1.1.1 2.2.2.2 1501 28 80000004 1
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 10.0.0.0 1.1.1.1 1 36 800001EB 1
External 8.8.8.8 1.1.1.1 1 36 800001EB 1
External 1.1.1.1 1.1.1.1 1 36 800001EB 1
AS External LSA震荡原因如下:
SW3收到SW1发送的AS External LSA,LSA LinkState ID 8.8.8.8,Advrouter ID为1.1.1.1。SW3发现该LSA AdvRouter ID和自身Router ID一样,认为该LSA是自身产生的。但因为自身没有路由去往该目的网段8.8.8.8的路由,此时会将该LSA的age置为3600,在路由域泛洪。导致SW3上无法学习该外部路由。
而SW1收到该老化的LSA发现是自身产生的且该LSA更新(同等情况下,主要指同sequence和checksum,age为3600的LSA被认为更新),SW1会重新生成该 LSA,同时序列号增加1。
如果网络中发现大量的AS External LSA频繁刷新,且都来自于某一台路由器,该网段不存在链路不稳问题,可以初步推测出存在不同区域的Router ID冲突。需要对OSPF域所有设备进行排查。
查出Router ID冲突的设备,修改配置,OSPF Router ID 必须AS内唯一。
修改完Router ID后重启设备才能生效。
关于自己产生的LSA定义:1)该LSA的发布路由器和自身的Router ID一致,或者2)该LSA为network-LSA,其Link State ID(Type 2 LSA Link State ID为DR的IP地址 )和自身某个接口IP一致。
A self-originated
LSA is detected when either 1) the LSA&#39;s Advertising Router is equal to the router&#39;s own Router ID or 2) the LSA is a network-LSA and its Link State ID is equal to one of the router&#39;s own IP interface addresses.
关于收到自身产生LSA的处理
OSPF设备收到自身产生的LSA,且比当前实例的更新,会重新生成该 LSA,同时序列号增加1。但也有特例:如2类LSA,其Link State ID和自身某个接口IP一致,但是AdvRouter不是自身,此时会将该LSA的age置为3600,在路由域泛洪。
Receiving self-originated LSAs
However, if the received self-originated LSA is newer than the last instance that the ,router actually originated, the router must take special action. The reception of such an LSA indicates that there are LSAs in the routing domain that were originated by the router before the last time it was restarted.
In most cases, the router must then advance the LSA&#39;s LS sequence number one past the received LS sequence number, and originate a new instance of the LSA.
It may be the case the router no longer wishes to originate the received LSA. Possible examples include: 1) the LSA is a summary-LSA or AS-external-LSA and the router no longer has a (advertisable) route to the destination, 2) the LSA is a network-LSA but the router is no longer Designated Router for the network or 3) the LSA is a network-LSA whose Link State ID is one of the router&#39;s own IP interface addresses but whose Advertising Router is not equal to the router&#39;s own Router ID (this latter case should be rare, and it indicates that the router&#39;s Router ID has changed since originating the LSA). In all these cases, instead of updating the LSA, the LSA should be flushed from the routing domain by incrementing the received LSA&#39;s LS age to MaxAge and reflooding
如何判断收到LSA是否更新
相同条件下:如同sequence 、checksums,age值为maxage会被认为是更新的LSA。
Determining which LSA is newer
An LSA is identified by its LS type, Link State ID and Advertising Router. For two instances of the same LSA, the LS sequence number, LS age, and LS checksum fields are used to determine which instance is more recent:
The LSA having the newer LS sequence number is more recent. If both instances have the same LS sequence number, then: If the two instances have different LS checksums, then the instance having the larger LS checksum (when considered as a 16-bit unsigned integer) is considered more recent.
Else, if only one of the instances has its LS age field set to MaxAge, the instance of age MaxAge is considered to be
more recent.
Else, if only one of the instances has its LS age field set
to MaxAge, the instance of age MaxAge is considered to be
more recent.
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作