dhcpd.conf “Erros no arquivo de configuração encontrados”

3

Eu quero configurar o isc-dhcp-server, mas o arquivo dhcp.conf gera um erro durante o teste com 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";
}

A maior parte do arquivo é copy & colar a partir dos documentos, por isso não tenho ideia de onde o problema pode ser ...

    
por Darth-RPi 09.06.2017 / 23:26

1 resposta

0

Seu problema parece estar na linha interface enp30s0; . Como você se refere às opções numericamente, não acho que precise especificar a interface.

Da página de manual dhcpd.conf :

option routers 204.254.239.1;

Note that the address here is specified numerically. This is not required - if you have a different domain name for each interface on your router, it's perfectly legitimate to use the domain name for that interface instead of the numeric address. However, in many cases there may be only one domain name for all of a router's IP addresses, and it would not be appropriate to use that name here.

Eu fui recriando linha por linha seu dhcpd.conf com o arquivo de exemplo e foi isso que o quebrou.

Aqui está a minha versão de trabalho:

# cat /usr/share/doc/dhcp*/dhcpd.conf.sample
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#

# option definitions common to all supported networks...
option routers 192.168.100.1;
option domain-name-servers 192.168.178.1, 192.168.100.1;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

# This is a very basic subnet declaration.
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;
}

# Hosts which require special configuration options can be listed in
# host statements.   If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the 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";
}

Boa sorte!

    
por 10.06.2017 / 04:07

Tags