Open In App

Configuring OSPF Static Neighbors in Cisco

Last Updated : 13 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Pre-requisites : Open shortest path first (OSPF) router roles and configuration, OSPF network types

OSPF Static Neighbors :

  • In an OSPF autonomous system, when OSPF network type is configured either to be 
  1. Non-broadcast (NBMA) 
  2. Point-to-multipoint non-broadcast you must configure static neighbors to ensure that the OSPF can form neighbor relationship.
  3. To configure OSPF static neighbor(s), you have to manually specify the neighbor routers’ IP address as a subcommand under the router ospf <process> command.

 OSPF Static Neighbors command: 

Router OSPF subcommand

Description

Example

neighbor <ip-address> [cost number] To Specify a neighbor and assign a cost to the neighbor. (cost parameter is optional in this command) Router(config-router)# neighbor 192.168.1.4 cost 180

OSPF network type commands:

Interface configuration subcommand

Description

ip ospf <network broadcast | non-broadcast | point-to-multipoint | point-to-point> Configures an interface OSPF network type to broadcast/non-broadcast/point-to-point/point-to-multipoint (point-to-multipoint -Configures an interface as point-to-multipoint for broadcast media.)
no ip ospf network To revert the OSPF network type back to its default configuration.

Configuring OSPF Static Neighbors:

Step 1: Create the physical topology in GNS3 as show in the image below :

Configuring OSPF Static Neighbors:

 

Step 2: Configure IPv4 address on the physical interface of the routers :

R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface Serial1/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R2(config)#interface FastEthernet0/0
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R3(config-if)#interface Serial1/0
R3(config-if)#ip address 192.168.1.2 255.255.255.0
R3(config-if)#no shutdown

Step 3: Configuring OSPF process on all the routers with the command router ospf <process-id> :

R1(config)#router ospf 1
R1(config-router)#exit
R2(config)#router ospf 1
R2(config-router)#exit
R3(config)#router ospf 1
R3(config-router)#exit

Step 4: Enabling OSPF on the interfaces with the interface level sub-command ip ospf <process-id> area <area-id> :

R1(config)#interface FastEthernet0/0
R1(config-if)#ip ospf 1 area 0
R1(config-if)#interface Serial1/0
R1(config-if)#ip ospf 1 area 0
R2(config)#interface FastEthernet0/0
R2(config-if)#ip ospf 1 area 0
R3(config-if)#interface Serial1/0
R3(config-if)#ip ospf 1 area 0

Step 5: Checking the IPv4 routing table on the routers and seeing OSPF route entry :

R1#show ip route

 

R2#show ip route

 

R3#show ip route

 

Step 6: Checking OSPF neighbor relationships with the show command, show ip ospf neighbor :

R1#show ip ospf neighbor

 

R2#show ip ospf neighbor

 

R3#show ip ospf neighbor

 

Step 7: Configuring OSPF network type on serial interface of R1 and R3 :

R1(config)#interface serial1/0
R1(config-if)#ip ospf network non-broadcast
R3(config)#interface serial1/0
R3(config-if)#ip ospf network non-broadcast

Step 8: Checking OSPF neighbors relationships on R1 and R3 :

R1#show ip ospf neighbor
  • OPSF neighbor relationship with R3 using neighbor-id 192.168.1.2 is removed.

 

R3#show ip ospf neighbor
  • No OSPF neighbor relationship.

 

Step 9: Configuring OSPF static neighbor on R1 pointing to R3 and vice versa :

R1(config)#router ospf 1
R1(config-router)#neighbor 192.168.1.2
R3(config-if)#router ospf 1
R3(config-router)#neighbor 192.168.1.1

Step 10: Verify the OSPF neighbor relationships formed using the show ip ospf neighbor command :

R1#show ip ospf neighbor
  • OPSF neighbor relationship with R2 and R3 using neighbor-id 10.1.1.2 & 192.168.1.2 respectively.

 

R2#show ip ospf neighbor
  • OPSF neighbor relationship with R2 using neighbor-id 192.168.1.1.

 

R3#show ip ospf neighbor
  • OPSF neighbor relationship with R1 using neighbor-id 192.168.1.1.

 

Step 11: Verifying connectivity throughout the topology :

 

 

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads