2.5 Assigning IP Addresses

2.5 Assigning IP Addresses

Introduction

  • DHCP automatically assigns IP addresses, addressing the limitations of manual configuration, especially in large networks.

  • BootP (Bootstrap Protocol) was the precursor to DHCP but had limitations:

    • Didn't assign all necessary configuration settings.

    • Required some manual configurations.

    • Couldn't track when devices left the network to reuse IP addresses.

  • DHCP, introduced in 1997, overcomes these limitations by providing automatic configuration of IP addresses, subnet masks, default gateways, and more.

DHCP Operation (DORA Process)

The DHCP process consists of four steps, commonly referred to as DORA:

  1. Discover:

    • The client workstation broadcasts a request to locate a DHCP server on the local network.

    • The broadcast is sent to UDP port 67.

    • Routers typically don't forward broadcasts, but can be configured as DHCP proxies (also known as DHCP relays or IP helpers) to forward DHCP-related broadcasts to a DHCP server on another subnet.

  2. Offer:

    • DHCP servers that receive the discover message send offers back to the client workstation.

    • Offers are typically sent to a broadcast address over UDP port 68.

    • The client workstation receives one or more offers, each containing an IP address and other configuration parameters.

  3. Request:

    • The client workstation selects one of the offers and broadcasts a request to accept that particular offer.

    • The broadcast is sent over UDP port 67.

    • Although the broadcast is sent to all devices, only the DHCP server that made the chosen offer responds.

  4. Acknowledge:

    • The DHCP server sends an acknowledgment message to the client workstation over UDP port 68, confirming the IP address assignment and providing all necessary IP configuration settings.

DHCP Server Configuration

  • DHCP servers are configured with a pool of IP addresses to lease to clients.

  • The IP address a client receives may vary each time it connects to the network.

DHCP Reservations

  • For devices that require a static IP address (e.g., printers, servers), DHCP reservations can be configured.

  • A reservation associates a specific MAC address with a specific IP address.

  • Whenever the DHCP server sees a request from that MAC address, it always assigns the reserved IP address.

  • This is preferable to manually configuring static IP addresses on the devices themselves, as it centralizes IP address management.

Automatic Private IP Addressing (APIPA)

  • If a device is configured to use DHCP but cannot reach a DHCP server, it will be assigned an APIPA address.

  • APIPA addresses are also known as link-local addresses because they only allow communication within the local network.

  • The APIPA address range is 169.254.0.0169.254.0.0 through 169.254.255.255169.254.255.255.

  • The first and last 256 addresses of the APIPA range are reserved.

  • Usable APIPA addresses range from 169.254.0.0 through 169.254.255.255

  • A device assigns itself an APIPA address by:

    • Randomly selecting an IP address within the APIPA range.

    • Sending an ARP (Address Resolution Protocol) request to check if any other device is using that IP address.

    • If no response is received, the device assigns itself the IP address.

  • A device with an APIPA address cannot communicate outside of the local network, and the default gateway setting will be blank.

  • Running ipconfig /all will identify the IP4 address as an auto configuration address when a windows device has an APIPA address. The subnet mask will be set to 255.255.0.0255.255.0.0.