OSPF 形成邻居 关系的条件
TCP/IP路由技術卷一上寫道:
??????? When a router receives a Hello from a neighbor, it will verify that the Area ID, Authentication, Network Mask, HelloInterval, RouterDeadInterval, and Options values match the values configured on the receiving interface. If they do not, the packet is dropped and no adjacency is established.
那么子網掩碼長度不一樣到底能不能形成鄰居關系呢?下面做個實驗
R1(F0/0)---------------------(F0/0)R2
R1的F0/0 IP地址為172.16.0.1/16
R2的F0/0 IP地址為172.16.0.2/30
配好OSPF后
debug ip ospf events顯示:
*Mar 1 00:02:05.827: OSPF: Rcv hello from 172.16.0.2 area 0 from FastEthernet0/0 172.16.0.2
*Mar 1 00:02:05.827: OSPF: Mismatched hello parameters from 172.16.0.2
*Mar 1 00:02:05.831: OSPF: Dead R 40 C 40, Hello R 10 C 10 Mask R 255.255.255.252 C 255.255.0.0
顯示hello參數不一致(子網掩碼不一樣),無法形成鄰居,sh ip ospf nei顯示為空。
現在再換成串口互聯:
R1(S1/0)---------------------(S1/0)R2
IP地址同第一個實驗。
配好OSPF后,debug ip ospf events:
*Mar 1 00:07:52.227: OSPF: Interface Serial1/0 going Up
*Mar 1 00:07:52.227: OSPF: Send hello to 224.0.0.5 area 0 on Serial1/0 from 172.16.0.1
R1#
*Mar 1 00:07:55.875: OSPF: Rcv hello from 172.16.0.2 area 0 from Serial1/0 172.16.0.2
*Mar 1 00:07:55.879: OSPF: 2 Way Communication to 172.16.0.2 on Serial1/0, state 2WAY
*Mar 1 00:07:55.879: OSPF: Send DBD to 172.16.0.2 on Serial1/0 seq 0x25EE opt 0x52 flag 0x7 len 32
*Mar 1 00:07:55.879: OSPF: End of hello processing
*Mar 1 00:07:55.951: OSPF: Rcv DBD from 172.16.0.2 on Serial1/0 seq 0x26E0 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Mar 1 00:07:55.951: OSPF: NBR Negotiation Done. We are the SLAVE
*Mar 1 00:07:55.955: OSPF: Send DBD to 172.16.0.2 on Serial1/0 seq 0x26E0 opt 0x52 flag 0x2 len 52
*Mar 1 00:07:55.995: OSPF: Rcv DBD from 172.16.0.2 on Serial1/0 seq 0x26E1 opt 0x52 flag 0x3 len 72 mtu 1500 state EXCHANGE
*Mar 1 00:07:55.995: OSPF: Send DBD to 172.16.0.2 on Serial1/0 seq 0x26E1 opt 0x52 flag 0x0 len 32
*Mar 1 00:07:55.995: OSPF: Database request to 172.16.0.2
*Mar 1 00:07:55.995: OSPF: sent LS REQ packet to 172.16.0.2, length 24
*Mar 1 00
R1#:07:55.999: OSPF: Rcv DBD from 172.16.0.2 on Serial1/0 seq 0x26E2 opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE
*Mar 1 00:07:55.999: OSPF: Exchange Done with 172.16.0.2 on Serial1/0
*Mar 1 00:07:55.999: OSPF: Send DBD to 172.16.0.2 on Serial1/0 seq 0x26E2 opt 0x52 flag 0x0 len 32
*Mar 1 00:07:56.003: OSPF: Synchronized with 172.16.0.2 on Serial1/0, state FULL
*Mar 1 00:07:56.003: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.2 on Serial1/0 from LOADING to FULL, Loading Done
顯示成功建立了鄰居關系,sh ip ospf nei也能看到對方。
難道卷一錯了?
實際上,OSPF建立鄰居關系時是否 檢查子網掩碼是分情況的,一下引用RFC2328原文:
However, there is one exception to the above rule: on point-to-point networks and on virtual links, the Network Mask in the received Hello Packet should be ignored.
轉載于:https://blog.51cto.com/cisco130/964934
總結
以上是生活随笔為你收集整理的OSPF 形成邻居 关系的条件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 写在《30天自制操作系统》上市之前
- 下一篇: windows server 2008