lwIP Wiki

Like DHCP, AUTOIP is a module that enables dynamic IPv4 addresses to be assigned to a device on startup. However, DHCP requires a DHCP server. AUTOIP is a server-less method of choosing an IP address.

A host configured with AUTOIP will get an address with a 169.254/16 prefix (that is, 169.254.xxx.xxx).

AUTOIP from an application perspective[]

To enable AUTOIP, you must make sure to compile in AUTOIP. You can do this by defining the LWIP_AUTOIP option in lwipopts.h and be sure that the module gets initialized (see Initializing lwIP for the right way to initialize modules for your platform).

To use AUTOIP on an interface, simply use the following commands:

  • autoip_start() - bring the interface up with a new IP address.
  • autoip_stop() - bring the interface down.

For an explanation of "up" and "down" interfaces, see the section Network interfaces management.

Note: These functions are lwIP core functions. They are not protected against concurrent access. In multithreaded environments, they may be called from the core thread only (aka. the tcpip-thread). When calling from other threads, use the netifapi_autoip_*() functions defined in the api-module netifapi.c.

AUTOIP support history in lwIP[]

HEAD Brand new!

External references[]

  • RFC 3927 - Dynamic Configuration of IPv4 Link-Local Addresses

See also[]