askvity

How does auto IP work?

Published in Networking Basics 3 mins read

Auto IP (Automatic Private IP Addressing) enables devices to configure themselves with an IP address in the absence of a DHCP server. Here's how it functions:

Auto IP Explained

A device configured for Auto IP attempts to obtain an IP address from a DHCP server first. According to the reference, a networked device configured to use Auto IP first makes a request to a DHCP server for an address. If it fails to receive a response, it proceeds to automatically assign itself an IP address.

Steps Involved in Auto IP Address Assignment

Here's a detailed breakdown of the process:

  1. DHCP Request: The device broadcasts a DHCP Discover message to locate any available DHCP servers on the network.

  2. DHCP Offer (Expected): If a DHCP server is present and responsive, it will offer an IP address, subnet mask, and other network configuration details to the device.

  3. DHCP Offer (Not Received): If the device doesn't receive a DHCP offer within a specified timeframe (meaning there's no DHCP server or the server is unresponsive), it initiates the Auto IP process.

  4. Address Selection: The device selects an IP address from the Automatic Private IP Addressing (APIPA) range, which is 169.254.0.1 to 169.254.255.254. The subnet mask defaults to 255.255.0.0.

    • The device typically chooses an address randomly within this range to minimize the chance of conflicts.
  5. Address Conflict Resolution: Before using the selected IP address, the device sends an ARP (Address Resolution Protocol) probe to check if any other device on the network is already using the same address.

    • If a conflict is detected (another device responds to the ARP probe), the device selects a different random address and repeats the conflict resolution process.
    • This process continues until a unique IP address is found or the device gives up.
  6. Configuration: Once a unique IP address is identified, the device configures its network interface with the chosen IP address and the default subnet mask.

Example Scenario

Imagine a small home network with a computer, a printer, and a router. If the router (acting as the DHCP server) malfunctions:

  • The computer and printer, set to obtain IP addresses automatically, won't receive any IP addresses from the router.
  • They will then automatically assign themselves IP addresses in the 169.254.x.x range.
  • This allows them to communicate with each other (e.g., the computer can still print), but they won't be able to access the internet until the router's DHCP service is restored or a static IP is manually configured.

Limitations of Auto IP

  • Limited Network Access: Devices using Auto IP can only communicate with other devices on the same local network that are also using Auto IP or have manually configured IP addresses within the same subnet.

  • No Internet Access: Auto IP does not provide a default gateway, so devices cannot access the internet.

  • Temporary Solution: Auto IP is intended as a temporary solution when a DHCP server is unavailable. It is not a replacement for a properly configured DHCP server.

Related Articles