blee0518
Posts: 23
Joined: Tue Mar 10, 2020 2:18 am

Setup DHCP server / fails to restart issue, Raspbian buster

Tue Mar 24, 2020 8:01 pm

[SOLVED]
Thank you to Kerry who saved the day with this awesome recommendation. Why this DHCP server isnt a hit when searching on this forum I do not know.

Do not waste you life as I did with broken software from ISC!!!

Go with Pi-hole Click the name to go to install page.
Or go to there website. https://Pi-hole.net

Config has been updated to show all proper settings for this setup.
Open to suggestions with iptable and ufw settings!

I have been at it all day.
When I boot up the RPi4 everything seems to work.
clients get IP and can get out.
As soon as I try to restart the dhcp server, it fails.

Code: Select all

ifconfig 
eth0 = 10.10.100.1/24
wlan0 = 192.168.0.109/24
*wlan0 is serving as my test wan*

DHCP host machine has no issues with internet or DNS

RESULTS I KEEP GETTING ON RESTART

Code: Select all

-- A start job for unit isc-dhcp-server.service has begun execution.
-- 
-- The job identifier is 1316.
Mar 24 12:52:35 raspberrypi isc-dhcp-server[2207]: Launching IPv4 server only.
Mar 24 12:52:35 raspberrypi dhcpd[2220]: Wrote 0 deleted host decls to leases fi
Mar 24 12:52:35 raspberrypi dhcpd[2220]: Wrote 0 new dynamic host decls to lease
Mar 24 12:52:35 raspberrypi dhcpd[2220]: Wrote 1 leases to leases file.
Mar 24 12:52:35 raspberrypi dhcpd[2220]: 
Mar 24 12:52:35 raspberrypi dhcpd[2220]: No subnet declaration for eth0 (no IPv4
Mar 24 12:52:35 raspberrypi dhcpd[2220]: ** Ignoring requests on eth0.  If this 
Mar 24 12:52:35 raspberrypi dhcpd[2220]:    you want, please write a subnet decl
Mar 24 12:52:35 raspberrypi dhcpd[2220]:    in your dhcpd.conf file for the netw
Mar 24 12:52:35 raspberrypi dhcpd[2220]:    to which interface eth0 is attached.
Mar 24 12:52:35 raspberrypi dhcpd[2220]: 
Mar 24 12:52:35 raspberrypi dhcpd[2220]: 
Mar 24 12:52:35 raspberrypi dhcpd[2220]: Not configured to listen on any interfa
Mar 24 12:52:35 raspberrypi dhcpd[2220]: 
Mar 24 12:52:35 raspberrypi dhcpd[2220]: If you think you have received this mes
Mar 24 12:52:35 raspberrypi dhcpd[2220]: than a configuration issue please read 
Mar 24 12:52:35 raspberrypi dhcpd[2220]: bugs on either our web page at www.isc.
Mar 24 12:52:35 raspberrypi dhcpd[2220]: before submitting a bug.  These pages e
Mar 24 12:52:35 raspberrypi dhcpd[2220]: process and the information we find hel
Mar 24 12:52:35 raspberrypi dhcpd[2220]: 
Mar 24 12:52:35 raspberrypi dhcpd[2220]: exiting.
Mar 24 12:52:37 raspberrypi isc-dhcp-server[2207]: Starting ISC DHCPv4 server: d
Mar 24 12:52:37 raspberrypi isc-dhcp-server[2207]:  failed!
Mar 24 12:52:37 raspberrypi systemd[1]: isc-dhcp-server.service: Control process
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit isc-dhcp-server.service has exited.
-- 
Raspbian buster (latest)
isc-dhcp-server/stable,now 4.4.1-2 armhf

/etc/default/isc-dhcp-server

Code: Select all

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="eth0"
#INTERFACESv6=""
/etc/dhcp/dhcpd.conf

Code: Select all

option domain-name "house.lan";
#option domain-name-servers ns1.house.lan, ns2.house.lan;

default-lease-time 600;
max-lease-time 7200;

ddns-update-style none;

authoritative;

subnet 10.10.100.0 netmask 255.255.255.0{
  range 10.10.100.100 10.10.100.200;
  option domain-name-servers 10.10.100.1;
  option routers 10.10.100.1;
}
/etc/dhcpcd.conf
*file is default except these 2 lines

Code: Select all

# Example static IP configuration:

interface eth0
static ip_address=10.10.100.1/24
/etc/sysctl.conf

Code: Select all

# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
/etc/rc.local

Code: Select all

#--out-interface "wlan0" is for testing
/sbin/iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
/sbin/iptables --append FORWARD --in-interface eth0 -j ACCEPT

# Print the IP address

#_IP=$(hostname -I) || true
#if [ "$_IP" ]; then
#  printf "My IP address is %s\n" "$_IP"
#fi


#exit 0

Code: Select all

[email protected]:/home/pi# ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
443                        ALLOW       Anywhere                  
22/tcp                     LIMIT       Anywhere                  
22/tcp (v6)                LIMIT       Anywhere (v6)    

Code: Select all

/etc/fail2ban/jail.local
[ssh]
enabled  = true
port     = ssh
logpath  = /var/log/auth.log
maxretry = 6
Literally wet to get a drink and came back, ran systemctl restart isc-dhcp-server and it worked.
clients get out to internet but no DNS resolve.
Any help with this would be appreciated.
leaving this here for others and to show my RPi4 hates me. :shock:
Last edited by blee0518 on Wed Mar 25, 2020 4:47 am, edited 8 times in total.

blee0518
Posts: 23
Joined: Tue Mar 10, 2020 2:18 am

Re: Setup DHCP server / fails to restart Raspbian buster

Tue Mar 24, 2020 8:15 pm

I guess all it takes is posting about my RPi for it to start acting right.

I also found were I messed up on DNS

Code: Select all

option domain-name "house.lan";
option domain-name-servers ns1.house.lan, ns2.house.lan;      
^ second line needed to commented out, should look like this.

Code: Select all

option domain-name "house.lan";
#option domain-name-servers ns1.house.lan, ns2.house.lan;

blee0518
Posts: 23
Joined: Tue Mar 10, 2020 2:18 am

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 3:37 am

Im at a lose of words.
After running upgrades its broke again.

Code: Select all

No subnet declaration for eth0 (no IPv4 addresses).
 ** Ignoring requests on eth0.  If this is not what
    you want, please write a subnet declaration
    in your dhcpd.conf file for the network segment
    to which interface eth0 is attached. **
    
    
Nothing was changed what the heck!!!
why did things need to be touched, the old system worked fine?
referring to dev changing how dhcp operated no the upgrades.

kerry_s
Posts: 240
Joined: Thu Jan 30, 2020 7:14 pm

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 4:08 am

have you tried using pihole?
you get dhcp, dns and you can chose what you want to or not want to block.
Attachments
Screenshot from 2020-03-24 18-03-01.resized.png
Screenshot from 2020-03-24 18-03-01.resized.png (79.58 KiB) Viewed 269 times
Screenshot from 2020-03-24 18-03-44.resized.png
Screenshot from 2020-03-24 18-03-44.resized.png (147.74 KiB) Viewed 269 times
Screenshot from 2020-03-24 18-03-31.resized.png
Screenshot from 2020-03-24 18-03-31.resized.png (108.07 KiB) Viewed 269 times

kerry_s
Posts: 240
Joined: Thu Jan 30, 2020 7:14 pm

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 4:09 am

dang attachment limit.
Attachments
Screenshot from 2020-03-24 18-03-57.resized.png
Screenshot from 2020-03-24 18-03-57.resized.png (80.01 KiB) Viewed 269 times
Screenshot from 2020-03-24 18-03-17.resized.png
Screenshot from 2020-03-24 18-03-17.resized.png (81.44 KiB) Viewed 269 times

blee0518
Posts: 23
Joined: Tue Mar 10, 2020 2:18 am

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 4:39 am

kerry_s wrote:
Wed Mar 25, 2020 4:09 am
dang attachment limit.
OMG!!
Where do I send the beer ?!?!


...I wish i could get 8 hours of my life back.

blee0518
Posts: 23
Joined: Tue Mar 10, 2020 2:18 am

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 5:04 am

kerry_s wrote:
Wed Mar 25, 2020 4:09 am
dang attachment limit.
Do you have any suggestions for Firewall?

kerry_s
Posts: 240
Joined: Thu Jan 30, 2020 7:14 pm

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 5:20 am

blee0518 wrote:
Wed Mar 25, 2020 5:04 am
kerry_s wrote:
Wed Mar 25, 2020 4:09 am
dang attachment limit.
Do you have any suggestions for Firewall?
no need, that's what the blocking is for. and there are logs you can check.
https://docs.pi-hole.net/ftldns/regex/tutorial/

i go here to try expressions
https://regexper.com/

but it's as simple as you want to make it, a lot of people use a long list.
i'm more of a simple setup.

blee0518
Posts: 23
Joined: Tue Mar 10, 2020 2:18 am

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 7:27 pm

kerry_s wrote:
Wed Mar 25, 2020 5:20 am
blee0518 wrote:
Wed Mar 25, 2020 5:04 am
kerry_s wrote:
Wed Mar 25, 2020 4:09 am
dang attachment limit.
Do you have any suggestions for Firewall?
no need, that's what the blocking is for. and there are logs you can check.
https://docs.pi-hole.net/ftldns/regex/tutorial/

i go here to try expressions
https://regexper.com/

but it's as simple as you want to make it, a lot of people use a long list.
i'm more of a simple setup.
In a pickle, pi-hole will not lease IP address to clients . please help

kerry_s
Posts: 240
Joined: Thu Jan 30, 2020 7:14 pm

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 7:41 pm

have you pointed your clients to the pi-hole?

android example:
in wifi settings, select modify settings, advanced options, then change dhcp to static, select a ip from the range you set in pihole dhcp( i use 192.168.5.100 -> 192.168.5.251) 192.168.5.101, gateway will be the pi-hole(192.168.5.1 in my case), dns will be the pi-hole 192.168.5.1, dns 2 can be what ever you want, i use adguard 176.103.130.130

blee0518
Posts: 23
Joined: Tue Mar 10, 2020 2:18 am

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 9:36 pm

kerry_s wrote:
Wed Mar 25, 2020 7:41 pm
have you pointed your clients to the pi-hole?

android example:
in wifi settings, select modify settings, advanced options, then change dhcp to static, select a ip from the range you set in pihole dhcp( i use 192.168.5.100 -> 192.168.5.251) 192.168.5.101, gateway will be the pi-hole(192.168.5.1 in my case), dns will be the pi-hole 192.168.5.1, dns 2 can be what ever you want, i use adguard 176.103.130.130
whats the point of dhcp if it doesnt auto assign this information?

I have been able to set a static address with 8.8.8.8 for dns. I can ping out but DNS does not work.
Host machine `/etc/resolv.conf` has `nameserver 127.0.0.1` of course this information is auto set but " i guess pihole".

kerry_s
Posts: 240
Joined: Thu Jan 30, 2020 7:14 pm

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Wed Mar 25, 2020 9:43 pm

do you have a router you can set to point at your pihole?
that's how devices get auto configured on my setup.

are you still using the setup with the messed up settings or a fresh install?

bls
Posts: 443
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA
Contact: Twitter

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Thu Mar 26, 2020 12:11 am

pihole is a great solution if you want an all-in-one, easy-to-use. But, I've been running dhcpd and ISC Bind for 20 years across x86 and now Pi systems on my network, and have never had a big issue. I have all my devices set to ask for a dhcp address, and they all get a statically-assigned address from the dhcp server.

The config files are admittedly an annoyance, which spurred me to build a python script to manage the config files. Makes changing to a different dhcp or dns server a bit more difficult programming project. :lol:

kerry_s
Posts: 240
Joined: Thu Jan 30, 2020 7:14 pm

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Thu Mar 26, 2020 12:57 am

it's good to use what you know.

i run my pi-hole on a rpi zero w and it also holds file/folders so i can access on the network from other devices.

blee0518
Posts: 23
Joined: Tue Mar 10, 2020 2:18 am

Re: Setup DHCP server / fails to restart issue, Raspbian buster

Thu Mar 26, 2020 2:59 am

kerry_s wrote:
Wed Mar 25, 2020 9:43 pm
do you have a router you can set to point at your pihole?
that's how devices get auto configured on my setup.

are you still using the setup with the messed up settings or a fresh install?
Found it to be `systemd resolved` was taking up port 53 that DNS uses. stopped and disabled.

Return to “Networking and servers”