Интерфейс на котором запущен isc-dhcp-server

Автор torm84, 19 октября 2021, 08:42:28

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

torm84

Здравствуйте.

Подскажите, можно ли настроить DHCP сервер так, что бы он сам настраивал интерфейс на котором поднимается?

# cat /etc/network/interfaces:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

allow-hotplug enp1s0
iface enp1s0 inet dhcp


# cat /etc/network/interfaces
option domain-name "lan";
option domain-name-servers 172.16.0.2;

default-lease-time 600;
max-lease-time 7200;

ddns-updates on;
ddns-update-style interim;
include "/etc/dhcp/rndc.key";
zone lan. {
        primary 172.16.0.2;
        key rndc-key;
}
zone 0.16.172.in-addr.arpa. {
        primary 172.16.0.2;
        key rndc-key;
}

authoritative;

log-facility local7;

subnet 172.16.0.0 netmask 255.255.255.0 {
  range 172.16.0.3 172.16.0.254;
  option domain-name-servers 172.16.0.2;
  option domain-name "lan";
  option routers 172.16.0.1;
  option broadcast-address 172.16.0.255;
  default-lease-time 604800;
  max-lease-time 604800;
}

host hypervisor {
  hardware ethernet fe:54:00:c4:a1:0b;
  fixed-address 172.16.0.1;
}


# lournalctl -u isc-dhcp-server.service
окт 18 09:37:12 debian-dhcp systemd[1]: Starting LSB: DHCP server...
окт 18 09:37:12 debian-dhcp isc-dhcp-server[458]: Launching IPv4 server only.
окт 18 09:37:12 debian-dhcp dhcpd[464]: Internet Systems Consortium DHCP Server 4.4.1
окт 18 09:37:12 debian-dhcp dhcpd[464]: Copyright 2004-2018 Internet Systems Consortium.
окт 18 09:37:12 debian-dhcp dhcpd[464]: All rights reserved.
окт 18 09:37:12 debian-dhcp dhcpd[464]: For info, please visit https://www.isc.org/software/dhcp/
окт 18 09:37:12 debian-dhcp dhcpd[470]: Internet Systems Consortium DHCP Server 4.4.1
окт 18 09:37:12 debian-dhcp dhcpd[470]: Copyright 2004-2018 Internet Systems Consortium.
окт 18 09:37:12 debian-dhcp dhcpd[470]: All rights reserved.
окт 18 09:37:12 debian-dhcp dhcpd[470]: For info, please visit https://www.isc.org/software/dhcp/
окт 18 09:37:12 debian-dhcp dhcpd[470]: Wrote 0 deleted host decls to leases file.
окт 18 09:37:12 debian-dhcp dhcpd[470]: Wrote 0 new dynamic host decls to leases file.
окт 18 09:37:12 debian-dhcp dhcpd[470]: Wrote 4 leases to leases file.
окт 18 09:37:12 debian-dhcp dhcpd[470]:
окт 18 09:37:12 debian-dhcp dhcpd[470]: No subnet declaration for enp1s0 (no IPv4 addresses).
окт 18 09:37:12 debian-dhcp dhcpd[470]: ** Ignoring requests on enp1s0.  If this is not what
окт 18 09:37:12 debian-dhcp dhcpd[470]:    you want, please write a subnet declaration
окт 18 09:37:12 debian-dhcp dhcpd[470]:    in your dhcpd.conf file for the network segment
окт 18 09:37:12 debian-dhcp dhcpd[470]:    to which interface enp1s0 is attached. **
окт 18 09:37:12 debian-dhcp dhcpd[470]:
окт 18 09:37:12 debian-dhcp dhcpd[470]:
окт 18 09:37:12 debian-dhcp dhcpd[470]: Not configured to listen on any interfaces!
окт 18 09:37:12 debian-dhcp dhcpd[470]:
окт 18 09:37:12 debian-dhcp dhcpd[470]: If you think you have received this message due to a bug rather
окт 18 09:37:12 debian-dhcp dhcpd[470]: than a configuration issue please read the section on submitting
окт 18 09:37:12 debian-dhcp dhcpd[470]: bugs on either our web page at www.isc.org or in the README file
окт 18 09:37:12 debian-dhcp dhcpd[470]: before submitting a bug.  These pages explain the proper
окт 18 09:37:12 debian-dhcp dhcpd[470]: process and the information we find helpful for debugging.
окт 18 09:37:12 debian-dhcp dhcpd[470]:
окт 18 09:37:12 debian-dhcp dhcpd[470]: exiting.
окт 18 09:37:14 debian-dhcp isc-dhcp-server[458]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ...
окт 18 09:37:14 debian-dhcp isc-dhcp-server[475]:  failed!
окт 18 09:37:14 debian-dhcp isc-dhcp-server[476]:  failed!
окт 18 09:37:14 debian-dhcp systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
окт 18 09:37:14 debian-dhcp systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
окт 18 09:37:14 debian-dhcp systemd[1]: Failed to start LSB: DHCP server.


# cat /etc/default/isc-dhcp-server
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
DHCPDv4_PID=/var/run/dhcpd.pid
INTERFACESv4="enp1s0"
INTERFACESv6=""