Adguardhome: Snap 1052 cannot bind DHCP to network interface

Created on 28 Oct 2020  Â·  22Comments  Â·  Source: AdguardTeam/AdGuardHome

Issue Details

  • Version of AdGuard Home server:

    • 0.104.0

  • How did you setup DNS configuration:

    • System

  • Operating system and version:

    • Ubuntu 18.04.5

Expected Behavior

Before the snap refreshed (snap rev 606/adguard version 0.103.3), DHCP was enabled and working. After it updated, I expected it to continue working.

Actual Behavior

DHCP stopped working after the refresh. Attempting to disable and re-enable the service resulted in the following error:
Error: control/dhcp/set_config | Failed to start DHCP server: cannot bind to interface enp3s0: operation not permitted | 400

Medium bug

Most helpful comment

We're looking into it, don't worry.

Meanwhile, could you please post the dhcp: section of your config files? (AdGuardHome.yaml)

All 22 comments

As a workaround until a fix is published, running snap revert adguard-home restored the previous version.

Same issue here. DHCP stopped working over night when the snap updated to 0.104

Network is now down. Oh dear.

We're looking into it, don't worry.

Meanwhile, could you please post the dhcp: section of your config files? (AdGuardHome.yaml)

Here is the dchp section of mine:
Snap rev 606 (working):

dhcp:
  enabled: true
  interface_name: enp3s0
  gateway_ip: 192.168.0.1
  subnet_mask: 255.255.255.0
  range_start: 192.168.0.50
  range_end: 192.168.0.150
  lease_duration: 86400
  icmp_timeout_msec: 1000

Snap rev 1052 (not working):

dhcp:
  enabled: true
  interface_name: enp3s0
  dhcpv4:
    gateway_ip: 192.168.0.1
    subnet_mask: 255.255.255.0
    range_start: 192.168.0.50
    range_end: 192.168.0.150
    lease_duration: 86400
    icmp_timeout_msec: 1000
    options: []
  dhcpv6:
    range_start: ""
    lease_duration: 86400
    ra_slaac_only: false
    ra_allow_slaac: false

Good day, @marxjohnson! Thank you for the report. I was able to reproduce the bug. Apparently, the new way we filter packets to only get the ones from the required interface on Linux requires more permissions than before. We're investigating how to fix this.

@marxjohnson @Tloram please try installing AGH snap from the edge channel, the issue should be gone now.

snap refresh adguard-home --channel edge

Hi @ameshkov, I just tried that:
adguard-home (edge) v0.104.0-SNAPSHOT-9761f133 from AdGuard (ameshkov✓) refreshed
Unfortunately, the problem still persists.

Weird, we'll double-check.

I have the same issue on a brand new install of .104. I could never get Snap install working on Raspberry Pi. Is there a way to revert to a previous version using the RPI install instructions?

The DHCP server is working on a fresh install of Version:
v0.104.0-SNAPSHOT-9761f133

The problem is that the new version requires CAP_NET_RAW to be able to run the DHCP server. However, it's unclear how to add this capability to our snap. We tried adding network-manager to plugs (and then slots), but nevertheless, we're facing this "operation not permitted" issue.

@popey could you please take a look, what we're doing wrong?

Just to confirm, also still getting the same issue.

@ainar-g check this out, sounds relevant: https://bugs.launchpad.net/snappy/+bug/1823988

UPDATE: We seem to be close to solving this issue as of 11e794f5. Please run:

$ snap refresh --channel edge adguard-home
$ snap connect adguard-home:network-control

If that works for you, we'll ask the Snapcraft folks to allow us to auto-connect this plug, so that you could not run the second command in the future. Old response below:


Old response

We're still figuring this out, sorry for the inconcenience! In the meantime, if you update the snap package with (maybe with sudo):

$ snap refresh --channel edge --devmode adguard-home

Does DHCP work again? If it does, that might be a workaround until we actually understand, why doesn't snap grant us the required capabilities.

@Tloram Can you please check the new solution I've described above as well?

@ainar-g Sure, will try this tonight and report back here.

@Tloram did it help?

Sorry guys, I didn't get around to testing this yet (Covid related problems have got in the way).

No problem, be safe!

We're almost sure that the issue is resolved in the "edge" channel, but you'll need to manually call snap connect adguard-home:network-control for now.

Please comment or reopen if this doesn't help.

I can confirm than running the edge channel and manually connecting adguard-home:network-control has resolved the issue, thanks!

@ainar-g have you contacted Snap Store people about autoconnect or should I do that?

@ameshkov Ok so I have now tried both the edge channel (using the commands you showed to manually call the connect of network-control) and the latest standard release and it does not seem to be working on either for me I'm afraid.

The commands seem to execute ok on the cli (run as sudo), no errors but then in the Adguard GUI clicking on the disable/enable dhcp server button does nothing, the button seems to be disabled... and dhcp is failing across the network until I revert back to 103.3 :(

@ameshkov Yes, so far there was no response.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xenio picture xenio  Â·  4Comments

AnthonyBe picture AnthonyBe  Â·  3Comments

TXC picture TXC  Â·  3Comments

Iconology picture Iconology  Â·  3Comments

ammnt picture ammnt  Â·  4Comments