> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siderolabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamic Addressing (DHCP)

> Learn how to configure dynamic addresses and routes on the link using DHCP.

export const VersionWarningBanner = () => {
  const latestVersion = "v1.13";
  const [latestUrl, setLatestUrl] = useState(null);
  const [currentVersion, setCurrentVersion] = useState(null);
  const [isBeta, setIsBeta] = useState(false);
  const parseVersion = v => v.replace("v", "").split(".").map(Number);
  const isGreaterVersion = (a, b) => {
    const [aMajor, aMinor] = parseVersion(a);
    const [bMajor, bMinor] = parseVersion(b);
    if (aMajor > bMajor) return true;
    if (aMajor === bMajor && aMinor > bMinor) return true;
    return false;
  };
  useEffect(() => {
    if (typeof window === "undefined") return;
    const {pathname, hash, search} = window.location;
    const match = pathname.match(/\/talos\/(v\d+\.\d+)\//);
    if (!match) return;
    const detectedVersion = match[1];
    if (detectedVersion === latestVersion) return;
    setCurrentVersion(detectedVersion);
    if (isGreaterVersion(detectedVersion, latestVersion)) {
      setIsBeta(true);
    }
    const newPath = pathname.replace(`/talos/${detectedVersion}/`, `/talos/${latestVersion}/`);
    setLatestUrl(`${newPath}${search}${hash}`);
  }, []);
  if (!latestUrl || !currentVersion) return null;
  return <div className="not-prose sticky top-6 z-50 my-6">
      <div className="border border-yellow-500/30 bg-yellow-500/10 px-4 py-3 rounded-xl">
        <div className="text-sm">
          {isBeta ? <>
              ⚠️ You are viewing a <strong>beta version</strong> of Talos ({currentVersion}).
              This version may be unstable.
              <a href={latestUrl} className="ml-2 underline text-yellow-400 hover:text-yellow-300 font-medium">
                View latest stable version {latestVersion} →
              </a>
            </> : <>
              ⚠️ You are viewing an older version of Talos ({currentVersion}).
              <a href={latestUrl} className="ml-2 underline text-yellow-400 hover:text-yellow-300 font-medium">
                View the latest version {latestVersion} →
              </a>
            </>}
        </div>
      </div>
    </div>;
};

<VersionWarningBanner />

Talos Linux runs by default a DHCP client on all physical network interfaces to obtain IP addresses and other network settings automatically.
Once any explicit link configuration is applied, the default DHCP behavior is disabled, and DHCP must be explicitly enabled on the desired link(s).

DHCP allows to configure addresses, routes, DNS, and NTP settings dynamically from a DHCP server.
DHCP client can be enabled on physical and logical links (bridges, bonds, VLANs).

There are two DHCP versions supported in Talos Linux: DHCPv4 and DHCPv6.

## DHCPv4 configuration

To enable DHCPv4 on a physical link, create a [DHCPv4Config](../../reference/configuration/network/dhcpv4config) configuration document with the name of the link:

```yaml theme={null}
apiVersion: v1alpha1
kind: DHCPv4Config
name: enp0s3
```

Additional settings can be configured:

* `ignoreHostname: true`: ignore the hostname provided by the DHCP server.
* `routeMetric: 512`: set the metric for routes provided by DHCP.
* `clientIdentifier`: configures the DHCP client identifier, which can have one of the following values:
  * `mac`: use the MAC address as the client identifier (default).
  * `duid`: use a DUID (DHCP Unique Identifier) as the client identifier, requires `duidRaw` field to be set.
  * `off`: disable the client identifier.

## DHCPv6 configuration

To enable DHCPv6 on a physical link, create a [DHCPv6Config](../../reference/configuration/network/dhcpv6config) configuration document with the name of the link:

```yaml theme={null}
apiVersion: v1alpha1
kind: DHCPv6Config
name: enp0s3
```

Additional settings are identical to DHCPv4.

## Observing status

Use `talosctl` to get the list of all configured operators (which includes DHCP clients):

```bash theme={null}
$ talosctl get operatorspecs
NODE         NAMESPACE   TYPE           ID             VERSION
172.20.0.2   network     OperatorSpec   dhcp4/enp0s2   1
```

To see operator configuration broken down by configuration source, add `--namespace=network-config` flag:

```bash theme={null}
$ talosctl get operatorspecs --namespace=network-config
NODE         NAMESPACE        TYPE           ID                           VERSION
172.20.0.2   network-config   OperatorSpec   configuration/dhcp4/enp0s2   1
```
