Disabling OSPF on Certain Interfaces
Problem
You want to prevent the some of a router’s interfaces from taking part in OSPF.
Solution
The passive-interface configuration command effectively disables OSPF on an interface by preventing it from forming OSPF adjacencies:
Router3#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router3(config)#router ospfRouter3(config-router)#44network0.0.0.0 255.255.255.255areaRouter3(config-router)#100passive-interfaceRouter3(config-router)#Ethernet0exitRouter3(config)#endRouter3#
A useful variant of this command allows you to make all interfaces passive by default until you explicitly enable them:
Router3#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router3(config)#router ospfRouter3(config-router)#44network0.0.0.0 255.255.255.255areaRouter3(config-router)#100passive-interface defaultRouter3(config-router)#no passive-interfaceRouter3(config-router)#Ethernet0exitRouter3(config)#endRouter3#
Discussion
OSPF will not start to exchange any routing information until two routers on a segment have formed an adjacency and agreed on the various area parameters, including any authentication requirements. So simply preventing one router from taking part in this handshake is sufficient to prevent the exchange of OSPF information on the interface. Also, while you can use a passive-interface command as shown in the example, you can also prevent an interface from taking part in OSPF ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access