Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

3. Setup dhcp server

quintus edited this page Jan 16, 2021 · 1 revision

coming soon

  1. Install isc-dhcp-server
$ sudo apt install isc-dhcp-server
  1. What interfaces should the DHCP server (dhcpd) serve DHCP requests
$ sudo ip link
$ sudo vi /etc/default/isc-dhcp-server
INTERFACESv4="enp1s0"
INTERFACESv6="enp1s0"
  1. Config dhcp pool: 192.168.1.50~192.168.1.200, gateway & dns server:192.168.1.254 (Armbian itself)
$ sudo vi /etc/dhcp/dhcpd.conf

subnet 192.168.1.0 netmask 255.255.255.0 {
 range 192.168.1.50 192.168.1.200;
 option routers 192.168.1.254;
 option subnet-mask 255.255.255.0;
 option broadcast-address 192.168.1.255;
 option domain-name-servers 192.168.1.254;
 option netbios-name-servers 192.168.1.254;
 option netbios-node-type 8;
}
  1. restart isc-dhcp-server service
$ sudo systemctl restart isc-dhcp-server
root@nanopi-r4s:/etc/dhcp# systemctl status isc-dhcp-server
● 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 Fri 2021-01-15 11:34:21 CST; 6s ago
       Docs: man:dhcpd(8)
   Main PID: 47475 (dhcpd)
      Tasks: 4 (limit: 4382)
     Memory: 4.4M
     CGroup: /system.slice/isc-dhcp-server.service
             └─47475 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/d>

Jan 15 11:34:21 nanopi-r4s dhcpd[47475]:    in your dhcpd.conf file for the network segment
Jan 15 11:34:21 nanopi-r4s dhcpd[47475]:    to which interface eth1 is attached. **
Jan 15 11:34:21 nanopi-r4s dhcpd[47475]:
Jan 15 11:34:21 nanopi-r4s dhcpd[47475]: Listening on LPF/enp1s0/1a:fe:55:80:6a:b8/192.168.1.0/24
Jan 15 11:34:21 nanopi-r4s dhcpd[47475]: Sending on   LPF/enp1s0/1a:fe:55:80:6a:b8/192.168.1.0/24
Jan 15 11:34:21 nanopi-r4s sh[47475]: Listening on LPF/enp1s0/1a:fe:55:80:6a:b8/192.168.1.0/24
Jan 15 11:34:21 nanopi-r4s sh[47475]: Sending on   LPF/enp1s0/1a:fe:55:80:6a:b8/192.168.1.0/24
Jan 15 11:34:21 nanopi-r4s sh[47475]: Sending on   Socket/fallback/fallback-net
Jan 15 11:34:21 nanopi-r4s dhcpd[47475]: Sending on   Socket/fallback/fallback-net
Jan 15 11:34:21 nanopi-r4s dhcpd[47475]: Server starting service.
lines 1-20/20 (END)
Clone this wiki locally