Skip to content
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

UI "Enable DHCP server" is inactive forever #704

Closed
mveplus opened this issue Apr 4, 2019 · 3 comments
Closed

UI "Enable DHCP server" is inactive forever #704

mveplus opened this issue Apr 4, 2019 · 3 comments
Assignees
Milestone

Comments

@mveplus
Copy link

mveplus commented Apr 4, 2019

Done a quick search but could not find the issue, mentioned anywhere in the results.

Steps to reproduce

  1. Download and extract AdGuardHome_v0.94_linux_amd64.tar.gz, Proxmox LXC Ubuntu 18.04.2 LTS container running on a PC.
  2. Start and configure the DHCP, " DHCP server (experimental!) "
  3. "Enable DHCP server" is inactive, there is another active DHCP server on the network the default router.1, turning it off doe snot make any difference - "Enable DHCP server" is greyed out and inactive.
    01-AGH-DHCP
    02-AGH-DHCP-after-check-for DHCP is pressed
  4. The AGH DHCP can be enabled via changing the YML config!
    02-AGH-DHCP-enabled-via-yml

Another minor issue when there is another active DHCP server on the network - the info message below "Enable DHCP server" should change but it does not appear so.
04-AGH-DHCP-no-active-D-found
The message "No active DHCP servers, found on the network...." is not correct either.
It looks like click on the "Check for DHCP servers" button sends dhcpc broadcast message to discover active DHCP servers and the message is received back on the network adapter but does not seems to change the "No active DHCP servers..."

tcpdump port 68 or port 69
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
18:56:28.497586 IP x.mvend.loc.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 46:4f:f8:88:e1:19 (oui Unknown), length 280
18:56:47.184346 IP x.mvend.loc.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 46:4f:f8:88:e1:19 (oui Unknown), length 280

Expected behavior

"Enable DHCP server" should be greyed out and inactive only if another server is active, this needs to be revalidated each time "Save config" or "Check for DHCP servers" is pressed or AGH restarted.

Actual behavior

Restarting AGH does not make a difference. regardless of the secondary active DHCP server off or on.
"Enable DHCP server" is inactive.

Your environment

Description Value
Version of AdGuard Home server: v0.94_linux_amd64
How did you setup DNS configuration: System
device model: PC Proxmox 5.3.9
Operating system and version: (e.g. LXC Ubuntu 18.04.2
@mveplus mveplus changed the title "Enable DHCP server" is greyed out and inactive. "Enable DHCP server" is inactive new install Apr 4, 2019
@mveplus mveplus changed the title "Enable DHCP server" is inactive new install UI "Enable DHCP server" is inactive forever Apr 4, 2019
@ameshkov ameshkov added this to the v0.95 milestone Apr 6, 2019
@ameshkov
Copy link
Member

ameshkov commented Apr 6, 2019

This seems to be a UI bug, @szolin plz confirm

@szolin
Copy link
Contributor

szolin commented Apr 15, 2019

The issue with the button "Enable DHCP server" being always inactive will be resolved in #686.
But detection of another DHCP server doesn't work indeed - for some reason it doesn't receive the response from DHCP server.

@mveplus
Copy link
Author

mveplus commented Apr 21, 2019

@szolin I've done some test on it, I'm not sure if this could be related but there are two issues with "Check for DHCP server" detection.

  1. The first one is that broadcast dhcpc request is sent on out via the selected interface i.e "eth0" in this case but expected to return on the loopback instead (see tcpdumps ).
  2. The second one is bad udp cksum [bad udp cksum 0xc2d4 -> 0xd88b!]:

tcpdump -i eth0 port 67 or port 68 -nvvve
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
06:42:02.126316 46:4f:f8:88:e1:19 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 322: (tos 0x0, ttl 64, id 30161, offset 0, flags [DF], proto UDP (17), length 308)
192.168.0.251.68 > 255.255.255.255.67: [bad udp cksum 0xc2d4 -> 0xd88b!] BOOTP/DHCP, Request from 46:4f:f8:88:e1:19, length 280, xid 0xaacd5cbe, Flags [none] (0x0000)
Client-Ethernet-Address 46:4f:f8:88:e1:19
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Parameter-Request Option 55, length 10:
Subnet-Mask, Classless-Static-Route, Default-Gateway, Domain-Name-Server
Domain-Name, Option 119, Option 252, LDAP
Netbios-Name-Server, Netbios-Node
MSZ Option 57, length 2: 1500
Client-ID Option 61, length 7: ether 46:4f:f8:88:e1:19
Lease-Time Option 51, length 4: 7776000
Hostname Option 12, length 3: "mve"
END Option 255, length 0
^C
1 packet captured
1 packet received by filter
0 packets dropped by kernel

tcpdump -i lo port 67 or port 68 -nvvve
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes
06:42:27.161509 00:00:00:00:00:00 > 00:00:00:00:00:00, ethertype IPv4 (0x0800), length 316: (tos 0x0, ttl 64, id 34654, offset 0, flags [DF], proto UDP (17), length 302)
192.168.0.251.67 > 192.168.0.251.68: [bad udp cksum 0x8472 -> 0x34c8!] BOOTP/DHCP, Reply, length 274, xid 0x86975efe, Flags [none] (0x0000)
Your-IP 192.168.0.5
Client-Ethernet-Address 46:4f:f8:88:e1:19
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Server-ID Option 54, length 4: 192.168.0.251
Lease-Time Option 51, length 4: 86400
Subnet-Mask Option 1, length 4: 255.255.255.0
Default-Gateway Option 3, length 4: 192.168.0.1
Domain-Name-Server Option 6, length 4: 192.168.0.251
END Option 255, length 0
^C
1 packet captured
2 packets received by filter
0 packets dropped by kernel

tcpdump -i any port 67 or port 68 -nvvve
tcpdump: listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
06:42:47.248078 Out 46:4f:f8:88:e1:19 ethertype IPv4 (0x0800), length 324: (tos 0x0, ttl 64, id 33169, offset 0, flags [DF], proto UDP (17), length 308)
192.168.0.251.68 > 255.255.255.255.67: [bad udp cksum 0xc2d4 -> 0x92f6!] BOOTP/DHCP, Request from 46:4f:f8:88:e1:19, length 280, xid 0xaf3b9de5, Flags [none] (0x0000)
Client-Ethernet-Address 46:4f:f8:88:e1:19
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Parameter-Request Option 55, length 10:
Subnet-Mask, Classless-Static-Route, Default-Gateway, Domain-Name-Server
Domain-Name, Option 119, Option 252, LDAP
Netbios-Name-Server, Netbios-Node
MSZ Option 57, length 2: 1500
Client-ID Option 61, length 7: ether 46:4f:f8:88:e1:19
Lease-Time Option 51, length 4: 7776000
Hostname Option 12, length 3: "mve"
END Option 255, length 0
06:42:47.248177 In 00:00:00:00:00:00 ethertype IPv4 (0x0800), length 318: (tos 0x0, ttl 64, id 35498, offset 0, flags [DF], proto UDP (17), length 302)
192.168.0.251.67 > 192.168.0.251.68: [bad udp cksum 0x8472 -> 0xcd3c!] BOOTP/DHCP, Reply, length 274, xid 0xaf3b9de5, Flags [none] (0x0000)
Your-IP 192.168.0.5
Client-Ethernet-Address 46:4f:f8:88:e1:19
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Server-ID Option 54, length 4: 192.168.0.251
Lease-Time Option 51, length 4: 86400
Subnet-Mask Option 1, length 4: 255.255.255.0
Default-Gateway Option 3, length 4: 192.168.0.1
Domain-Name-Server Option 6, length 4: 192.168.0.251
END Option 255, length 0
^C
2 packets captured
3 packets received by filter
0 packets dropped by kernel

The bad checksum can be related to my setup thou, it can be mitigated by turning off ethernet interface offloading:

ethtool -K eth0 tx off
Actual changes:
tx-checksumming: off
tx-checksum-ip-generic: off
tx-checksum-sctp: off
tcp-segmentation-offload: off
tx-tcp-segmentation: off [requested on]
tx-tcp-ecn-segmentation: off [requested on]
tx-tcp-mangleid-segmentation: off [requested on]
tx-tcp6-segmentation: off [requested on]

tcpdump -i eth0 port 67 or port 68 -nvvve
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
06:57:08.687567 46:4f:f8:88:e1:19 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 322: (tos 0x0, ttl 64, id 35534, offset 0, flags [DF], proto UDP (17), length 308)
192.168.0.251.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 46:4f:f8:88:e1:19, length 280, xid 0x29eda156, Flags [none] (0x0000)
Client-Ethernet-Address 46:4f:f8:88:e1:19
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Parameter-Request Option 55, length 10:
Subnet-Mask, Classless-Static-Route, Default-Gateway, Domain-Name-Server
Domain-Name, Option 119, Option 252, LDAP
Netbios-Name-Server, Netbios-Node
MSZ Option 57, length 2: 1500
Client-ID Option 61, length 7: ether 46:4f:f8:88:e1:19
Lease-Time Option 51, length 4: 7776000
Hostname Option 12, length 3: "mve"
END Option 255, length 0

However, this is not an option for the "loopback" interface.

@szolin szolin closed this as completed in 173ab2a Apr 23, 2019
szolin added a commit that referenced this issue Apr 23, 2019
szolin added a commit that referenced this issue Apr 23, 2019
* commit '4231920ee84074e573539c05c53cb357b1a22154':
  * client: add "DuckDuckGo" to safesearch label text
  - dhcp: fix build on macos #704
  - dnsfilter: fix npe in dnsfilter test
  - dnsfilter: fix safesearch issue #268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants