NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

jameswalmsley's avatar
Apr 14, 2015

James' HOWTO: DHCP Server

Now that I'm the proud owner of an RN204, I thought I'd add a few guides on how to accomplish various useful features.
This guide assumes:


    1. You can login as root via SSH.
    2. You have an OS6 device.


So... DHCP server. (Seems that others didn't get this to work, but its relatively straight-forward).

1. Install isc-dhcp-server package.

apt-get install isc-dhcp-server


2. Configure DHCP server (/etc/dhcp/dhcpd.conf)

vi /etc/dhcp/dhcpd.conf



option domain-name "local";
allow-unknown-clients;

option domain-name-servers 10.0.0.2;

default-lease-time 86400;
max-lease-time 60480[code][/code]0;

authoritative;

subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.100 10.0.0.239;
option subnet-mask 255.255.255.0;
option routers 10.0.0.1;
option domain-name-servers 10.0.0.2;
option domain-name "local";
}


3. Setup a systemd service file... (/lib/systemd/system/isc-dhcp-server.service)

vi /lib/systemd/system/isc-dhcp-server.service



[Unit]
Description = DHCP server
After=readynasd.service

[Service]
ExecStart = /usr/sbin/dhcpd -q -d --no-pid -cf /etc/dhcp/dhcpd.conf

[Install]
WantedBy = multi-user.target



Most systemd files would use:


After=network.target


But I couldn't get this to work (i.e. no network connections would be found and then the daemon wouldn't work).
I figured waiting on readynasd would be a good bet as that requires pretty much everything else to be ready.

If anyone has more information about systemd or how to do this properly it would be appreciated.

4. Enable the systemd service with systemctl


systemctl enable isc-dhcp-server


5. Start/Stop/Status


systemctl start isc-dhcp-server
systemctl stop isc-dhcp-server
systemctl status isc-dhcp-server


Your new fully fledged dhcp server should now be running. It will also start on reboot.

Coming soon:


* Local dns server (caching) with DHCP hostname updating.
* OneDrive syncing.
* Much much more...


Hope I got everything right there, please let me know if you see any mistakes.

James

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More