#干货满满#OSPF邻居关系拍错演练
  

Hacking 4451人觉得有帮助

{{ttag.title}}
1.NBMA环境下的OSPF邻居、路由、数据通信
ospf 1
peer 10.1.1.4 //指定邻居的接口地址,而不是RID
peer 10.1.1.5
area 0.0.0.0
interface Serial1/0/0
link-protocol fr
ip address 10.1.1.1 255.255.255.0
ospf enable 1 area 0.0.0.0

2.OSPF的邻居/邻接关系拍错(troubleshooing)
dis ospf error //多次使用该命令来判断问题
A.相邻设备的RID不能有邻居状态的
<R3>
Jun  5 2018 19:32:52-08:00 R3 %%01OSPF/4/CONFLICT_ROUTERID_INTF(l)[2]:OSPF Router id conflict is detected on interface. (ProcessId=256, RouterId=4.4.0.0, AreaId=34.0.0.0, InterfaceName=Serial2/0/0,  IpAddr=3.34.1.10, PacketSrcIp=4.34.1.10)  //在s2/0/0接口上检测到了RID冲突
<R3>dis ospf error

         OSPF Process 1 with Router ID 0.0.4.4
                 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
33    : Router id confusion //表明RID冲突
补充一点:同一区域的不相邻设备RID冲突,缺少路由
<SW1>dis cu conf ospf
#
ospf 1 router-id 0.0.4.4
area 0.0.0.34
#
interface Vlanif30
ip address 10.1.30.10 255.255.255.0
ospf enable 1 area 0.0.0.34
解决方案:整个AS内部RID保持唯一
[SW1]ospf router-id 10.10.10.10
Info: The configuration succeeded. You need to restart the OSPF process to validate the new router ID.
[SW1-ospf-1]
<SW1>reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
B、链路上区域ID不匹配
[R3]dis ospf error

         OSPF Process 1 with Router ID 33.1.1.1
                 OSPF error statistics

General packet errors:
0     : IP: received my own packet     0     : Bad packet
0     : Bad version                    0     : Bad checksum
4     : 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
1     : Interface down                 0     : Unknown neighbor
0     : Bad net segment                0     : Extern option mismatch
0     : Router id confusion
C、Hello和死亡时间都需要匹配
什么场景下会修改时间呢?在没有其他检测机制的前提下(BFD),协议本身为了加速检测邻居时间和收敛时间
interface Serial2/0/0
link-protocol ppp
ip address 10.1.34.4 255.255.255.0
ospf timer hello 1
ospf timer dead 2
ospf enable 1 area 0.0.0.34
[R3]dis ospf error

         OSPF Process 1 with Router ID 33.1.1.1
                 OSPF error statistics

General packet errors:
0     : IP: received my own packet     303   : Bad packet
0     : Bad version                    0     : Bad checksum
38    : 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
1     : Interface down                 0     : Unknown neighbor
0     : Bad net segment                0     : Extern option mismatch
0     : Router id confusion

HELLO packet errors:
0     : Netmask mismatch               303   : Hello timer mismatch //先检测Hello,死亡时间暂时不关心
0     : Dead timer mismatch            0     : Virtual neighbor unknown
0     : NBMA neighbor unknown          0     : Invalid Source Address
[R3]dis cu int s2/0/0
[V200R003C00]
#
interface Serial2/0/0
link-protocol ppp
ip address 10.1.34.3 255.255.255.0
ospf timer hello 1 //Hello相同,但死亡时间依旧mismatch
ospf enable 1 area 0.0.0.34
[R3]dis ospf error   

         OSPF Process 1 with Router ID 33.1.1.1
                 OSPF error statistics

General packet errors:
0     : IP: received my own packet     453   : Bad packet
0     : Bad version                    0     : Bad checksum
38    : 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
1     : Interface down                 0     : Unknown neighbor
0     : Bad net segment                0     : Extern option mismatch
0     : Router id confusion

HELLO packet errors:
0     : Netmask mismatch               350   : Hello timer mismatch
103   : Dead timer mismatch            0     : Virtual neighbor unknown
0     : NBMA neighbor unknown          0     : Invalid Source Address
[R3-Serial2/0/0]ospf timer dead 1
Error: The dead interval must be greater than the hello interval. //华为设备不能把死亡时间配置的小于等于hello时间!
D、多点接入网络的掩码一致(2类LSA)
[SW1-Vlanif30]ip address 10.1.30.10 28            
[SW1-Vlanif30]ping 10.1.30.3

  PING 10.1.30.3: 56  data bytes, press CTRL_C to break
    Reply from 10.1.30.3: bytes=56 Sequence=1 ttl=255 time=70 ms
    Reply from 10.1.30.3: bytes=56 Sequence=2 ttl=255 time=40 ms
dis ospf error
HELLO packet errors:
26    : Netmask mismatch               0     : Hello timer mismatch
0     : Dead timer mismatch            0     : Virtual neighbor unknown
0     : NBMA neighbor unknown          0     : Invalid Source Address
多点接入网络不一致:
[SW1-Vlanif30]dis ospf error

         OSPF Process 1 with Router ID 10.10.10.10
                 OSPF error statistics

General packet errors:
0     : IP: received my own packet     56    : 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
6     : Interface down                 0     : Unknown neighbor
24    : Bad net segment //错误的网段
点到点网络不受掩码的影响(Hello中掩码位会显示0.0.0.0即不检测):
[R3-Serial2/0/0]ip address 10.1.34.2 28
[R3-Serial2/0/0]dis ospf peer bri

         OSPF Process 1 with Router ID 33.1.1.1
                  Peer Statistic Information
----------------------------------------------------------------------------
Area Id          Interface                        Neighbor id      State   
0.0.0.34         GigabitEthernet0/0/1             10.10.10.10      Full        
0.0.0.34         Serial2/0/0                      0.0.4.4          Full
请问点到点网络建立OSPF邻居受子网影响么?在点到点的OSPF网络,掩码、子网并不要求,可以完成邻居关系
请问如果一个接口没有配置IP地址可以建立邻居么?
[R4-Serial2/0/0]ip address unnumbered interface LoopBack 0 //串口借用环回接口的地址作为源发送报文,通常会用到广域网IP地址匮乏的环境中
E、MTU一致性检测
默认情况下华为设备上不检测MTU一致性,除非2段都配置
ospf mtu-enable
[SW1-Vlanif30]dis th
#
interface Vlanif30
ip address 10.1.30.10 255.255.255.0
ospf mtu-enable
ospf enable 1 area 0.0.0.34
[R3]dis cu int g0/0/1
[V200R003C00]
#
interface GigabitEthernet0/0/1
mtu 1504
ip address 10.1.30.4 255.255.255.0
ospf mtu-enable
ospf enable 1 area 0.0.0.34
[R3]dis ospf peer brief

         OSPF Process 1 with Router ID 33.1.1.1
                  Peer Statistic Information
----------------------------------------------------------------------------
Area Id          Interface                        Neighbor id      State   
0.0.0.34         GigabitEthernet0/0/1             10.10.10.10      ExStart     
0.0.0.34         Serial2/0/0                      0.0.4.4          Full     
会卡到exstart/exchange状态,注意并不是2-way
dis ospf error
DD packet errors:
0     : Neighbor state low             0     : Unknown LSA type
2     : MTU option mismatch
F、标志位的一致性
E=1代表可以接受外部路由,E=0
NP,和NSSA特殊区域有关

3.OSPF的邻接/OSPF的网络类型
有邻居但是缺少路由条目:1)DR/BDR引发的 2)同一区域的不相邻设备RID冲突 3)网络类型问题
物理介质封装类型:
以太网
帧中继(ATM)
PPP/HDLC
用命令验证:
[R3-Serial2/0/0]link-protocol ?
  fr    Select FR as line protocol
  hdlc  Enable HDLC protocol
  lapb  LAPB(X.25 level 2 protocol)
  ppp   Point-to-Point protocol
  sdlc  SDLC(Synchronous Data Line Control) protocol
  x25   X.25 protocol
OSPF的网络类型(为了适应不同的介质的封装类型),5种
[R3-Serial2/0/0]ospf network-type ?
  broadcast  Specify OSPF broadcast network //广播
  nbma       Specify OSPF NBMA network //非广播多路访问
  p2mp       Specify OSPF point-to-multipoint network //点到多点
  p2p        Specify OSPF point-to-point network //点到点
==========================

打赏鼓励作者,期待更多好文!

打赏
3人已打赏

平凡的小网工 发表于 2024-2-18 19:51
  
多谢分享,期待楼主更多的分享。
发表新帖
热门标签
全部标签>
每日一问
技术盲盒
技术笔记
干货满满
技术咨询
功能体验
产品连连看
新版本体验
GIF动图学习
2023技术争霸赛专题
自助服务平台操作指引
标准化排查
信服课堂视频
运维工具
通用技术
秒懂零信任
技术晨报
用户认证
安装部署配置
每日一记
安全攻防
SDP百科
设备维护
深信服技术支持平台
社区帮助指南
答题自测
玩转零信任
畅聊IT
专家问答
技术圆桌
在线直播
MVP
网络基础知识
升级
上网策略
测试报告
日志审计
问题分析处理
流量管理
云计算知识
原创分享
解决方案
sangfor周刊
VPN 对接
项目案例
SANGFOR资讯
专家分享
技术顾问
信服故事
功能咨询
终端接入
授权
资源访问
地址转换
虚拟机
存储
迁移
加速技术
排障笔记本
产品预警公告
信服圈儿
S豆商城资讯
技术争霸赛
「智能机器人」
追光者计划
答题榜单公布
纪元平台
卧龙计划
华北区拉练
天逸直播
以战代练
山东区技术晨报
文档捉虫活动
齐鲁TV
华北区交付直播
每周精选

本版版主

396
135
63

发帖

粉丝

关注

本版达人

新手61940...

本周建议达人

BGP网络

本周分享达人

BGP网络

本周提问达人