How to Configure OSPF Passive Interface on Cisco Router

Whenever we advertise networks on a router in the OSPF configuration mode, the OSPF route advertisement will be enabled on all the interfaces of the router. However, it is good practice to disable the advertisement on interfaces connecting to networks that are not part of the autonomous system or interfaces that are idle.

Disabling the advertisement will help to reduce the amount of OSPF traffic and improve performance, as well as provide additional security by preventing external networks from learning about internal networks.

In this post, I will show how to configure the OSPF passive interface on a Cisco router.

Network Topology

The network topology we will make use of in this post is shown below. As you can see, it consists of two routers, a switch, and a PC. In this demonstration, we will configure OSPF passive interface on the e0/1 interface of R1.

Network topology for configuring OSPF passive interface

How to configure OSPF Passive Interface on Cisco Router.

To configure the OSPF Passive Interface on a Cisco Router, enter the “passive-interface ethernet0/1” command in the OSPF configuration mode of the router. “ethernet0/1” is the specific interface where you want to disable OSPF route advertisements.
Here is a full configuration step to configure the OSPF passive interface on the e0/1 interface of R1 in the network topology above.

Step 1: Configure the interface of the routers

Router 1

R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown 
R1(config-if)#exit

R1(config)#interface ethernet0/1
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown 
R1(config-if)#exit

Router 2

R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown 
R2(config-if)#exit

Step 2: Configure OSPF on the routers.

After configuring the IP address to the interfaces of the router, we need to configure OSPF to the routers before configuring the OSPF passive interface to e0/1 of Router 1.

Router 1

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0

Router 2

R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.168.12.0 0.0.0.255 area 0
R2(config-router)#exit

Step 3: Configure the OSPF Passive Interface on Router 1

To disable OSPF route advertisement on the e0/1 interface of Router, enter the following commands:.

R1(config)#router ospf 1
R1(config-router)#passive-interface ethernet0/1	<-- Passive Interface ethernet0/1 (LAN Interface)
R1(config-router)#exit

Step 4: Test the configuration

R1#debug ip ospf hello

OSPF hello debugging is on
R1#
*Dec 26 02:57:25.524: OSPF-1 HELLO Et0/0: Send hello to 224.0.0.5 area 0 from 192.168.12.1
R1#
*Dec 26 02:57:26.838: OSPF-1 HELLO Et0/0: Rcv hello from 2.2.2.2 area 0 192.168.12.2
R1#
*Dec 26 02:57:34.963: OSPF-1 HELLO Et0/0: Send hello to 224.0.0.5 area 0 from 192.168.12.1
R1#
*Dec 26 02:57:36.565: OSPF-1 HELLO Et0/0: Rcv hello from 2.2.2.2 area 0 192.168.12.2
R1#
*Dec 26 02:57:44.320: OSPF-1 HELLO Et0/0: Send hello to 224.0.0.5 area 0 from 192.168.12.1
R1#
*Dec 26 02:57:45.931: OSPF-1 HELLO Et0/0: Rcv hello from 2.2.2.2 area 0 192.168.12.2

R1#undebug all
All possible debugging has been turned off 

Related Content;

  1. How to Configure OSPF Default Route on a Cisco Router
  2. How to Configure OSPF DR and BDR
  3. Configuring OSPF Hello Timer
  4. How to Configure OSPF Backbone Area | How to Configure OSPF Area 0
  5. How to Configure OSPF Multi-Area
  6. How To Configure OSPF on Layer 3 Switch In Packet Tracer
  7. Redistributing Static Routes into OSPF: Explained With Example

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top