我在 ubuntu 12.04 中启动 dhcp 服务器时遇到问题

我在 ubuntu 12.04 中启动 dhcp 服务器时遇到问题

以下是我的配置:

sudo apt-get install isc-dhcp-server
// The installation is successfull
nano /etc/network/interfaces
   auto eth0
   iface eth0 inet static
   address 192.168.21.2
   netmask 255.255.255.0
   network 192.168.21.0
   gateway 192.168.21.254
nano /etc/dhcp/dhcpd.conf
   authoritative;
   ddns-update-style none;
   default-lease-time 240;
   max-lease-time 380;
   subnet 192.168.21.0 netmask 255.255.255.0 {
   range 192.168.21.30 192.168.21.70
   option routers 192.168.21.1}

当我在“/etc/init.d”中写入“service isc-dhcp-server start”时,出现此错误:“start:作业启动失败”请帮帮我!!!!!

答案1

看起来您的子网声明中缺少分号。尝试:

/etc/dhcp/dhcpd.conf

authoritative;
ddns-update-style none;
default-lease-time 240;
max-lease-time 380;
subnet 192.168.21.0 netmask 255.255.255.0 {
  range 192.168.21.30 192.168.21.70;
  option routers 192.168.21.1;
}

相关内容