This guide shows how to host a DHCP-Server on Debian, e.g. for a separate IP-Camera-Network:

  1. Set a static IP address on the interface where the DHCP should be running on later, therefore have a look here Set Static IP Address / Static route. (You may have to adjust the tutorial to your distribution).
  2. Then install isc-dhcp-server:
    sudo apt install isc-dhcp-server -y
  3. Now create a backup of the main config file:
    sudo mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak
  4. Then add/edit the following values and adjust then to your wished values:
    sudo nano /etc/dhcp/dhcpd.conf
    # Global options
    option domain-name "example.com";
    option domain-name-servers 8.8.8.8, 8.8.4.4;
     
    default-lease-time 600;
    max-lease-time 7200;
     
    # Use this to enable / disable dynamic dns updates globally.
    #ddns-update-style none;
     
    # If this DHCP server is the official DHCP server for the local
    # network, the authoritative directive should be uncommented.
    authoritative;
     
    # Subnet declaration
    subnet 192.168.1.0 netmask 255.255.255.0 {
      range 192.168.1.100 192.168.1.200;
      option routers 192.168.1.1;
      option broadcast-address 192.168.1.255;
    }
  5. Finally set the interface on which the server should listen, therefore change the INTERFACESvX in /etc/default/isc-dhcp-server. This can then look like:
    INTERFACESv4="eth1"

    And restart the server:

    sudo systemctl restart isc-dhcp-server

Sourced from: idroot.us - Set up DHCP Server

  • linux/linux-tutorials/host-dhcp-server.txt
  • Last modified: 2025/03/26 19:27
  • by Zyzonix