Route to a remote Loopback Interface (BGP/OSPF)

Hi folks,

Could you please explain me this routing table?

Italy#sh ip ro | i 192.74.31
     192.74.31.0/24 is variably subnetted, 2 subnets, 2 masks
O       192.74.31.1/32 [110/2] via 192.74.27.1, 02:02:33, FastEthernet0/1
B       192.74.31.0/24 [200/0] via 192.74.31.1, 11:06:23

I work in a BGP Course, where BGP network command is used for loopback interfaces.
Why I have these two entries?

Cheers, Hannes

Hello Johann

OSPF will always advertise networks on loopback interfaces as /32 networks, even if you have configured a different subnet mask. BGP on the other hand will advertise based on the network command you use. So apparently here, OSPF is advertising 192.74.31.1 as a /32 address, while BGP is advertising the whole /24 subnet. Since these are different, they are both added in the routing table.

More information about how OSPF advertises loopback addresses can be found in this NetworkLessons note on the topic.

I hope this has been helpful!

Laz

1 Like