I've set up a standard ISC DHCP server on my Pi4 running 5.10.52-v7l+ of Pi OS. I'd initially had my static IP set in my /etc/network/interfaces file and that worked ok but I couldn't get WiFi working and while researching the problem I read in multiple places that I should not be editing /etc/network/interfaces and should instead use /etc/dhcpcd.conf - which I did as follows:
interface eth0
static ip_address=192.168.1.39/24
static routers=192.168.1.254
static domain_name_servers=192.168.1.254 8.8.8.8
interface wlan0
static ip_address=192.168.1.251/24
static routers=192.168.1.254
static domain_name_servers=192.168.1.254 8.8.8.8
However when I reboot isc-dhcp-server.service fails to antomatically start giving the following error:
pi@Pi4:~ $ sudo systemctl status isc-dhcp-server.service
* isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
Active: failed (Result: exit-code) since Sun 2021-11-28 18:20:53 GMT; 4min 12s ago
Docs: man:systemd-sysv-generator(8)
Process: 524 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
Nov 28 18:20:51 Pi4 dhcpd[769]: bugs on either our web page at www.isc.org or in the README file
Nov 28 18:20:51 Pi4 dhcpd[769]: before submitting a bug. These pages explain the proper
Nov 28 18:20:51 Pi4 dhcpd[769]: process and the information we find helpful for debugging.
Nov 28 18:20:51 Pi4 dhcpd[769]:
Nov 28 18:20:51 Pi4 dhcpd[769]: exiting.
Nov 28 18:20:53 Pi4 isc-dhcp-server[524]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
Nov 28 18:20:53 Pi4 isc-dhcp-server[524]: failed!
Nov 28 18:20:53 Pi4 systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
Nov 28 18:20:53 Pi4 systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Nov 28 18:20:53 Pi4 systemd[1]: Failed to start LSB: DHCP server.
A quick sudo systemctl restart isc-dhcp-server.service
sorts it out.
My /etc/default/isc-dhcp-server file looks like this:
INTERFACESv6=""
INTERFACESv4="eth0"
So only listening on the ethernet port
My question - If I'm running ISC dhcp server, where/how should I be setting my static IP? Thanks I