All Interfaces/0.0.0.0 prevents DHCP from being enabled on an interface due port binding 0.0.0.0:68 #594

Closed
opened 2026-03-04 00:39:04 -05:00 by deekerman · 4 comments
Owner

Originally created by @ghost on GitHub (Mar 23, 2019).

Originally assigned to: @IldarKamalov, @szolin on GitHub.

This is when set up for 'All Interfaces' in the Wizard. When allowing AdGuard Home to be used for DHCP, it is impossible to enable it from the Web Interface, as it tells me that the port is already in use.

Couldn't listen to 192.168.0.2:68, cause: listen udp4 192.168.0.2:68: bind: address already in use

The port is in use by 0.0.0.0:68. Restarting AdGuard Home after configuring the DHCP still binds port 68 to 0.0.0.0 regardless of the interface selected.

It would be nice for the DHCP settings to determine where port 68 will be used, instead of following what the bind address is, since you already ask the user what interface you want the DHCP server to run on.

eg. If I select eth0 which shows me the IPv4 and IPv6 address, clicking on Save should unbind port 68 from 0.0.0.0 and bind it to the IPv4 address when enabled.

Steps to reproduce

  1. Install AdGuard Home and use default settings in Wizard
  2. Configure DHCP settings and save changes

Expected behavior

I can click 'Enable DHCP Server' and start the DHCP Server on 192.168.0.2:68

Actual behavior

The button is not enabled and the port is already used by 0.0.0.0:68 on itself.

Screenshot:

dhcp-ip

Your environment

Description Value
Version of AdGuard Home server: v0.94
How did you setup DNS configuration: IoT
If it's a router or IoT, please write device model: Raspberry Pi 3 Model B+
Originally created by @ghost on GitHub (Mar 23, 2019). Originally assigned to: @IldarKamalov, @szolin on GitHub. <!--- Help us to avoid duplicate reports, make sure you have searched through existing issues before submitting a new one--> This is when set up for 'All Interfaces' in the Wizard. When allowing AdGuard Home to be used for DHCP, it is impossible to enable it from the Web Interface, as it tells me that the port is already in use. `Couldn't listen to 192.168.0.2:68, cause: listen udp4 192.168.0.2:68: bind: address already in use` The port is in use by 0.0.0.0:68. Restarting AdGuard Home after configuring the DHCP still binds port 68 to 0.0.0.0 regardless of the interface selected. It would be nice for the DHCP settings to determine where port 68 will be used, instead of following what the bind address is, since you already ask the user what interface you want the DHCP server to run on. eg. If I select eth0 which shows me the IPv4 and IPv6 address, clicking on Save should unbind port 68 from 0.0.0.0 and bind it to the IPv4 address when enabled. <!--- If you are requesting a new feature, tell us how it should work in free form--> <!--- If you are reporting a bug, submit the detailed description using the template below--> ### Steps to reproduce <!--- Provide a link to a live example or a clear set of steps to reproduce the issue--> 1. Install AdGuard Home and use default settings in Wizard 2. Configure DHCP settings and save changes ### Expected behavior I can click 'Enable DHCP Server' and start the DHCP Server on 192.168.0.2:68 ### Actual behavior The button is not enabled and the port is already used by 0.0.0.0:68 on itself. <details><summary>Screenshot:</summary> <!--- drag and drop, upload or paste your screenshot to this area--> ![dhcp-ip](https://user-images.githubusercontent.com/46271764/54862592-336eb200-4d91-11e9-8e41-576010a406c8.jpg) </details> ### Your environment <!--- Please include all relevant details about the environment you experienced the bug in --> | Description | Value | | -------------- | ------------ | | Version of AdGuard Home server:| v0.94 | How did you setup DNS configuration:| IoT | If it's a router or IoT, please write device model:| Raspberry Pi 3 Model B+
deekerman 2026-03-04 00:39:04 -05:00
Author
Owner

@szolin commented on GitHub (Mar 26, 2019):

Currently UI automatically executes "Check for DHCP servers" command and doesn't allow to switch DHCP server on if something went wrong on server side.
And "Check for DHCP servers" command doesn't work reliably because it tries to bind on port 68 (which is by default opened by dhcpcd or dhclient daemons).
So we should rework the process of how we check for another DHCP server running on the system.

@planet0 As a work-around, you can manually edit yaml config file and set enabled true in dhcp section.

@szolin commented on GitHub (Mar 26, 2019): Currently UI automatically executes "Check for DHCP servers" command and doesn't allow to switch DHCP server on if something went wrong on server side. And "Check for DHCP servers" command doesn't work reliably because it tries to bind on port 68 (which is by default opened by dhcpcd or dhclient daemons). So we should rework the process of how we check for another DHCP server running on the system. @planet0 As a work-around, you can manually edit yaml config file and set `enabled true` in `dhcp` section.
Author
Owner

@szolin commented on GitHub (Mar 28, 2019):

So the task is as follows:
If client's request is

POST /control/dhcp/find_active_dhcp

and server responds with

{"error":...}

allow the user to click on button "Enable DHCP Server".
And show this message:

We couldn't determine whether an another DHCP server exists in the network.
Error details:
Couldn't listen to 192.169.56.1:68, cause: listen udp4 192.169.56.1:68: bind: address already in use

If you want to enable DHCP server anyway, make sure that there is no other active DHCP server in your network. Otherwise, it can break the Internet for connected devices!

Note: message "If you want to enable..." is changed a little bit.

Don't show the message "If you want to enable..." if server responds with {"found":false} to request "POST /control/dhcp/find_active_dhcp".

The message "Error details" may be expandable on-click.

@szolin commented on GitHub (Mar 28, 2019): So the task is as follows: If client's request is `POST /control/dhcp/find_active_dhcp` and server responds with `{"error":...}` allow the user to click on button "Enable DHCP Server". And show this message: ``` We couldn't determine whether an another DHCP server exists in the network. Error details: Couldn't listen to 192.169.56.1:68, cause: listen udp4 192.169.56.1:68: bind: address already in use If you want to enable DHCP server anyway, make sure that there is no other active DHCP server in your network. Otherwise, it can break the Internet for connected devices! ``` Note: message "If you want to enable..." is changed a little bit. Don't show the message "If you want to enable..." if server responds with {"found":false} to request "POST /control/dhcp/find_active_dhcp". The message "Error details" may be expandable on-click.
Author
Owner

@ameshkov commented on GitHub (Mar 29, 2019):

I just realized that this means that the port is occupied by the DHCP client, and we should not run DHCP server unless the DHCP client is stopped and IP is set to be static.

@szolin wouldn't it be better to automate it here?

@ameshkov commented on GitHub (Mar 29, 2019): I just realized that this means that the port is occupied by the DHCP client, and we should not run DHCP server unless the DHCP client is stopped and IP is set to be static. @szolin wouldn't it be better to automate it here?
Author
Owner

@ameshkov commented on GitHub (Mar 29, 2019):

Merged into https://github.com/AdguardTeam/AdGuardHome/issues/686

@ameshkov commented on GitHub (Mar 29, 2019): Merged into https://github.com/AdguardTeam/AdGuardHome/issues/686
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AdGuardHome#594
No description provided.