> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/elastic-compute/networking/dhcp/02-how-it-works.md).

# How DHCP Works

The platform runs a distributed DHCP service on every compute node. An instance's DHCP requests are answered on its own node — they never cross the public network, and you don't need to run your own DHCP server.

![DHCP requests are answered on the instance's own compute node](https://3201622183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9X3FDdkCL2HzhbPpPMFt%2Fuploads%2Fgit-blob-4f04052a5370f47a0e0964698b58207490964572%2Fdhcp-how-it-works.svg?alt=media)

## Request Flow

1. The DHCP client inside the instance sends a DHCP request from a vNIC (a DHCPv6 request for IPv6).
2. The virtual switch on the compute node recognizes the request, hands it to the node's DHCP service, and tags which vNIC it came from.
3. The DHCP service looks up the vNIC's IP, the subnet gateway, the VPC MTU, and the DHCP options set associated with the subnet from the network control plane.
4. The DHCP service builds a reply and returns it to the instance, which then configures the vNIC.

## What DHCP Delivers

| Information                          | Source                                                    |
| ------------------------------------ | --------------------------------------------------------- |
| Private IPv4 address and subnet mask | The primary private IP assigned to the vNIC in its subnet |
| Default gateway                      | The gateway address of the subnet                         |
| DNS servers                          | The DHCP options set; platform-provided DNS if not set    |
| Lease time                           | The DHCP options set; 24 hours if not set                 |
| MTU                                  | The MTU setting of the Global VPC                         |
| IPv6 address, gateway, and DNS       | Delivered when the vNIC has an IPv6 address assigned      |

## High Availability

The DHCP service caches the most recent configuration of each vNIC locally. If the control plane times out, the service answers from the cache, so vNICs that already have an address renew as usual.

## IPv6

The platform uses router advertisements (RA) to tell instances to obtain addresses through DHCPv6. If no DHCPv6 client is enabled inside the instance, it can't obtain an IPv6 address automatically.
