I want to set up the isc-dhcp-server, but the dhcp.conf file generates an error while testing with dhcpd -t
:
...
/etc/dhcp/dhcpd.conf line 6: expecting a parameter or declaration
authoritative;
^
Configuration file errors encountered -- exiting
...
cat /etc/dhcp/dhcpd.conf
:
# Configuration file for the ISC-DHCP Server 4.3.3
# Default sample file at /etc/dhcp/dhcpd.sample.conf
# global statements:
authoritative;
interface enp30s0;
option routers 192.168.100.1;
option domain-name-servers 192.168.178.1, 192.168.100.1;
subnet 192.168.100.0 netmask 255.255.255.0{
range 192.168.100.10 192.168.100.110;
default-lease-time 600;
max-lease-time 7200;
}
# host declaration
host server {
hardware ethernet 1c:c1:de:80:76:e8;
fixed-address 192.168.100.10;
option host-name "server";
}
host pc {
hardware ethernet 1C:1B:0D:10:44:71;
fixed-address 192.168.100.11;
option host-name "PC";
}
Most of the file is copy & paste from the docs, so I have no idea where the issue can be…
Best Answer
Your issue seems to lie with the
interface enp30s0;
line. Since you refer to the options numerically, I don't think you need to specify the interface.From the
dhcpd.conf
man page:I went line by line recreating your
dhcpd.conf
with the example file and that is what broke it.Here is my working version:
Good luck!