Ospf passive-interface
Question:
I read in ospf about passive-interface. When we add a subnet by network command and add passive-interface to it,It stops all the OSPF processes for that interface ,but OSPF is UP.
Is it used to advertise subnet on the passive-interface to the network?
What is the real need of that interface?
If that interface goes down ,how it will affect OSPF as no hello messages are exchanged?
Answer:
as passive interface in OSPF prevents adjacency then you wont learn nor advertise anything on this interface as you have no OSPF neighbour but the network command you configured will tell the router to advertise this network out non passive interfaces to the neighbour on the other end.
Usually network command in router config mode in IGPs like RIP, OSPF and EIGRP serves two purposes.
1. Send routing updates through that network.
2. Advertise that network through other interfaces which are part of same routing protocol.
So with passive-interface command we are stopping routing protocol to perform point 1 however we still need routing protocol to perform point 2.
R1----ospf and (IBGP)--(a.a.a.0/30)-----R2-------eBGP--(x.x.x.0/30)---R3----y..x.y.0
Here, R2 is peering with R3 via ebgp, and is redistributing routes learned from R3. and R1 is peering with R2 via ibgp.
R1 and R2 have ospf peering too, but R1 can't reach network y.x.y because it doesn't have route to network X, to reach R3 which would be next hop as advertised by R2.
So, here, if R2 advertises the network x.x.x.0/30 in ospf and uses a passive-interface <interface> command, then no ospf packets would be sent on this link but the network x.x.x would be advertised into ospf and R1 can therefore reach network Y and X.
though, the router R3 must have some intelligence in its routing table to reach back to the R1 or so.
another example is... You have a 3-layer switch like WS-C3750X-24T-L in totally stubby area. to redistribute connected network you need to add that network under ospf process but interface is in "untrusted" network. In this case you need to redistribute connected but you configure the interface as passive.