CentOS Stream 10
Sponsored Link

Kea DHCP : Configure Host Reservations2025/03/12

 

If you want to assign a specific IP address or host name to a specific host, configure it like follows.

[1] Configure Kea DHCP. This example shows only IPv4.
[root@dlp ~]#
vi /etc/kea/kea-dhcp4.conf
"subnet4": [
        {
            "id": 1,
            "subnet": "10.0.0.0/24",
            "pools": [ { "pool": "10.0.0.200 - 10.0.0.254" } ],
            "option-data": [
                {
                    "name": "routers",
                    "data": "10.0.0.1"
                }
            ],
            # add [reservations] section
            "reservations": [
                {
                    # host with the specified MAC address is assigned the specified IP
                    "hw-address": "00:0c:29:e5:f5:43",
                    "ip-address": "10.0.0.201"
                },
                {
                    # host with the specified client-id is assigned the specified IP and Hostname
                    # * to show client-id on client host
                    #   - nmcli c show enp1s0 | grep dhcp-client-id
                    # * to set client-id on client host
                    #   - nmcli c mod enp1s0 ipv4.dhcp-client-id (client id)
                    "client-id": "01:52:54:00:9d:05:35",
                    "ip-address": "10.0.0.202",
                    "hostname": "centos10"
                },
                {
                    # host with the specified client-id is assigned the specified IP and DNS reference
                    "client-id": "01:52:54:00:3c:1c:70",
                    "ip-address": "10.0.0.203",
                    "option-data": [ {
                        "name": "domain-name-servers",
                        "data": "10.0.0.11"
                    } ]
                },
            ]
.....
.....

[root@dlp ~]#
systemctl reload kea-dhcp4

Matched Content