Exploring how instances get their addresses
When DHCP is enabled on a subnet, a dnsmasq
process is spawned in a network namespace whose name corresponds to the network UUID. In the event that a process already exists, the dnsmasq
process is updated to support the additional subnet in the network.
Most instances rely on DHCP to obtain their associated IP address. DHCP goes through the following stages:
A DHCP client sends a
DHCPDISCOVERY
packet using a broadcast address. This is usually 255.255.255.255.A DHCP server responds to the request with a
DHCPOFFER
packet. The packet contains the MAC address of the instance that makes the request, the IP address, the subnet mask, lease duration, and the IP address of the DHCP server.In response to the offer, the DHCP client sends a
DHCPREQUEST
packet back to the DHCP server, requesting the offered address. Clients can receive multiple offers but will only accept one offer.In response to the request, the DHCP server will issue a
DHCPACK
packet or acknowledgement...