It used to be even more so, but I'll tell you about that in a minute. Having a loopback interface is quite beneficial to OSPF. It is a workaround, but I tried it and it works, and is not much more disruptive than clear ip ospf 30 process (unless you mess up the order of steps, which I did first time I tried it - I removed the unwanted loopback before I saved, then wondered why it came back again, huh? - oh well, practice makes perfect).
#Loopback interface cisco how to
Thanks also for the tip about how to reset the RID. That is a useful fact to know, and helps me become more familiar with the behavior of the router, and the way the engineer's mind works.
#Loopback interface cisco full
I tried the show ip route 192.168.49.1, and as you say, it gives me the full OSPF information. In fact, by default, you can get the same effect by setting a /32 mask on the interface in the first place. I cannot think of any other good reason one would want to use more than a /32 on a loopback - perhaps there are others. Thanks once again for the full and comprehensive reply to my question.Īs you probably guessed, the loopback interface was /24 in order to generate O and IA routes for the lab exercise. This is a good trick to remember for the CCIE lab. The best way to change the RID is actually to get rid of the ospf process altogether and then to reconfigure in the following way:Įnter configuration commands, one per line. "show ip route 192.168.49.0" only shows you a summary of the more specific subnets. The subnet you are trying to display is a /32, so try "show ip route 192.168.49.1" instead if you want detail information. The behavior you get with "show ip route 192.168.49.0" is normal. You shouldn't do it though unless you have a good reason to do so. This is why you need to use "ip ospf network point-to-point" to change the default behavior. Note that the default ospf network type for the loopback interface is "loopback", which causes this behavior. In most cases, you do not need more than a host addresz on the loopback interface. The fact that a /32 is used on a loopback interface is only common sense. But it does not seem to agree with Jeff Doyle's book, bottom of page 524.Ĭould anyone comment on these observations? If I think it through, I guess I am not surprised you don't want the RIDs changing too often. Even if I clear ip ospf 30 process, the adjacencies get reset, but it still keeps the old RID.
If the RID is based on a loopback, say lo96 with address 192.168.96.1, then I destroy the lo96 interface and create a different one with a different address, the OSPF process does not even blink - it carries on being 192.168.96.1. Without the ip ospf network point-to-point in place, the route shows up on the adjacent router with no OSPF details: Route metric is 65, traffic share count is 1 Known via "ospf 20", distance 110, metric 65, type intra area With the ip ospf network point-to-point, the route shows up on an adjacent router, complete with its OSPF details:
I don't understand why the choice of that command the words command does not seem to reflect what it actually does.Īlso, I am puzzled by the way show ip route n.n.n.n behaves on an adjacent router for such a loopback.
To change this behavior, the command is ip ospf network point-to-point, then it gets advertised as /24. I can sort of see the logic to this: you might want to give all your routers host addresses in the same subnet. If you include a loopback interface in an OSPF process, it gets advertised as a stub host. Can someone explain to me the logic behind the way OSPF handles loopback interfaces? BTW, this is using 12.2(17a).