如何使用 ISC KEA DHCP 向我的 DHCPv4 客户端通知“DNS”和“网关”?

如何使用 ISC KEA DHCP 向我的 DHCPv4 客户端通知“DNS”和“网关”?

为了说明这一点,我将介绍 ISC KEA DHCP (DHCPv4) 和 DHCP 客户端的配置。以下是我当前用于 ISC KEA DHCP (DHCPv4) 的配置:

$ cat /usr/local/etc/kea/kea-dhcp4.conf

{
    "Dhcp4": {
        "interfaces-config": {
            "interfaces": ["enp0s17"]
        },
        "control-socket": {
            "socket-type": "unix",
            "socket-name": "/tmp/kea-dhcp4-ctrl.sock"
        },
        "lease-database": {
            "type": "memfile",
            "lfc-interval": 1800
        },
        "expired-leases-processing": {
            "reclaim-timer-wait-time": 10,
            "flush-reclaimed-timer-wait-time": 25,
            "hold-reclaimed-time": 3600,
            "max-reclaim-leases": 100,
            "max-reclaim-time": 250,
            "unwarned-reclaim-cycles": 5
        },
        "valid-lifetime": 4000,
        "renew-timer": 1000,
        "rebind-timer": 2000,
        "subnet4": [{
            "interface": "enp0s17",
            "subnet": "192.168.56.0/24",
            "pools": [{
                "pool": "192.168.56.3 - 192.168.56.254"
            }],
            "option-data": [{
                "name": "domain-name-servers",
                "data": "192.168.56.1"
            }, {
                "name": "routers",
                "data": "192.168.56.1"
            }]
        }]
    },
    "Logging": {
        "loggers": [{
            "name": "kea-dhcp4",
            "output_options": [{
                "output": "/usr/local/var/log/kea-dhcp4.log"
            }],
            "severity": "INFO",
            "debuglevel": 0
        }]
    }
}

这是我在客户端中的网络接口配置......

$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s17

BOOTPROTO=dhcp
DEVICE=enp0s17
IPV6INIT=NO
USERCTL=NO
ZONE=public

通过此配置 - 不使用 ISC KEA DHCP (DHCPv4) - 我的客户端可以完美运行。

$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s17

BOOTPROTO=static
DEVICE=enp0s17
DNS1=192.168.56.1
GATEWAY=192.168.56.1
IPADDR=192.168.56.100
IPV6INIT=NO
NETMASK=255.255.255.0
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
USERCTL=NO

我究竟做错了什么?

相关内容