-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DHCP options of DHCP server return bogus content, breaking network #2688
Comments
Hello, and thank you for the report. I wasn't able to reproduce the issue on my machine. Do you happen to have a verbose log of your installation starting? In particular, lines like:
Also, since you're using Docker, could you also provide the |
Thanks for the super quick reply! The logs are verbose and give this output: $ docker logs adguard 2>&1 | head -n 500 | rg "dhcp"
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.4 <-> 1c:69:7a:03:1f:3b
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.3 <-> 00:11:32:89:ba:f0
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.66 <-> fc:65:de:e0:b0:bb
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.50 <-> dc:a6:32:5f:b9:99
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.65 <-> d4:12:43:dd:4c:58
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.52 <-> 68:ec:c5:62:4f:7b
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.64 <-> 98:fa:9b:c0:ac:1f
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.54 <-> 22:a6:2f:47:5e:ff
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.55 <-> fc:01:7c:aa:74:c4
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.56 <-> e8:e8:b7:9e:f6:6d
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.57 <-> 90:60:f1:66:50:ec
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.58 <-> b0:fc:0d:3a:b2:91
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.59 <-> c0:ee:fb:fa:4d:9a
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.60 <-> a0:02:dc:6d:f2:e4
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.61 <-> 32:91:ab:35:0c:de
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.62 <-> a4:83:e7:1c:6a:da
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.63 <-> 50:e0:85:08:0b:29
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.51 <-> 4c:32:75:93:15:3b
2021/02/15 20:41:12 1#1 [debug] dhcpv4: added lease 192.168.0.53 <-> 8c:16:45:e5:58:64
2021/02/15 20:41:15 1#1 [debug] dhcpv4: starting...
2021/02/15 20:41:15 1#1 [debug] dhcpv4: setting secondary dns ip to iself for interface eth0
2021/02/15 20:41:15 1#1 [info] dhcpv4: listening
[dhcpv4] 2021/02/15 20:41:15 Server listening on 0.0.0.0:67
[dhcpv4] 2021/02/15 20:41:15 Ready to handle requests There is no line mentioning The container is configured via docker-compose, it's pretty simple: version: "3.2"
volumes:
work:
services:
main:
image: adguard/adguardhome
container_name: adguard
network_mode: host # Required for DHCP server
volumes:
- ./conf:/opt/adguardhome/conf
- work:/opt/adguardhome/work
restart: unless-stopped The Cheers |
Are you sure that that is the log from the latest version? That line should definitely be there in v0.105.0 and v0.105.1. The |
Yep, you are right, sorry. These logs are definitely from $ docker logs adguard 2>&1 | rg "dhcp"
...
2021/02/16 13:15:44 1#1 [debug] dhcpv4: starting...
2021/02/16 13:15:44 1#1 [debug] dhcpv4: setting secondary dns ip to itself
2021/02/16 13:15:44 1#1 [debug] dhcpv4: got addresses [192.168.0.2 192.168.0.2] after 1 attempts
2021/02/16 13:15:44 1#1 [info] dhcpv4: listening
[dhcpv4] 2021/02/16 13:15:44 Server listening on 0.0.0.0:67
[dhcpv4] 2021/02/16 13:15:44 Ready to handle requests
... So that's right, thanks. This piece: AdGuardHome/internal/dhcpd/v46.go Lines 80 to 123 in f68f6c9
seems to work correctly then, it got the correct interface address. Does it collide with the |
We've found the bug, and it should be patched on the edge channel, including in Docker. Can you please check if the fresh |
Yep looking good, $ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.0.2 on example client 1, etc, so results as before. Thanks a ton for the quick fix, keep up the good work! |
Just as an addendum, I ended up not using any DHCP options for now: options: [] I wasn't aware of this functionality AdGuardHome/internal/dhcpd/v46.go Lines 80 to 123 in f68f6c9
and it works really well, broadcasting the AGH server's IP address as the first two (and only) DNS servers to use. This saves me from having to set DHCP option number 6 in the first place. Thanks for that functionality, takes a lot of annoying trial-and-error out of the setup. This also means I am back on |
Merge in DNS/adguard-home from 2688-dhcp-opt-ip to master Updates AdguardTeam#2688. Squashed commit of the following: commit e17e003 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Feb 16 17:10:32 2021 +0300 dhcpd: fix ip option parsing
Prerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
Issue Details
Expected Behavior
The following DHCP config, part of
AdGuardHome.yaml
, worked inv0.104.3
:where
192.168.0.2
is the AdGuardHome server's IP. Used to work like a charm! On DHCP clients, the following output used to be observable (this example is Debian 10):and
Actual Behavior
Example Client 1 (Debian 10 NUC)
Now, the output on a Debian 10 DHCP client is the following. This is what DHCP clients get told by AdGuardHome's DHCP server, as part of the DHCP options
4
and6
, see config above:and
How did
0.0.0.0
(twice) and0.0.255.255
get in there? As a consequence of this, one of the errors I got was along the lines ofin
journalctl
of a service that tried to start up but couldn't. It tried to run DNS queries against0.0.255.255
and obviously failed. Other services failed because they tried against0.0.0.0
.Example Client 2 (Synology NAS)
Similar behaviour on this machine:
$ cat /etc/dhclient/ipv4/dhcpcd-eth0.info IPADDR=192.168.0.3 NETMASK=255.255.255.0 NETWORK=192.168.0.0 BROADCAST=192.168.0.255 GATEWAY=192.168.0.1 DOMAIN= DNS=0.0.0.0 0.0.0.0 0.0.255.255 192.168.0.2 # <---- DHCPSID=192.168.0.2 DHCPGIADDR= DHCPSIADDR=
This causes the entire machine to fall on its face pretty hard.
I've rolled back to v0.104.3. The above is an issue that breaks my entire home network.
The text was updated successfully, but these errors were encountered: