Raspberry Pi DHCP Server

Опубликовано: 08 Октябрь 2024
на канале: Tall Paul Tech
54,428
490

Setting up a Raspberry Pi as a DHCP server

sudo bash

Set static IP in file
/etc/dhcpcd.conf

static value
interface eth0
static ip_address=192.168.20.1/24
static routers=192.168.20.254
static domain_name_servers=8.8.8.8

Reboot the Raspberry Pi
reboot

Update and install server

apt-get update
apt-get install isc-dhcp-server -y

Edit DHCP server config file
/etc/dhcp/dhcpd.conf

subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.60 192.168.1.70;
option routers 192.168.20.254;
option domain-name-servers 8.8.8.8;
}

If you want the options for an Aruba AP, also add

option vendor-class-identifier "ArubaAP";
option vendor-encapsulated-options "192.168.1.200";

Start the server
dhcpd -cf /etc/dhcp/dhcpd.conf