hassio-addons / addon-adguard-home

AdGuard Home - Home Assistant Community Add-ons
https://addons.community
MIT License
390 stars 48 forks source link

Ipv6 #313

Closed jherby2k closed 1 year ago

jherby2k commented 2 years ago

I'm not sure if this is a HASSOS issue or an add-on issue.

Seems the docker container doesn't have ipv6 networking. This means I can't use IPv6 upstream servers (not that big of a deal) or resolve queries from IPv6 clients.

Is the HASSOS page the right place to complain? Or here? Docker supports IPv6 these days.

martymarty004 commented 2 years ago

This is an issue with Home Assistant OS in general.

I think they are working to enable IPV6 in the near future.

jherby2k commented 2 years ago

honestly this seems to be working now as of 4.5.1. Not sure what changed, if anything - i can use upstream servers and also query over ipv6.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

martymarty004 commented 2 years ago

I run in a dual stack environment (I have both IPv4 and IPv6) and I noticed that the Addon doesn't bind to the IPv6 interface after performing a host reboot (RPi 4 in my case).

I need to restart the Addon for it to work correctly, probably because it gets started before my Router is able to assign an IPv6 to the Raspberry.

This is the log after a Home Assistant OS reboot (I was updating from 8.0 to 8.1 in this case):

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: AdGuard Home
 Network-wide ads & trackers blocking DNS server
-----------------------------------------------------------
 Add-on version: 4.5.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 8.1  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2022.5.5
 Home Assistant Supervisor: 2022.05.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adguard.sh: executing... 
[cont-init.d] adguard.sh: exited 0.
[cont-init.d] discovery.sh: executing... 
[16:00:46] INFO: Successfully send discovery information to Home Assistant.
[cont-init.d] discovery.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[16:00:47] INFO: Starting AdGuard Home server...
2022/05/21 16:00:48.091817 [info] AdGuard Home, version v0.107.6
2022/05/21 16:00:48.107248 [info] dhcp: loaded leases v4:58  v6:0  total-read:58 from DB
2022/05/21 16:00:48.133859 [info] Initializing auth module: /data/adguard/data/sessions.db
2022/05/21 16:00:48.136318 [info] auth: initialized.  users:0  sessions:0
2022/05/21 16:00:48.136378 [info] Initialize web module
2022/05/21 16:00:48.214043 [info] dhcpv4: listening
[dhcpv4] 2022/05/21 16:00:48 Server listening on 0.0.0.0:67
[dhcpv4] 2022/05/21 16:00:48 Ready to handle requests
2022/05/21 16:00:48.217362 [info] AdGuard Home is available at the following addresses:
2022/05/21 16:00:48.217533 [info] Go to http://127.0.0.1:45158
[16:00:48] INFO: Starting NGinx...
2022/05/21 16:00:48.845577 [info] Starting the DNS proxy server
2022/05/21 16:00:48.845622 [info] Ratelimit is enabled and set to 50 rps
2022/05/21 16:00:48.845635 [info] The server is configured to refuse ANY requests
2022/05/21 16:00:48.845648 [info] DNS cache is enabled
2022/05/21 16:00:48.845668 [info] MaxGoroutines is set to 50
2022/05/21 16:00:48.845699 [info] Creating the UDP server socket
2022/05/21 16:00:48.845922 [info] Listening to udp://192.168.69.77:53
2022/05/21 16:00:48.847533 [info] Creating the UDP server socket
2022/05/21 16:00:48.848002 [info] Listening to udp://172.30.32.1:53
2022/05/21 16:00:48.848133 [info] Creating a TCP server socket
2022/05/21 16:00:48.848462 [info] Listening to tcp://192.168.69.77:53
2022/05/21 16:00:48.848608 [info] Creating a TCP server socket
2022/05/21 16:00:48.848889 [info] Listening to tcp://172.30.32.1:53
2022/05/21 16:00:48.849228 [info] Entering the UDP listener loop on 172.30.32.1:53
2022/05/21 16:00:48.849799 [info] Entering the tcp listener loop on 172.30.32.1:53
2022/05/21 16:00:48.849266 [info] Entering the UDP listener loop on 192.168.69.77:53
2022/05/21 16:00:48.849330 [info] Entering the tcp listener loop on 192.168.69.77:53

This is the one after the Addon restart:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: AdGuard Home
 Network-wide ads & trackers blocking DNS server
-----------------------------------------------------------
 Add-on version: 4.5.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 8.1  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2022.5.5
 Home Assistant Supervisor: 2022.05.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adguard.sh: executing... 
[cont-init.d] adguard.sh: exited 0.
[cont-init.d] discovery.sh: executing... 
[16:08:21] INFO: Successfully send discovery information to Home Assistant.
[cont-init.d] discovery.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[16:08:22] INFO: Starting AdGuard Home server...
2022/05/21 16:08:22.543010 [info] AdGuard Home, version v0.107.6
2022/05/21 16:08:22.553292 [info] dhcp: loaded leases v4:58  v6:0  total-read:58 from DB
2022/05/21 16:08:22.577437 [info] Initializing auth module: /data/adguard/data/sessions.db
2022/05/21 16:08:22.578187 [info] auth: initialized.  users:0  sessions:0
2022/05/21 16:08:22.578302 [info] Initialize web module
2022/05/21 16:08:22.621857 [info] dhcpv4: listening
2022/05/21 16:08:22.622186 [info] AdGuard Home is available at the following addresses:
2022/05/21 16:08:22.622250 [info] Go to http://127.0.0.1:45158
[dhcpv4] 2022/05/21 16:08:22 Server listening on 0.0.0.0:67
[dhcpv4] 2022/05/21 16:08:22 Ready to handle requests
[16:08:23] INFO: Starting NGinx...
2022/05/21 16:08:23.202866 [info] Starting the DNS proxy server
2022/05/21 16:08:23.202923 [info] Ratelimit is enabled and set to 50 rps
2022/05/21 16:08:23.202935 [info] The server is configured to refuse ANY requests
2022/05/21 16:08:23.202948 [info] DNS cache is enabled
2022/05/21 16:08:23.202968 [info] MaxGoroutines is set to 50
2022/05/21 16:08:23.203080 [info] Creating the UDP server socket
2022/05/21 16:08:23.203446 [info] Listening to udp://192.168.69.77:53
2022/05/21 16:08:23.203500 [info] Creating the UDP server socket
2022/05/21 16:08:23.203794 [info] Listening to udp://[2a##:####:####:0:####:####:####:##8f]:53
2022/05/21 16:08:23.203816 [info] Creating the UDP server socket
2022/05/21 16:08:23.204280 [info] Listening to udp://172.30.32.1:53
2022/05/21 16:08:23.204307 [info] Creating a TCP server socket
2022/05/21 16:08:23.204596 [info] Listening to tcp://192.168.69.77:53
2022/05/21 16:08:23.204617 [info] Creating a TCP server socket
2022/05/21 16:08:23.205216 [info] Listening to tcp://[2a##:####:####:0:####:####:####:##8f]:53
2022/05/21 16:08:23.205241 [info] Creating a TCP server socket
2022/05/21 16:08:23.205445 [info] Listening to tcp://172.30.32.1:53
2022/05/21 16:08:23.205950 [info] Entering the UDP listener loop on 172.30.32.1:53
2022/05/21 16:08:23.206206 [info] Entering the UDP listener loop on 192.168.69.77:53
2022/05/21 16:08:23.206760 [info] Entering the tcp listener loop on [2a##:####:####:0:####:####:####:##8f]:53
2022/05/21 16:08:23.206979 [info] Entering the tcp listener loop on 192.168.69.77:53
2022/05/21 16:08:23.207439 [info] Entering the UDP listener loop on [2a##:####:####:0:####:####:####:##8f]:53
2022/05/21 16:08:23.207651 [info] Entering the tcp listener loop on 172.30.32.1:53
pattyland commented 2 years ago

I have the problem the other way around: When AGH is started together with HassOS, AGH is only accessible via IPv6, which many devices still have problems with. Only when I restart AGH after a break, IPv4 works as well.

martymarty004 commented 2 years ago

I have a static IPv4 address on my RPi, so that's not an issue

pattyland commented 2 years ago

Are you sure? I suspect here just generally a timing problem, if the addon starts before the underlying system is completely ready, sometimes IPv4 is missing, sometimes IPv6 and sometimes all are there.

martymarty004 commented 2 years ago

I don't know really. The only thing I know is that I have been using the AdGuard Addon for more than two years and I've never encountered issues with IPv4, just IPv6.

pattyland commented 2 years ago

I think you gave the hint yourself: Your IPv4 address is static and therefore probably available very quickly. I assume your IPv6 address comes dynamically from your router? DHCPv6 takes longer and I guess that's the problem when AGH starts too early.

martymarty004 commented 2 years ago

Yeah, that's probably the issue.

AdGuard should probably check for new interfaces or simply wait a little longer on startup.

Until then, I think I will use an automation to restart the addon after a system reboot.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

pattyland commented 2 years ago

So I just updated to HassOS 8.2 and after the boot I got all IPv4 and IPv6 addresses I need and expect. There is no real mention in the changelog v4.6.0 of this addon so I'm unsure if this luck of timing or not...

martymarty004 commented 2 years ago

Everything works as expected, but I still get the same issue of AdGuard not detecting IPv6 on system startup.

I use an automation to restart the addon after a while, but I think that AdGuard itself should check for new interfaces.

frenck commented 2 years ago

but I think that AdGuard itself should check for new interfaces.

It can't do that, that is not an add-on limitation.

aurorasmiles commented 2 years ago

I use an automation to restart the addon after a while

Thank you for the tip, I set that up as well now and it works fine.

but I think that AdGuard itself should check for new interfaces. It can't do that, that is not an add-on limitation.

If that is the case, would it be possible to add a workaround in the meantime? Maybe delaying they plugin initialisation or something like that would be possible.

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!