Ruijie Community

Title: How to configure OSPF on Ruijie Switch? [Print this page]

Author: zhangqiao@ruiji    Time: 2024-11-15 10:19
Title: How to configure OSPF on Ruijie Switch?
Introduction:

The open shortest  path first (OSPF) is an Interior Gateway Protocol (IGP) that is used within the autonomous system (AS) to allow routers to obtain a route to a remote network. In  the early stage after dynamic routing emerges, Routing  Information Protocol (RIP) was mainly used on the network. RIP is a distance vector routingprotocol, facing some problems such as slow convergence, routing loop, poorscalability, and use for simple networks only. OSPF Version 2 (OSPFv2) is a link-state routing protocol, which can effectively fix the above problems.Therefore, OSPFv2 is widely used on large and medium-sized networks.

Topology:

Make all networks interoperable





Configurationsteps:

1. Configure the Interface IP Address on all devices.
#Device A's configuration.


DeviceA > enable

DeviceA #configure terminal

DeviceA (config) #interface gigabitethernet 0/1

DeviceA (config-if-GigabitEthernet 0/1) #ip address 192.168.1.1 255.255.255.0

DeviceA (config-if-GigabitEthernet 0/1) #exit

DeviceA (config) #interface gigabitethernet 0/2

DeviceA (config-if-GigabitEthernet 0/2) #ip address 192.168.2.1 255.255.255.0

DeviceA (config-if-GigabitEthernet 0/2) #exit



#Device B configuration.


DeviceB > enabled

DeviceB #configure terminal

DeviceB (config) #interface gigabitethernet 0/1

DeviceB (config-if-GigabitEthernet 0/1) #ip address 192.168.1.2 255.255.255.0

DeviceB (config-if-GigabitEthernet 0/1) #exit

DeviceB (config) #interface gigabitethernet 0/2

DeviceB (config-if-GigabitEthernet 0/2) #ip address 192.168.3.1 255.255.255.0

DeviceB (config-if-GigabitEthernet 0/2) #exit



#Device C configuration.


DeviceC > enable

DeviceC #configure terminal

DeviceC (config) #interface gigabitethernet 0/3

DeviceC (config-if-GigabitEthernet 0/3) #ip address 192.168.2.2 255.255.255.0

DeviceC (config-if-GigabitEthernet 0/3) #exit



#Device D configuration.


DeviceD > enabled

DeviceD #configure terminal

DeviceD (config) #interface gigabitethernet 0/3

DeviceD (config-if-GigabitEthernet 0/3) #ip address 192.168.3.2 255.255.255.0

DeviceD (config-if-GigabitEthernet 0/3) #exit





2. Configure the OSPF instance, Router ID, and add the interface address to OSPF


#Device A's configuration.


DeviceA (config) #router ospf 1

DeviceA (config-router) #router-id 192.168.1.1

DeviceA (config-router) #network 192.168.1.0 0.0.0.255 area 0

DeviceA (config-router) #network 192.168.2.0 0.0.0.255 area 1



#Device B configuration.


DeviceB (config) #router ospf 1

DeviceB (config-router) #router-id 192.168.1.2

DeviceB (config-router) #network 192.168.1.0 0.0.0.255 area 0

DeviceB (config-router) #network 192.168.3.0 0.0.0.255 area 2



#Device C configuration.


DeviceC (config) #router ospf 1

DeviceC (config-router) #router-id 192.168.2.2

DeviceC (config-router) #network 192.168.2.0 0.0.0.255 area 1



#Device D configuration.


DeviceD (config) #router ospf 1

DeviceD (config-router) #router-id 192.168.3.2

DeviceD (config-router) #network 192.168.3.0 0.0.0.255 area 2



Verification:

Check Device A's OSPF neighbors and routes.

#Device A's OSPF route.


Device A #show ip route ospf

OIA 192.168.3.0/24 [110/2] via 192.168.1.2, 00:18:03, GigabitEthernet 0/1



#Device A's neighbor information.


DeviceA #show ip ospf neighbors

OSPFprocess 1, 2 Neighbors, 2 is Full:

NeighborID Pri State Dead Time Address Interface

192.168.1.21 Full/DR 00:00:40 192.168.1.2 GigabitEthernet 0/1

192.168.2.21 Full/BDR 00:00:34 192.168.2.2 GigabitEthernet 0/2




(2) Check Device B's OSPF neighbors and routes.

#OSPF route for Device B.


DeviceB #show ip route ospf

OIA 192.168.2.0/24 [110/2] via 192.168.1.2, 00:18:03, GigabitEthernet 0/1



#Device B's neighbor information.


DeviceB #show ip ospf neighbors

OSPFprocess 1, 2 Neighbors, 2 is Full:

NeighborID Pri State Dead Time Address Interface

192.168.1.11 Full/BDR 00:00:32 192.168.1.1 GigabitEthernet 0/1

192.168.3.21 Full/BDR 00:00:30 192.168.3.2 GigabitEthernet 0/2




(3) Check Device C's OSPF neighbors and routes.

#OSPF routing for Device C.

DeviceC #show ip route ospf



OIA 192.168.1.0/24 [110/2] via 192.168.2.1, 00:19:05, GigabitEthernet 0/3

OIA 192.168.3.0/24 [110/3] via 192.168.2.1, 00:19:05, GigabitEthernet 0/3



#Device C's neighbor information.


DeviceC #show ip ospf neighbors

OSPFprocess 1, 1 Neighbors, 1 is Full:

NeighborID Pri State Dead Time Address Interface

192.168.1.11 Full/BDR 00:00:32 192.168.2.1 GigabitEthernet 0/3



(4) Check Device D's OSPF neighbors and routes.

#OSPF route for Device D.

Device D #show ip route ospf


OIA 192.168.1.0/24 [110/2] via 192.168.3.1, 00:19:05, GigabitEthernet 0/3

OIA 192.168.2.0/24 [110/3] via 192.168.3.1, 00:19:05, GigabitEthernet 0/3



#Device D's neighbor information.


DeviceD #show ip ospf neighbors

OSPFprocess 1, 1 Neighbors, 1 is Full:

NeighborID Pri State Dead Time Address Interface

192.168.1.21 Full/BDR 00:00:30 192.168.3.1 GigabitEthernet 0/3




(5) detected on the Device D address 192.168.2.2network reachability.


DeviceD #ping 192.168.2.2

Sending5,100-byte ICMP Echoes to 192.168.2.2, timeout is 2 seconds:

<press Ctrl + C to break >

!!!!!

Successrate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms.



Author: cyxinstreet@163    Time: 2025-2-6 13:54
It is helpful.

Author: Sathit@cyn.co.t    Time: 2025-2-8 11:09
Excellent of Guide PoC





Welcome to Ruijie Community (https://community.ruijienetworks.com/) Powered by Discuz! X3.2