IT 3110

DHCP

DHCP

Dynamic Host Configuration Protocol

What does it do?

DHCP components

  • Server - receives clients’ requests and replies to them.
  • Client - bundled with the operating system of a client computer or other IP capable device and which sends configuration requests to the server.
  • Relay agent - used in the case the dhcp request needs to travel to a different LAN (allows a single dhcp server to serve many LANS)

DHCP Procedure (DORA)

DHCP Details

  • Note that the initial discover is sent to the broadcast address of the network. What is this address? (255.255.255.255). ANY and ALL dhcp servers will respond. O = unicast, R=broadcast, A = unicast.
  • UDP port 67 (server), 68(client)
  • The client will accept the first offer it receives. (contains ip )

DHCP Details

  • Client responds (with another broadcast) that it will accept the proffered IP
  • Server stores that ip and responds with an ack... other dhcp servers will also receive that and realize client doens't want their address.
  • Client binds ip to nic after ack. Ack contains other stuff like (gateway, dns servers, lease time)

DHCP Lease renewal

  • Server expects client to respond at 50% of lease time, if that fails, it waits to 87.5% of lease time.
  • If the client fails to renew its lease after 87.5 percent of the lease has expired, the DHCP lease generation process starts over again, with a DHCP client broadcasting a DHCPDISCOVER.

DHCP Leases

Every time a client device restarts within the lease period, it contacts the configured default gateway. If the gateway does not respond, the client considers itself to be on a new subnet and enters the discovery phase.

Clients will redo DORA when they detect they are on a new network.

DHCP

  • Wireshark?

Types of Leases

  • Dynamic: hosts are not guaranteed any particular address within a range
  • Use case? Laptops, hosts that change frequently?
  • Static: what we have been doing. Assigned by the administrator. Maybe they edit, /etc/network/interfaces
  • Use case: servers, don't want them down if dhcp fails. Ip doesn't change
  • Fixed: Does not change. Admin configures the address on dhcp server. Host checks out (leases) from the dhcp server.
  • Use case: assigned by dhcp, addresses still don't change. Facilitates managin large number of clients without having to edit config files (lab environment)

DHCP and DNS

DNS expects known ip addresses. DHCP can cause IP addresses to change. How to make sure DNS records are the ones that DHCP has served out? DNS dynamic update: dhcp will make modifications to your DNS entries.

DHCP and IPV6

DHCP is used with IPv6... but it works a little differently.

Goal (your assignment may be different)

  • client1 and client 2 to become fixed clients.
  • Create new windows host to be dynamic client.

Errata

If you clone a vm (bionic) and get a dynamic dhcp address, you might have the same machines negotiating for the same address. Check the /etc/machine-id on each machine. if they are the same, you have a problem. To fix, you should delete that file and then run: sudo dbus-uuidgen --ensure=/etc/machine-id. Then sudo netplan apply. Then check to make sure that the machine-id's are unique.