Search code examples
omnet++inet

How to assign an IP address to a dynamic node in OMNeT++?


I have created a dynamic node successfully, but the Ipv4Configurator did not assign an IP address to this new node. How can I assign an IP address to the wlan interface of this node?

Thank you


Solution

  • Take a look at examples/adhoc/hostautoconf. That example deals exactly with your problem. The HostAutoConfigurator module states:

    HostAutoConfigurator automatically assigns IP addresses and sets up routing table. It has to be added into each host.

    This configurator is deprecated. Please use IPv4NetworkConfigurator whenever it is possible. This module is kept only because the IPv4NetworkConfigurator cannot assign IP addresses to modules that are dynamically created/destroyed.