Ubuntu DHCP Server
Исходная система:
1 2 3 4 5 6 |
lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial |
1. Установить пакет
1 |
apt install isc-dhcp-server |
2. Указать прослушиваемый интерфейс для DHCP сервиса
1 |
nano /etc/default/isc-dhcp-server |
значение:
1 |
INTERFACES="" |
меняем на:
1 |
INTERFACES="enp1s8" |
где enp1s8 интерфейс на котором раздавать dhcp
3. Настроить DHCP, привести к виду файл конфигурации
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
cat /etc/dhcp/dhcpd.conf | grep -v ^# | grep -v ^$ default-lease-time 600; max-lease-time 7200; log-facility local7; subnet 192.168.10.00 netmask 255.255.255.192 { range 192.168.10.21 192.168.10.62; option domain-name-servers 192.168.1.2, 192.168.1.3; option domain-name "specnix.org"; option subnet-mask 255.255.255.192; option routers 192.168.10.1; option broadcast-address 192.168.10.63; default-lease-time 600; max-lease-time 7200; } |
4. Сделать, то что забыл маинтейнер пакета
1 2 |
mkdir -p /var/db ln -s /var/lib/dhcp/dhcpd.leases /var/db/dhcpd.leases |
5. Перезапустить сервис
1 |
/etc/init.d/isc-dhcp-server restart |
6.1 Просмотреть статус сервиса
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
/etc/init.d/isc-dhcp-server status ● isc-dhcp-server.service - ISC DHCP IPv4 server Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2020-04-27 00:54:15 EDT; 9min ago Docs: man:dhcpd(8) Main PID: 29416 (dhcpd) Tasks: 1 Memory: 5.6M CPU: 31ms CGroup: /system.slice/isc-dhcp-server.service └─29416 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf enp1s8 Apr 27 00:56:54 srv-dhcp dhcpd[29416]: DHCPINFORM from 192.168.10.21 via enp1s8: not authoritative for subnet 192.168.10.0 Apr 27 00:57:00 srv-dhcp dhcpd[29416]: DHCPINFORM from 192.168.10.21 via enp1s8: not authoritative for subnet 192.168.10.0 Apr 27 01:01:45 srv-dhcp dhcpd[29416]: DHCPREQUEST for 192.168.10.22 from 00:99:88:FF:66:44 (420HD-009988FF6644) via enp1s8 Apr 27 01:01:45 srv-dhcp dhcpd[29416]: DHCPACK on 192.168.10.22 to 00:99:88:FF:66:44 (420HD-009988FF6644) via enp1s8 Apr 27 01:01:46 srv-dhcp dhcpd[29416]: DHCPINFORM from 192.168.10.22 via enp1s8: not authoritative for subnet 192.168.10.0 Apr 27 01:01:52 srv-dhcp dhcpd[29416]: DHCPINFORM from 192.168.10.22 via enp1s8: not authoritative for subnet 192.168.10.0 Apr 27 01:01:53 srv-dhcp dhcpd[29416]: DHCPREQUEST for 192.168.10.21 from 00:99:00:FF:99:66 (420HD-009900FF9966) via enp1s8 Apr 27 01:01:53 srv-dhcp dhcpd[29416]: DHCPACK on 192.168.10.21 to 00:99:00:FF:99:66 (420HD-009900FF9966) via enp1s8 Apr 27 01:01:54 srv-dhcp dhcpd[29416]: DHCPINFORM from 192.168.10.21 via enp1s8: not authoritative for subnet 192.168.10.0 Apr 27 01:02:00 srv-dhcp dhcpd[29416]: DHCPINFORM from 192.168.10.21 via enp1s8: not authoritative for subnet 192.168.10.0 |
6.2 Просмотреть лист раздачи IP-адресов
1 2 3 4 5 6 |
dhcp-lease-list To get manufacturer names please download http://standards.ieee.org/regauth/oui/oui.txt to /usr/local/etc/oui.txt MAC IP hostname valid until manufacturer =============================================================================================== 00:99:88:FF:66:44 192.168.10.22 420HD-009988FF66442020-04-27 12:10:23 -NA- 00:99:00:FF:99:66 192.168.10.21 420HD-009900FF99662020-04-27 12:11:58 -NA- |
Добавить комментарий