In this OSPF Configuration Example , we will configure OSPFv2 on Huawei Routers . We will use eNSP for our Huawei OSPFv2 Configuration Example and our topology will be like below.
Here, we will configure only one area, Area 0. So, this is a single Area OSPF Configuration example.
Our configuration steps will be as mentined below:
Router Interface and PC IP Configurations
OSPF Process Creation and OSPF Router ID Configuration
Adding Networks to OSPF Area 0
OSPFv2 Verification
Now, let’s start and do the configurations required for each step.
Router Interface and PC IP Configurations
Huawei interface confiugrations was showed before in many eNSP configuration lessons, so here, we will not show this interface configurations again. The interface configurations will be done with the below IP addresses on each Huawei router.
Router 1
GE 0/0/0 : 10.0.0.1/24
GE 0/0/1 : 20.0.0.1/24
Ethernet 0/0/0 : 192.168.1.1/24
Router 2
GE 0/0/0 : 10.0.0.2/24
GE 0/0/1 : 30.0.0.1/24
Ethernet 0/0/0 : 192.168.2.1/24
Router 3
GE 0/0/0 : 40.0.0.2/24
GE 0/0/1 : 30.0.0.2/24
Ethernet 0/0/0 : 192.168.3.1/24
Router 4
GE 0/0/0 : 40.0.0.1/24
GE 0/0/1 : 20.0.0.2/24
Ethernet 0/0/0 : 192.168.4.1/24
We will configure the PC IP addresses like below:
PC1 -> IP Address: 192.168.1.2 Subnet Mask : 255.255.255.0 Default Gateway: 192.168.1.1
PC2 -> IP Address: 192.168.2.2 Subnet Mask : 255.255.255.0 Default Gateway: 192.168.2.1
PC3 -> IP Address: 192.168.3.2 Subnet Mask : 255.255.255.0 Default Gateway: 192.168.3.1
PC4 -> IP Address: 192.168.4.2 Subnet Mask : 255.255.255.0 Default Gateway: 192.168.4.1
OSPF Process Creation and OSPF Router ID Configuration
To create OSPF Process, we will use “ospf ospf-process-id ” command. Here, we will use process ID, “1 ”.
OSPF Router ID is the ID that makes each OSPF router unique in the OSPF network. Here, we will set the below router IDs.
<Huawei-Router-1> system-view
[Huawei-Router-1] ospf 1 router-id 1.1.1.1
[Huawei-Router-1-ospf-1]
<Huawei-Router-2> system-view
[Huawei-Router-2] ospf 1 router-id 2.2.2.2
[Huawei-Router-2-ospf-1]
<Huawei-Router-3> system-view
[Huawei-Router-3] ospf 1 router-id 3.3.3.3
[Huawei-Router-3-ospf-1]
<Huawei-Router-4> system-view
[Huawei-Router-4] ospf 1 router-id 4.4.4.4
[Huawei-Router-4-ospf-1]
Adding Networks to OSPF Area 0
Here, we are configuring OSPFv2 for a single OSPF Area, Area 0. Firstly, we eill go to the OSPF Area 0 context with “area 0” command, then we will add our OSPF networks under Area 0. Here, to add the networks under OSPFv2 process, we will use both network address and the wildcard mask.
[Huawei-Router-1-ospf-1] area 0
[Huawei-Router-1-ospf-1-area-0.0.0.0] network 10.0.0.0 0.0.0.255
[Huawei-Router-1-ospf-1-area-0.0.0.0] network 20.0.0.0 0.0.0.255
[Huawei-Router-1-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[Huawei-Router-1-ospf-1-area-0.0.0.0] quit
[Huawei-Router-1-ospf-1] quit
[Huawei-Router-1] quit
<Huawei-Router-1> save
[Huawei-Router-2-ospf-1] area 0
[Huawei-Router-2-ospf-1-area-0.0.0.0] network 10.0.0.0 0.0.0.255
[Huawei-Router-2-ospf-1-area-0.0.0.0] network 30.0.0.0 0.0.0.255
[Huawei-Router-2-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[Huawei-Router-2-ospf-1-area-0.0.0.0] quit
[Huawei-Router-2-ospf-1] quit
[Huawei-Router-2] quit
<Huawei-Router-2> save
[Huawei-Router-3-ospf-1] area 0
[Huawei-Router-3-ospf-1-area-0.0.0.0] network 30.0.0.0 0.0.0.255
[Huawei-Router-3-ospf-1-area-0.0.0.0] network 40.0.0.0 0.0.0.255
[Huawei-Router-3-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
[Huawei-Router-3-ospf-1-area-0.0.0.0] quit
[Huawei-Router-3-ospf-1] quit
[Huawei-Router-3] quit
<Huawei-Router-3> save
[Huawei-Router-4-ospf-1] area 0
[Huawei-Router-4-ospf-1-area-0.0.0.0] network 20.0.0.0 0.0.0.255
[Huawei-Router-4-ospf-1-area-0.0.0.0] network 40.0.0.0 0.0.0.255
[Huawei-Router-4-ospf-1-area-0.0.0.0] network 192.168.4.0 0.0.0.255
[Huawei-Router-4-ospf-1-area-0.0.0.0] quit
[Huawei-Router-4-ospf-1] quit
[Huawei-Router-4] quit
<Huawei-Router-4> save
As a note, after configuring the OSPF or running the topology again, you need to wait for a while (almost 1 minute) for OSPF convergence. After that period, the below alerts will be sent to the router terminal and the OSPF neighborships will be in the converged state, Full state. Below, you can find the screenshot of the Router 2’s OSPF neighborship alerts.
Apr 16 2019 23:15:43-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes
event: neighbor status changed. (ProcessId=1, NeighborAddress=30.0.0.2, Neighbo
rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart)
Apr 16 2019 23:15:44-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes
event: neighbor status changed. (ProcessId=1, NeighborAddress=30.0.0.2, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange)
Apr 16 2019 23:15:44-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes
event: neighbor status changed. (ProcessId=1, NeighborAddress=30.0.0.2, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g)
Apr 16 2019 23:15:44-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes
event: neighbor status changed. (ProcessId=1, NeighborAddress=30.0.0.2, Neighbo
rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)
Apr 16 2019 23:15:44-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes
event: neighbor status changed. (ProcessId=1, NeighborAddress=10.0.0.1, Neighbo
rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart)
Apr 16 2019 23:15:44-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes
event: neighbor status changed. (ProcessId=1, NeighborAddress=10.0.0.1, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange)
Apr 16 2019 23:15:44-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes
event: neighbor status changed. (ProcessId=1, NeighborAddress=10.0.0.1, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g)
Apr 16 2019 23:15:44-08:00 Huawei %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes
event: neighbor status changed. (ProcessId=1, NeighborAddress=10.0.0.1, Neighbo
rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)