inet-framework / inet

INET Framework for the OMNeT++ discrete event simulator
https://inet.omnetpp.org
Other
437 stars 485 forks source link

Changing the IPv4 address of a loopback interface #386

Open ManiAm opened 6 years ago

ManiAm commented 6 years ago

I am having trouble changing the ipv4 address of a loopback interface. Please take a look at Step23 in OSPF examples in here:

https://github.com/ManiAm/inet/blob/INETex/examples_INETex/routing_protocol_ospf/omnetpp.ini

Apparently changing the loopback address has no effect. Going through the configurator code, I noticed that the configurator iterates over topology.linkInfos and since there is no links attached to the loopback interface, it misses it.

https://github.com/inet-framework/inet/blob/b02af3321836f33c1e9e81313cc607eda8697423/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc#L623

levy commented 6 years ago

Indeed, the NetworkConfiguratorBase class uses isLoopback() function throughout the code to avoid configuring loopback interfaces.

ManiAm commented 5 years ago

If we could up-vote features, then I would up-vote this one. This is very useful in routing (ospf, BGP, etc.) scenarios when you want to test the propagation of a route into the network.