Basic configuration of OSPF Protocol on Huawei Routers
- January 21, 2024
- Posted by: Lyfey Technologies
- Category: Huawei
No Comments
Open Shortest Path First (OSPF) is a link-state dynamic Interior Gateway Protocol (IGP) developed by IETF. In this article, we explore how to configure OSPF on Huawei routers.
Below is our topology. We have four routers with three OSPF areas.
You must do proper planning for your network before starting to do the configuration. You need the IP addresses, OSPF process IDs, OSPF Area IDs, and the router ID.
Configuration steps:
Step 1: Configure device names, interface description and IPv4 addresses on all the routes.
***********************************************R1***********************
#
sysname R1
interface Loopback 0
ip address 1.1.1.1 31
#
interface GigabitEthernet0/0/0
description TO_R2_GE0/0/0
ip address 12.12.12.0 255.255.255.254
#
********************************************R2***************************
Sysname R2
#
interface Loopback 0
ip address 2.2.2.2 31
#
interface GigabitEthernet0/0/0
description TO_R1_GE0/0/0
ip address 12.12.12.1 255.255.255.254
#
interface GigabitEthernet0/0/1
description TO_R3_GE0/0/0
ip address 23.23.23.0 255.255.255.254
#
*************************************R3**********************************
sysname R3
#
interface Loopback 0
ip address 3.3.3.3 32
#
interface GigabitEthernet0/0/0
description TO_R2_GE0/0/1
ip address 23.23.23.1 255.255.255.254
#
interface GigabitEthernet0/0/1
description TO_R4_GE0/0/0
ip address 34.34.34.0 255.255.255.254
#
*************************************R4**************************************
sysname R4
#
interface Loopback 0
ip address 4.4.4.4 32
#
interface GigabitEthernet0/0/0
description TO_R3_GE0/0/1
ip address 34.34.34.1 255.255.255.254
#
Configure OSPF and advertise networks on all routers.
*******************************R1**********************************
ospf 5 router-id 1.1.1.1
area 0.0.0.1
network 1.1.1.1 0.0.0.0
network 12.12.12.0 0.0.0.1
#
******************************R2***********************************
ospf 10 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 23.23.23.0 0.0.0.1
area 0.0.0.1
network 12.12.12.0 0.0.0.1
#
*****************************R3****************************************
ospf 10 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 23.23.23.0 0.0.0.1
area 0.0.0.2
network 34.34.34.0 0.0.0.1
#
***************************R4*******************************************
ospf 2 router-id 4.4.4.4
area 0.0.0.2
network 4.4.4.4 0.0.0.0
network 34.34.34.0 0.0.0.1
Verify OSPF adjacency status on all the routers and check the OSPF routing table.
Download the lab setup and configurations below: