Saturday, 12 July 2025

OSPF configuration in Huawei router

 

 

 

 

            





R1 configuration:

#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255

interface Ethernet3/0/0
 undo shutdown
 ip address 10.10.10.1 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0.0
#

#
interface Ethernet3/0/1
 undo shutdown
 ip address 10.10.20.1 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0.0
#
return
<NE-1>dis current-configuration interface Ethernet 3/0/2
#
interface Ethernet3/0/2
 undo shutdown
 ip address 10.10.30.1 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0.0

#
ospf 1 router-id 1.1.1.1
 opaque-capability enable
 area 0.0.0.0
  network 1.1.1.1 0.0.0.0

R2 Configuration:

#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255
#

interface Ethernet3/0/0
 undo shutdown
 ip address 10.10.10.2 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0.0
#
interface Ethernet3/0/1
 undo shutdown
 ip address 10.10.40.1 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0. 
#


#
ospf 1 router-id 2.2.2.2
 opaque-capability enable
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
 

R3 Configuration:

 
 #
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255
#
return
<NE-3>dis current-configuration interface ether     
<NE-3>dis current-configuration interface Ethernet 3/0/0
#
interface Ethernet3/0/0
 undo shutdown
 ip address 10.10.20.2 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0.0
#
return
<NE-3>dis current-configuration interface Ethernet 3/0/1
#
interface Ethernet3/0/1
 undo shutdown
 ip address 10.10.50.1 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0.0
#
return
<NE-3>dis c c ospf
#
ospf 1 router-id 3.3.3.3
 opaque-capability enable
 area 0.0.0.0
  network 3.3.3.3 0.0.0.0
#
return
 

 

R4 Configuration:

 
<NE-4>dis current-configuration interface LoopBack 0
#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.255
#
return
<NE-4>dis current-configuration interface ether     
<NE-4>dis current-configuration interface Ethernet 3/0/0
#
interface Ethernet3/0/0
 undo shutdown
 ip address 10.10.40.2 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0.0
#
return
<NE-4>dis current-configuration interface Ethernet 3/0/1
#
interface Ethernet3/0/1
 undo shutdown
 ip address 10.10.50.2 255.255.255.252
 ospf network-type p2p
 ospf enable 1 area 0.0.0.0
#
return
<NE-4>dis current-configuration interface Ethernet 3/0/2
#
interface Ethernet3/0/2
 undo shutdown
 ip address 10.10.30.2 255.255.255.252
#
return
<NE-4>dis c c ospf
#
ospf 1 router-id 4.4.4.4
 opaque-capability enable
 area 0.0.0.0
  network 4.4.4.4 0.0.0.0
#
return
 
 

verification:

<NE-1>dis ospf peer brief 

(M) Indicates MADJ neighbor


          OSPF Process 1 with Router ID 1.1.1.1
                   Peer Statistic Information
Total number of peer(s): 3       
 Peer(s) in full state: 3       
-----------------------------------------------------------------------------
 Area Id         Interface                  Neighbor id          State       
 0.0.0.0         Eth3/0/0                   2.2.2.2              Full        
 0.0.0.0         Eth3/0/1                   3.3.3.3              Full        
 0.0.0.0         Eth3/0/2                   4.4.4.4              Full        

-----------------------------------------------------------------------------
<NE-1>
<NE-1>

 <NE-1>dis ospf interface 

(M) Indicates MADJ interface


          OSPF Process 1 with Router ID 1.1.1.1
                  Interfaces

 Area: 0.0.0.0          (MPLS TE not enabled)
 Interface                    IP Address      Type         State    Cost    Pri  
 Eth3/0/0                     10.10.10.1      P2P          P-2-P    1        1    
 Eth3/0/1                     10.10.20.1      P2P          P-2-P    1        1    
 Eth3/0/2                     10.10.30.1      P2P          P-2-P    1        1    
    Loop0                        1.1.1.1         P2P          P-2-P    0        1    

 

<NE-4>dis ospf peer brief 

(M) Indicates MADJ neighbor


          OSPF Process 1 with Router ID 4.4.4.4
                   Peer Statistic Information
Total number of peer(s): 3       
 Peer(s) in full state: 3       
-----------------------------------------------------------------------------
 Area Id         Interface                  Neighbor id          State       
 0.0.0.0         Eth3/0/0                   2.2.2.2              Full        
 0.0.0.0         Eth3/0/1                   3.3.3.3              Full        
 0.0.0.0         Eth3/0/2                   1.1.1.1              Full        

-----------------------------------------------------------------------------

 <NE-4>dis ospf interface 

(M) Indicates MADJ interface


          OSPF Process 1 with Router ID 4.4.4.4
                  Interfaces

 Area: 0.0.0.0          (MPLS TE not enabled)
 Interface                    IP Address      Type         State    Cost    Pri  
 Eth3/0/0                     10.10.40.2      P2P          P-2-P    1       1    
 Eth3/0/1                     10.10.50.2      P2P          P-2-P    1       1    
 Loop0                        4.4.4.4         P2P          P-2-P    0       1    

 

 
 
 

 

 

No comments:

Post a Comment