目录
- 实验条件
- 网络拓朴
- 逻辑拓扑
- 实现目标
- 环境配置
- 开始Troubleshooting
- 问题1. R22的e0/0接口配置了网络类型
- 问题2. R22和R21之间的IP地址子网掩码长度不一致
- 问题3. R21的e0/0口配置了被动接口
- 问题4. R3配置了不一致的hello-time
- 问题5. R21配置了max-metric导致路由无效
- 问题6. R3汇总了134.56.78.0的网段路由。
- 问题7. R1的E1/0被手动配置了cost值
实验条件
网络拓朴
逻辑拓扑
实现目标
环境配置
在我的资源里可以下载(就在这篇文章的开头也可以下载)
开始Troubleshooting
整体排错的思路如下:
- 检查所有的直连口是否双UP
- 检查所有的IGP启动情况,邻居状态
- 根据输出,调整路由参数
检查所有的直连接口都正常启动。
R22发生报错
%OSPF-4-NET_TYPE_MISMATCH: Received Hello from 123.5.5.5 on Ethernet0/0 indicating a potential
network type mismatch
和R5的邻居关系报错了,提示ospf网络类型不一致
问题1. R22的e0/0接口配置了网络类型
R5#show run interface e1/0
Building configuration...
Current configuration : 83 bytes
!
interface Ethernet1/0
ip address 134.56.78.41 255.255.255.252
duplex auto
end
R22#show run interface e0/0
Building configuration...
Current configuration : 115 bytes
!
interface Ethernet0/0
ip address 134.56.78.42 255.255.255.252
ip ospf network point-to-point
duplex auto
end
修改R22的e0/0口, no掉ptop的网络类型
R5#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
123.1.1.1 1 FULL/BDR 00:00:36 123.45.67.17 Ethernet0/0
134.22.22.22 1 FULL/BDR 00:00:33 134.56.78.42 Ethernet1/0
R22(config-if)#do show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
123.5.5.5 1 FULL/DR 00:00:36 134.56.78.41 Ethernet0/0
R22与R21之间没有建立OSPF邻居关系。查看R22和R21的OSPF配置
R21#show run | s router ospf
router ospf 12345
router-id 134.21.21.21
max-metric router-lsa
passive-interface default
no passive-interface Ethernet2/0
network 134.21.21.21 0.0.0.0 area 1
network 134.56.78.38 0.0.0.0 area 1
network 134.56.78.48 0.0.0.7 area 1
neighbor 123.3.3.3
R22(config-if)#do show run | s router ospf
router ospf 12345
router-id 134.22.22.22
passive-interface default
no passive-interface Ethernet0/0
no passive-interface Ethernet2/0
network 134.22.22.22 0.0.0.0 area 1
network 134.56.78.42 0.0.0.0 area 1
network 134.56.78.48 0.0.0.7 area 1
邻居配置并无异常。 R22和R21之间并没有配置成被动接口,理论上是可以建立邻居的。查看两台路由器对应的接口配置
R21#show run interface e2/0
Building configuration...
Current configuration : 83 bytes
!
interface Ethernet2/0
ip address 134.56.78.50 255.255.255.248
duplex auto
end
R22#show run interface e2/0
Building configuration...
Current configuration : 83 bytes
!
interface Ethernet2/0
ip address 134.56.78.49 255.255.255.252
duplex auto
end
问题2. R22和R21之间的IP地址子网掩码长度不一致
根据OSPF的配置文件判断,子网掩码应该是29位,也就是255.255.255.248,修改R22的子网掩码
R22#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R22(config)#int e2/0
R22(config-if)#ip address 134.56.78.49 255.255.255.248
R22(config-if)#do show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
134.21.21.21 1 FULL/DR 00:00:38 134.56.78.50 Ethernet2/0
123.5.5.5 1 FULL/DR 00:00:36 134.56.78.41 Ethernet0/0
R21和R3之间也需要有邻居关系、但是从上面的配置来看。R21的e0/0配置成了被动接口,
问题3. R21的e0/0口配置了被动接口
修改
R21#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R21(config)#int e0/0
R21(config-if)#exit
R21(config)#router ospf 12345
R21(config-router)#no passive-interface e0/0
R21(config-router)#do show run | s router ospf
router ospf 12345
router-id 134.21.21.21
max-metric router-lsa
passive-interface default
no passive-interface Ethernet0/0
no passive-interface Ethernet2/0
network 134.21.21.21 0.0.0.0 area 1
network 134.56.78.38 0.0.0.0 area 1
network 134.56.78.48 0.0.0.7 area 1
neighbor 123.3.3.3
R21(config-router)#do show run interface e0/0
Building configuration...
Current configuration : 83 bytes
!
interface Ethernet0/0
ip address 134.56.78.38 255.255.255.252
duplex auto
end
不过发现和R3依然没有建立起邻居关系,查看R3的OSPF配置项,及相关接口配置
R3#show run | s router ospf
router ospf 12345
router-id 123.3.3.3
area 1 range 134.56.78.0 255.255.255.0
network 123.3.3.3 0.0.0.0 area 0
network 123.45.67.6 0.0.0.0 area 0
network 134.56.78.37 0.0.0.0 area 1
R3#show run interface e2/0
Building configuration...
Current configuration : 110 bytes
!
interface Ethernet2/0
ip address 134.56.78.37 255.255.255.252
ip ospf hello-interval 11
duplex auto
end
问题4. R3配置了不一致的hello-time
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#int e2/0
R3(config-if)#no ip ospf hello-interval 11
R3(config-if)#do show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
123.1.1.1 1 FULL/BDR 00:00:37 123.45.67.5 Ethernet0/0
134.21.21.21 1 FULL/DR 00:00:34 134.56.78.38 Ethernet2/0
所有的邻居关系都起来了,接下来实现OUTPUT的要求
R1#show ip ospf database summary 134.56.78.48
OSPF Router with ID (123.1.1.1) (Process ID 12345)
Summary Net Link States (Area 0)
LS age: 516
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 134.56.78.48 (summary Network Number)
Advertising Router: 123.5.5.5
LS Seq Number: 80000002
Checksum: 0xAEB8
Length: 28
Network Mask: /29
MTID: 0 Metric: 20
只有123.5.5.5通告过来的路由,并没有123.3.3.3通告过来的路由。
通过拓扑图可以看出134.56.78.48/29是R21和R22之间的网段,R22可以通过R5再到R1与R21通过R3再到R1之间的Cost值应该是一样的、R1可以接收R3和R5两条通告。
但是通过查询R3的OSPF表:
R3#show ip ospf database summary 134.56.78.48
OSPF Router with ID (123.3.3.3) (Process ID 12345)
Summary Net Link States (Area 0)
LS age: 884
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 134.56.78.48 (summary Network Number)
Advertising Router: 123.5.5.5
LS Seq Number: 80000002
Checksum: 0xAEB8
Length: 28
Network Mask: /29
MTID: 0 Metric: 20
并没有得到R21通告过来的关于134.56.78.48的路由,到R21上再次查询OSPF配置:
R21#show run | s router ospf
router ospf 12345
router-id 134.21.21.21
max-metric router-lsa
passive-interface default
no passive-interface Ethernet0/0
no passive-interface Ethernet2/0
network 134.21.21.21 0.0.0.0 area 1
network 134.56.78.38 0.0.0.0 area 1
network 134.56.78.48 0.0.0.7 area 1
neighbor 123.3.3.3
R21#
发现了在R21的所有router-LSA都被配置了max-metric值,在OSPF中,度量值有一个上限,即65535,这个值被称为“最大度量值”或“最大度量”。如果一个路径的度量值大于最大度量值,则该路径被认为是无效的,并被排除在最短路径计算之外,因此该路径没有被通告给邻居,因此需要将此项配置去除掉。
问题5. R21配置了max-metric导致路由无效
删除该配置
R21#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R21(config)#router ospf 12345
R21(config-router)#no max-metric router-lsa
R21(config-router)#
验证修改的效果, 发现R1上依然只有一条R5过来的134.56.78.48/29网络。
在R1上查看从R3通告过来的所有的路由信息
R1#show ip ospf database adv-router 123.3.3.3
OSPF Router with ID (123.1.1.1) (Process ID 12345)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
123.3.3.3 123.3.3.3 679 0x80000007 0x00237D 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
123.45.67.6 123.3.3.3 679 0x80000003 0x00962B
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
134.21.21.21 123.3.3.3 1174 0x80000002 0x00D214
134.22.22.22 123.3.3.3 160 0x80000003 0x0014C4
134.56.78.0 123.3.3.3 1332 0x80000001 0x00821F
R1#
发现从R3通告过来的,关于134.56.78.0只有一条记录,而且是汇总记录、明显134.56.78.48也被汇总了,因此查询R3的OSPF配置信息
R3#show run | s router ospf
router ospf 12345
router-id 123.3.3.3
area 1 range 134.56.78.0 255.255.255.0
network 123.3.3.3 0.0.0.0 area 0
network 123.45.67.6 0.0.0.0 area 0
network 134.56.78.37 0.0.0.0 area 1
R3#
问题6. R3汇总了134.56.78.0的网段路由。
取消汇总信息
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#router ospf 12345
R3(config-router)#no area 1 range 134.56.78.0 255.255.255.0
R3(config-router)#
再次在R1上验证通告信息
R1#show ip ospf database adv-router 123.3.3.3
OSPF Router with ID (123.1.1.1) (Process ID 12345)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
123.3.3.3 123.3.3.3 883 0x80000007 0x00237D 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
123.45.67.6 123.3.3.3 883 0x80000003 0x00962B
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
134.21.21.21 123.3.3.3 1378 0x80000002 0x00D214
134.22.22.22 123.3.3.3 365 0x80000003 0x0014C4
134.56.78.36 123.3.3.3 23 0x80000001 0x000779
134.56.78.40 123.3.3.3 23 0x80000001 0x00A7C0
134.56.78.48 123.3.3.3 23 0x80000001 0x00DA93
R1#show ip ospf database summary 134.56.78.48
OSPF Router with ID (123.1.1.1) (Process ID 12345)
Summary Net Link States (Area 0)
LS age: 61
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 134.56.78.48 (summary Network Number)
Advertising Router: 123.3.3.3
LS Seq Number: 80000001
Checksum: 0xDA93
Length: 28
Network Mask: /29
MTID: 0 Metric: 20
LS age: 1907
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 134.56.78.48 (summary Network Number)
Advertising Router: 123.5.5.5
LS Seq Number: 80000003
Checksum: 0xACB9
Length: 28
Network Mask: /29
MTID: 0 Metric: 20
R1#
查询路由表
R1(config-if)#do show ip route
......
134.56.0.0/16 is variably subnetted, 3 subnets, 2 masks
O IA 134.56.78.36/30 [110/11] via 123.45.67.6, 00:22:40, Ethernet1/0
O IA 134.56.78.40/30 [110/20] via 123.45.67.18, 01:39:06, Ethernet2/0
O IA 134.56.78.48/29 [110/21] via 123.45.67.6, 00:22:40, Ethernet1/0
发现134.56.78.48并没有形成等价的负载均衡、从R3和R5通告过来的路由信息来看、R3去往134.56.78.48和R5去往134.56.78.48的开销是一样的都是20(R3、R5、R1都是区域0,所以ABR通告的信息整个区域0的所有的路由器都可以收到、而且他里面的Metric值都是通告者到目标的距离),所以R1去往R3或是R5对应的Cost应该要再加上10(默认10M的接口开销是10)所以R1去往134.56.78.48的开销应该是30,而上面路由表却显示是21,因此说明E1/0上应该是有手动配置了开销值,导致没有办法形成等价负载均衡。
问题7. R1的E1/0被手动配置了cost值
R1# show run interface e1/0
Building configuration...
Current configuration : 110 bytes
!
interface Ethernet1/0
no shutdown
ip address 123.45.67.5 255.255.255.252
ip ospf cost 1
mpls ip
end
R1# conf t
R1(config)# int e1/0
R1(config-if)# no ip ospf cost 1
再次验证
R1#show ip route
......
O IA 134.56.78.48/29 [110/30] via 123.45.67.18, 00:54:21, Ethernet2/0
[110/30] via 123.45.67.6, 00:54:21, Ethernet1/0
形成了等价负载均衡
R1#show ip ospf database summary 134.56.78.48
OSPF Router with ID (123.1.1.1) (Process ID 12345)
Summary Net Link States (Area 0)
LS age: 707
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 134.56.78.48 (summary Network Number)
Advertising Router: 123.3.3.3
LS Seq Number: 80000003
Checksum: 0xD695
Length: 28
Network Mask: /29
MTID: 0 Metric: 20
LS age: 470
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 134.56.78.48 (summary Network Number)
Advertising Router: 123.5.5.5
LS Seq Number: 80000006
Checksum: 0xA6BC
Length: 28
Network Mask: /29
MTID: 0 Metric: 20
R1#show ip route 134.56.78.48
Routing entry for 134.56.78.48/29
Known via "ospf 12345", distance 110, metric 30, type inter area
Last update from 123.45.67.6 on Ethernet1/0, 00:55:36 ago
Routing Descriptor Blocks:
* 123.45.67.18, from 123.5.5.5, 00:55:36 ago, via Ethernet2/0
Route metric is 30, traffic share count is 1
123.45.67.6, from 123.3.3.3, 00:55:36 ago, via Ethernet1/0
Route metric is 30, traffic share count is 1
R1#
实验排错完成。