Skip to content

Instantly share code, notes, and snippets.

@erikmansson
Last active January 5, 2023 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikmansson/4508dbf81c7a58c66638fbed7e7484ff to your computer and use it in GitHub Desktop.
Save erikmansson/4508dbf81c7a58c66638fbed7e7484ff to your computer and use it in GitHub Desktop.
Simple Raspberry ethernet DHCP setup

Edit /etc/dhcpcd.conf

sudo nano /etc/dhcpcd.conf

Around line 44, uncomment (and possibly edit)

interface eth0
static ip_address=192.168.0.10/24

Install dnsmasq

sudo apt update
sudo apt install dnsmasq

Edit /etc/dnsmasq.conf

sudo nano /etc/dnsmasq.conf

Around line 106, uncomment and edit

interface=eth0

Around line 157, uncomment (and possibly edit)

dhcp-range=192.168.0.50,192.168.0.150,12h

Around line 340, uncomment

dhcp-option=3

To apply changes, reboot or restart dnsmasq

sudo systemctl restart dnsmasq.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment