3. OSPF邻居关系排错以及网络类型
1. OSPF的邻居/邻接关系排错(troubleshooing)
1. hello间隔和dead 间隔不同
2. 接口下OSPF网络类型不匹配。
3. 区域号码不一致;
4. 特殊区域(如stub,nssa等)区域类型不匹配;
5. 认证类型或密码不一致;
6. 路由器 router-id 相同;
7. 链路上的 MTU 不匹配;(前提:开启MTU)
8. 在broadcast链路上的子网掩码不匹配
9. 在MA 网络中,没有DR
10. 接口设置为silent-interface
dis ospf error //多次使用该命令来判断问题
1.1 相邻设备的RID相同
-
相邻设备的RID不能相同,否则不会有邻居状态
-
同一区域,不相邻设备的RID冲突,缺少路由
-
解决方案:保证整个AS内部的RID唯一
-
LSA 1,2,3,4,7类 6类 mospf 8类 ipv6 ospfv3 9,10,11MPLS TE
<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>reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
1.2 链路上区域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
1.3 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
#
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时间!
int s1/0/0
ospf timer dead
hello
ldp-sync //ldp和IGP同步的时间
poll // 在NBMA网络中发送hello的时间
setransmit //重传间隔
1.4 多点接入网络的掩码一致(2类LSA)
- MA网络(默认的以太网,FR 和 ATM)要求掩码一致
- 点到点网络并不要求掩码一致,也不受子网影响(Hello报文掩码为0.0.0.0,即不检测)
[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
[SW1-Vlanif30]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地址匮乏的环境中
//点对点子网掩码最好配成30位
1.5 MTU一致性检测
默认情况下华为设备上不检测MTU一致性,除非两端都开启
[SW1-Vlanif30]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
#
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
1.6 标志位的一致性
// 特殊区域(如stub,nssa等)区域类型不匹配
E=1代表可以接受外部路由,E=0
NP 和 NSSA特殊区域有关
DN 在MPLS种讲
1.7 网络类型不一致
2. OSPF的邻接/OSPF的网络类型
2.1有邻居但是缺少路由条目:
-
DR/BDR引发的
-
同一区域的不相邻设备RID冲突
-
网络类型问题
2.2 物理介质封装类型:
-
以太网
-
帧中继(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
2.3 OSPF的网络类型
- 为了适应不同介质的封装类型
[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 //点到点
2.3.1 目的:
用技术手段解决物理介质问题
2.3.2 三个方面考虑问题:
-
能否自动通过组播发现邻居
-
时间(hello和dead)
-
DR和BDR
2.3.3 四种网络类型:
-
P2P网络(PPP,HDLC,帧中继子接口) //点到点也是通过组播发现邻居
时间:hello间隔:10s 40s deadtime
不需要DR/BDR
-
广播型网络(以太网) // 组播发现邻居
时间:10s hello间隔 40s deadtime
需要DR/BDR
-
NBMA网络(帧中继的物理接口,ATM,DSVPN中) // 单播发现邻居
时间:30s hello间隔 120s deadtime
需要DR/BDR
-
P2MP网络(多个点到点网络的集合) // 组播自动发现邻居
时间:30s hello间隔 120s deadtime
不需要DR/BDR
2.3.4 MA网络中的问题
-
点到点同步LSA成本小
-
多点接入网络同步LSA,成本大---DR/BDR
-
n x (n-1)/2 个邻接关系,管理复杂
-
重复的LSA泛红,造成资源浪费
2.3.5 网络类型的应用
根据网络设计调整网络类型
网络类型的应用:根据网络设计调整网络类型
//需求1:请在除了区域15和区域0之外的网络,配置特定的命令使得网络可以尽快的收敛。
方法:把区域34、区域35、区域56的ospf的建立邻居的接口修改为p2p
ospf network-type p2p
//需求2:使得各个区域的数据可以通信
作业:
请验证OSPF的4种错误的邻居关系(1.1,1.3,1.4,1.5),用dis ospf error去摸排错误
原文地址:https://www.cnblogs.com/j-chao/p/13285614.html
- 段落首字下沉
- 【编程基础】C语言指针、引用和取值
- Docker+Jenkins持续集成环境(2)使用docker+jenkins构建nodejs前端项目
- JavaScript中的this详解
- 使用SpringBoot开发REST服务
- CSS3 -webkit-filter 滤镜
- Docker+Jenkins持续集成环境(3)集成PMD、FindBugs、Checkstyle静态代码检查工具并邮件发送检查结果
- Javascript中的Label语句
- 从编辑距离、BK树到文本纠错
- iframe基本知识及iframe版本Tab切换
- switch语句以及与if的比较
- kgtemp文件转mp3工具
- AJAX原理与步骤
- 【编程基础】C语言FILE结构体以及缓冲区深入探讨
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 高维数据 | R语言数据可视化之热力图
- 高维数据 | R语言数据可视化之日历图
- 打卡群刷题总结0804——二叉树的中序遍历
- 基础知识 | R语言数据管理之SQL语句
- 文本挖掘| 某作者文章的词频统计排序
- spring注解配置之@Configuration
- TS核心知识点总结及项目实战案例分析
- 用Python开发 写个消消乐小游戏
- 原理+代码|Python实战多元线性回归模型
- nestjs+vue+ts打造一个酷炫的星空聊天室(含完整数据库设计)
- JUnit 5基础指南
- 记录一则expdp任务异常处理案例
- Jenkins打造多分支流水线指南
- Spring中的设计模式
- java单元/集成测试中使用Testcontainers