Step 4a. Advertising loopback interface¶
Goals¶
The goal of this step is to demonstrate how OSPF advertises loopback interfaces.
Loopback interfaces are virtual interfaces that are always up (unless administratively disabled). In OSPF, loopback interfaces are treated as stub networks and are advertised as host routes with a /32 netmask, regardless of the actual configured netmask. This behavior ensures that the loopback address is reachable as a specific host route, which is useful for management purposes and as a stable Router ID.
Configuration¶
This configuration is based on Step 4. R1 is configured with a second loopback interface (lo1), and the OSPF configuration includes this interface.
The configuration in omnetpp.ini is the following:
[Config Step4a]
description = "Advertising loopback interface"
network = RouterLSA
# Loopbacks are considered host routes in OSPF, and they are advertised as /32.
# advertising lo1 in router R1
*.configurator.config = xml("<config> \
<interface hosts='**' address='10.x.x.x' netmask='255.x.x.x'/> \
<route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
</config>")
*.R*.ospf.ospfConfig = xmldoc("ASConfig_Loopback.xml")
*.R1.numLoInterfaces = 2
# application parameters
*.host0.numApps = 1
*.host0.app[0].typename = "PingApp"
*.host0.app[0].destAddr = "host6"
*.host0.app[0].startTime = 60s
The OSPF configuration:
<?xml version="1.0"?>
<OSPFASConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="OSPF.xsd">
<Router name="R1" RFC1583Compatible="true">
<BroadcastInterface ifName="eth0" interfaceOutputCost='0' />
<BroadcastInterface ifName="eth1" interfaceOutputCost='0' />
<PointToPointInterface ifName="ppp0" interfaceOutputCost='0' />
<LoopbackInterface ifName="lo1" />
</Router>
<Router name="**" RFC1583Compatible="true">
<BroadcastInterface ifName='eth[*]' areaID='0.0.0.0' interfaceOutputCost='0' />
<PointToPointInterface ifName='ppp[*]' areaID='0.0.0.0' interfaceOutputCost='0' />
</Router>
</OSPFASConfig>
Results¶
R1’s Router LSA now includes an additional stub network link for the loopback interface lo1:
The link is advertised as a /32 host route (255.255.255.255 netmask).
The metric is typically 0 or a small value for loopback interfaces.
Other routers in the area receive R1’s Router LSA and install a /32 route to R1’s loopback address. This demonstrates that:
Loopback interfaces are always advertised as /32 regardless of configuration.
Loopback addresses provide stable, reachable IP addresses for router management.
Loopback interfaces are commonly used as the Router ID source in OSPF.
Sources:
omnetpp.ini,
RouterLSA.ned,
ASConfig_Loopback.xml
Discussion¶
Use this page in the GitHub issue tracker for commenting on this tutorial.