9

So I've got this task where I have to setup a virtual network with an OSPF routing protocol. I firstly ignored this loopback interface I had to configure on the routers since it didn't do any difference in this virtualization software called Cisco Packet Tracer (I thought). Then I've built the network in real life with some Cisco routers and it didn't do anything either. With or without this loopback the network worked (pinging from one host to another). Now my question is: Why is this loopback interface needed or what function does it do? In the picture below is the network I had to build (if it is any help).Network configuration

5

The loopback interface is useful because it is an interface with an IP address which never goes down. OSPF, without a specifically defined Router ID, will pick a Router ID on its own. It chooses the Router ID from the IP addresses of the configured and enabled interfaces. A loopback is a good choice since the loopback interface is always up unless someone specifically shuts it down. Other interfaces may go down if there is a problem on the link.

  • But what if the fa-Interface on Router E goes down? The loopback adress wouldn't be able to do anything since it's not connected to the network with OSPF anymore. Is the loopback interface useless in this case? – iPh1ps99 Sep 29 '15 at 16:03
  • 1
    When a router has a single interface, and that goes down, the router is useless anyway. With loopbacks configured, you can ping the loopbacks, and, if any interface into the router is up, you can get to the router without needing to know which interfaces are down or up. If the interface the Router E is down, it's just like the router itself is down. Having loopback interfaces up and participating in the routing protocol is a good thing. There are other uses such as being able to configure a single interface for sources which is guaranteed to be up if the router is on the network. – Ron Maupin Sep 29 '15 at 16:19
  • Ok with this comment you described everything I wanted to know! – iPh1ps99 Sep 29 '15 at 16:55
  • 2
    One of the biggest things a loopback does , is indeed bring stability to the routing protocol. Its unaffected by the state of underlying links, and hence doesnt flap, resulting in frequent reconvergence – ajaysdesk Sep 30 '15 at 2:50
4

First, loopbacks interfaces are mainly used when we want to establish adjacencies between 2 equipments (i.e. routers) and to be sure that when one link fails, the adjacency will not go down because, loopbacks interfaces are logical interfaces, and you can reach them by different ways.

Another use for this is to announce some networks. Networks can only be anounnced even if the existed in the routing table. I guess, in the above example, when you comment all the loopbacks interfaces, one use that can be done for this, is to announce some networks and see how OSPF can work, but, even if you use or not loopbacks interfaces, your configuration must work fine.

2

Adding to @Ron Maupin great answer I would further say that the (wise) choice of the router ID to be the loop back interface will be more "powerful" upon link failure scenarios. As others mentioned, every OSPF router chooses a router ID. This ID is chosen among ALL available interfaces on a given router UNLESS explicitly configured otherwise. So, on any link failure for a specific router - if the logic of the router ID selection is still set on the "highest IP address" and there is no loopback address configured as well in the OSPF process (or there is no loopback address in the router at all) - then this link failure will trigger a new router ID selection procedure "within" the router and, perhaps more importantly, will obligate this router to advertise its "newly elected" router ID, meaning send OSPF messages again onto the network.

On the other hand, if the router ID was set "deterministically" by configuring it to be the loopback address (or if there is any loopback address in the OSPF process), that will never go down (unless of course, the entire router/OSPF process will go down), then if any one of the interfaces of the router goes down, the router ID won't be affected, therfor no multicast OSPF "new router ID" messages will be sent onto the network.

Considering the above topology, in case router E (or more precisely its only interface) goes down, then anyway, when it will go up again it will still advertise its router ID "all over again". But (!!) if any other router (A, B, C or D) will have one (or more) of its interface(s) down, then if the router ID was not "set deterministically" - new advertisement will have to be sent onto the network, which will affected the overall bandwidth of it. And this is the case where loopback address for router ID in OSPF is beneficial.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.