DHCP MAC保留+DHCP同时

DHCP MAC保留+DHCP同时

我想使用此配置为我的 IP 电话进行 DHCP 保留,但现在的问题是,我无法使用 DHCP 动态分配地址给其他设备,而且我不知道如何同时使这两项工作。

dhcpd: DHCPDISCOVER from ff:ff:ff:ff:ff:ff via eth0 network 10.10.10.0/24 no free leases

dhcp 配置

    option domain-name "";
    option domain-name-servers 10.10.10.1;
    option tftp-server-name "10.10.10.1";
    default-lease-time 28800;
    max-lease-time 43200;

    subnet 10.10.10.0 netmask 255.255.255.0 {
           option routers 10.10.10.1;
    }

    host iptel1 {
        hardware ethernet ff:ff:ff:ff:ff:ff;
        fixed-address 10.10.10.11;
    }

    host iptel2 {
        hardware ethernet ff:ff:ff:ff:ff:ff;
        fixed-address 10.10.10.12;
    }

    host iptel3 {
        hardware ethernet ff:ff:ff:ff:ff:ff;
        fixed-address 10.10.10.13;
    }

    host iptel4 {
        hardware ethernet ff:ff:ff:ff:ff:ff;
        fixed-address 10.10.10.14;
    }

    host iptel5 {
        hardware ethernet ff:ff:ff:ff:ff:ff;
        fixed-address 10.10.10.15;
    }
    host iptel6 {
        hardware ethernet ff:ff:ff:ff:ff:ff;
        fixed-address 10.10.10.16;
    }

谢谢您的任何建议。

答案1

编辑

sudo nano /etc/dhcp3/dhcpd.conf

尝试使用此配置示例

subnet 192.168.100.0 netmask 255.255.255.0 {
  option domain-name "domain.net";
  option broadcast-address 192.168.100.255;
  option routers 192.168.100.1;
  option domain-name-servers 192.168.100.1, 8.8.8.8;

  # Define the scopes for this DHCP pool

  pool {
   range 192.168.100.2 192.168.100.200;
   # static reserve = 192.168.100.201 - 192.168.100.254
  }
  host static-custid {
   hardware ethernet 00:01:02:03:04:05;
   fixed-address 192.168.100.205;
  }
  host static-custid {
   hardware ethernet 00:01:02:03:04:06;
   fixed address 192.168.100.206;
  }
}

注意:您的dhcp池来自192.168.100.2 192.168.100.200,您的网络掩码是255.255.255.0您的路由器上的地址192.168.100.1。DHCP 服务器将始终为主机分配具有 mac 地址的00:01:02:03:04:05ip 192.168.100.205,具有 mac 00:01:02:03:04:06ip 192.168.100.206。但是,如果主机具有 mac,00:01:02:03:04:08服务器将从池中分配下一个空闲 ip 地址。

PS 更改配置后,重新启动 dhcp 服务器。

相关内容