Failing to Learn Routes After the OSPF Neighbor Relationship Is Established
Network Topology
Physical Network Topology
Figure 1-1 Network where the switch fails to learn routes after the OSPF neighbor relationship is established
Fault Description
After a Huawei switch establishes an OSPF neighbor relationship with a Cisco switch, the Huawei switch fails to learn routes from the peer end.
Configuration Files
l S5720_A
sysname S5720_A
#
vlan batch 10 20
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
ip address 192.168.1.254 255.255.255.0
#
interface Vlanif20
ip address 192.168.12.1 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
interface NULL0
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.12.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return
l S5720_B
#
sysname S5720_B
#
vlan batch 30 40
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif30
ip address 192.168.23.1 255.255.255.0
#
interface Vlanif40
ip address 192.168.2.254 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 40
#
interface NULL0
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 192.168.23.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return
Troubleshooting Location
Troubleshooting Procedure
Step 1 Check the OSPF neighbor relationship.
Run the display ospf peer command to check whether the OSPF neighbor relationship has been set up.
[S5720_A] display ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 192.168.12.1(Vlanif20)'s neighbors
Router ID: 2.2.2.2 Address:
192.168.12.2
State: Full Mode:Nbr is Master Priority:
1
DR: None BDR: None MTU:
0
Dead timer due in 34 sec
Retrans timer interval: 5
Neighbor is up for 00:03:08
Authentication Sequence: [ 0 ]
The command output shows that the OSPF neighbor relationship has been established and is in the Full state.
Step 2 Check the OSPF Link-State Database (LSDB).
Run the display ospf lsdb command to check whether the OSPF LSDB contains routing information.
[S5720_A] 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
2.2.2.2
2.2.2.2 454 60
80000016 1
Router
1.1.1.1
1.1.1.1
453 60 80000017 1
Router
3.3.3.3
3.3.3.3 1609
48 8000000B 1
Network 192.168.23.2
2.2.2.2 1598
32 80000002 0
The command output shows that the LSDB contains routing information.
Step 3 Check the detailed information about router LSA in the OSPF LSDB.
Run the display ospf lsdb link-state-id command to check the detailed information about the router LSA.
[S5720_A] display ospf lsdb router
1.1.1.1
OSPF Process 1 with Router ID 1.1.1.1
Area: 0.0.0.0
Link State Database
Type : Router
Ls id : 1.1.1.1
Adv rtr : 1.1.1.1
Ls age : 21
Len : 48
Options : E
seq# : 80000019
chksum : 0xf947
Link count: 2
* Link ID: 192.168.1.0
Data : 255.255.255.0
Link Type: StubNet
Metric : 1
Priority : Low
* Link ID: 192.168.12.0
Data : 255.255.255.0
Link Type: StubNet
Metric : 1
Priority : Low
[S5720_A] display ospf lsdb router
2.2.2.2
OSPF Process 1 with Router ID 1.1.1.1
Area: 0.0.0.0
Link State Database
Type : Router
Ls id : 2.2.2.2
Adv rtr : 2.2.2.2
Ls age : 633
Len : 60
Options : E
seq# : 80000016
chksum : 0x315
Link count: 3
* Link ID: 1.1.1.1
Data : 192.168.12.2
Link Type: P-2-P
Metric : 1
* Link ID: 192.168.12.0
Data : 255.255.255.0
Link Type: StubNet
Metric : 1
Priority : Low
* Link ID: 192.168.23.2
Data : 192.168.23.2
Link Type: TransNet
Metric : 1
Solution: Configure the OSPF network of the same type as the Cisco switch
[S5720_A] interface vlanif 20
[S5720_A-Vlanif20] ospf network p2p
After this command is configured, run the display ip routing-table command to check information about an IPv4 routing table, you can find that the routes from Cisco are displayed.
[S5720_A] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations :
8 Routes :
8
Destination/Mask Proto Pre
Cost Flags
NextHop Interface
127.0.0.0/8 Direct
0
0 D
127.0.0.1 InLoopBack0
127.0.0.1/32 Direct
0
0 D
127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0
0 D
192.168.1.254 Vlanif10
192.168.1.254/32 Direct 0
0 D
127.0.0.1 Vlanif10
192.168.2.0/24 OSPF 10
3 D
192.168.12.2 Vlanif20
192.168.12.0/24 Direct 0 0
D 192.168.12.1 Vlanif20
192.168.12.1/32 Direct 0
0 D
127.0.0.1 Vlanif20
192.168.23.0/24 OSPF 10
2 D
192.168.12.2 Vlanif20
----End
Root Cause
The types of OSPF networks where Huawei and Cisco switches are deployed and connected through VLANIF interfaces are different.