To ensure that OSPF parameters are configured correctly, perform the following operations:
- Check that router IDs in OSPF processes on both ends are unique.
Each router ID in an OSPF process must be unique. Otherwise, an OSPF neighbor relationship cannot be established and routing information is incorrect.
# Check the router ID in OSPF process 1.
<Huawei> display ospf 1 brief
OSPF Process 1 with Router ID 1.1.1.1
OSPF Protocol Information
RouterID: 1.1.1.1 Border Router:
Multi-VPN-Instance is not enabled
Global DS-TE Mode: Non-Standard IETF Mode
Graceful-restart capability: disabled
If router IDs in OSPF processes on both ends are not unique, change the router IDs to make them unique. To make the new router IDs take effect, restart the two OSPF processes in the user view.
<Huawei> system-view
[Huawei] ospf 1 router-id 1.1.1.1
[Huawei-ospf-1] return
<Huawei> reset ospf 1 process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
- Check that OSPF area IDs and area types of interfaces on both ends are consistent.
OSPF area IDs and area types (for example, NSSA, stub area, or common area) of interfaces on both ends must be consistent. Otherwise, an OSPF neighbor relationship cannot be established between the two interfaces. To check the OSPF area ID and area type of the local interface, run the display ospf [ process-id ] brief command.
<Huawei> display ospf 1 brief
OSPF Process 1 with Router ID 1.1.1.1
OSPF Protocol Information
RouterID: 1.1.1.1 Border Router: AREA AS
¡¡
Area: 0.0.0.1 (MPLS TE not enabled)
Authtype: None Area flag: Stub
SPF scheduled Count: 4
ExChange/Loading Neighbors: 0
Router ID conflict state: Normal
Area interface up count: 1
Interface: 10.1.1.1 (GigabitEthernet0/0/0)
Cost: 1 State: Waiting Type: Broadcast MTU: 1500
¡¡
If OSPF area IDs of interfaces on both ends are inconsistent, change them to be consistent.
# 10.1.1.1/32 was first advertised to Area 1 and now advertised to Area 0.
<Huawei> display current-configuration configuration ospf
[V200R007C00SPC900]
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 12.1.1.1 0.0.0.0
area 0.0.0.1
network 10.1.1.1 0.0.0.0
#
return
<Huawei> system-view
[Huawei] ospf 1
[Huawei-ospf-1] area 1
[Huawei-ospf-1-area-0.0.0.1] undo network 10.1.1.1 0.0.0.0
[Huawei-ospf-1-area-0.0.0.1] quit
[Huawei-ospf-1] area 0
[Huawei-ospf-1-area-0.0.0.0] network 10.1.1.1 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0] return
<Huawei>
If OSPF area types of interfaces on both ends are inconsistent, change them to be consistent. By default, the OSPF area type is Normal.
# Change area type of Area 1 to stub.
<Huawei> system-view
[Huawei] ospf 1
[Huawei-ospf-1] area 1
[Huawei-ospf-1-area-0.0.0.1] stub
[Huawei-ospf-1-area-0.0.0.1] return
<Huawei>
- Check that OSPF authentication modes and passwords on the two devices are consistent.
If OSPF authentication is configured on the two switches, the two devices must use the same authentication mode and password. Otherwise, the two devices cannot establish an OSPF neighbor relationship.
# Check whether OSPF authentication is configured on GE0/0/0.
<Huawei> display current-configuration interface GigabitEthernet0/0/0
[V200R007C00SPC900]
#
interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0
ip address 10.2.1.1 255.255.255.0 sub
ospf authentication-mode md5 1 cipher %@%@z#UE)ok^"*^=IMJ36>$41FVP%@%@
#
return
# Check whether OSPF authentication is configured in the specified OSPF area.
<Huawei> display current-configuration configuration ospf
[V200R007C00SPC900]
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
authentication-mode md5 1 cipher %@%@N^O.C,IYy$d=sTMMlXYU1@n.%@%@
network 10.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
area 0.0.0.1
#
return
If OSPF authentication modes or passwords on the two devices are inconsistent, change them to be consistent in the required view according to the configured authentication mode (interface authentication or area authentication).
# Configure OSPF area authentication in Area 0, authentication mode to MD5, authentication identifier to 1, and password to huawei. OSPF authentication modes, authentication identifiers, and passwords in Area 0 must be consistent.
<Huawei> system-view
[Huawei] ospf 1
[Huawei-ospf-1] area 0
[Huawei-ospf-1-area-0.0.0.0] authentication-mode md5 1 cipher huawei
[Huawei-ospf-1-area-0.0.0.0] return
<Huawei>
- Check that OSPF interfaces on both ends have the same network type, intervals for sending Hello packets, and neighbor dead interval configured.
OSPF interfaces on both ends must have the same network type, interval for sending Hello packets, and neighbor dead interval configured. Otherwise, an OSPF neighbor relationship cannot be established and routing information is incorrect.
# Run the display ospf interface verbose command to check the network type, interval for sending Hello packets, and neighbor dead interval.
<Huawei> display ospf interface verbose
OSPF Process 1 with Router ID 1.1.1.1
Interfaces
Area: 0.0.0.0 (MPLS TE not enabled)
Interface: 10.1.1.1 (GigabitEthernet0/0/0)
Cost: 1 State: Down Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 0.0.0.0
Backup Designated Router: 0.0.0.0
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
IO Statistics
¡¡
If OSPF interface network types on both ends are inconsistent, change them to be consistent.
# Set the OSPF network type to broadcast for GE0/0/0.
<Huawei> system-view
[Huawei] interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0] ospf network-type broadcast
[Huawei-GigabitEthernet0/0/0] return
<Huawei>
If the interval for sending Hello packets and neighbor dead interval on both ends are inconsistent, change them to be consistent.
# Set the interval for sending Hello packets to 10s and neighbor dead interval to 40s on GE0/0/0.
<Huawei> system-view
[Huawei] interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0] ospf timer hello 10
[Huawei-GigabitEthernet0/0/0] ospf timer dead 40
[Huawei-GigabitEthernet0/0/0] return
<Huawei>
- Check whether OSPF interfaces on both ends use the same IP address mask.
The IP address masks of OSPF interfaces on both ends must be the same. Otherwise, the two OSPF interfaces cannot establish an OSPF neighbor relationship.
<Huawei> display current-configuration interface GigabitEthernet 0/0/0
[V200R007C00SPC900]
#
interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0
#
return
If IP address masks of OSPF interfaces on both ends are inconsistent, change them to be consistent.
<Huawei> system-view
[Huawei] interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0] ip address 10.1.1.1 24
[Huawei-GigabitEthernet0/0/0] return
<Huawei>