From 2bd42cdc7de6adb9230d728e0d791d2bf0a625f2 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 18 Mar 2021 15:25:17 -0500 Subject: [PATCH] improve the docs for AdGuardHome (#135) * AdGuardHome: fix order of operations Fix the initial order of operations that causes initial setup issues. fixes #107. * AdGuardHome: clean up some info with formatting * AdGuardHome: add troubleshooting info Hopefully this will help folks in #107 solve their issues. * 10-dns: always write out the symlinks Skip spitting an error about the fact that the symlinks already exist. Just write them anyway. --- AdguardHome/README.md | 26 +++++++++++++++++++++++--- dns-common/on_boot.d/10-dns.sh | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/AdguardHome/README.md b/AdguardHome/README.md index 4eef5c4..487ace4 100644 --- a/AdguardHome/README.md +++ b/AdguardHome/README.md @@ -19,9 +19,9 @@ ## Steps 1. On your controller, make a Corporate network with no DHCP server and give it a VLAN. For this example we are using VLAN 5. -1. Copy [10-dns.sh](../dns-common/on_boot.d/10-dns.sh) to /mnt/data/on_boot.d and update its values to reflect your environment -1. Execute /mnt/data/on_boot.d/10-dns.sh -1. Copy [20-dns.conflist](../cni-plugins/20-dns.conflist) to /mnt/data/podman/cni. This will create your podman macvlan network +1. Copy [10-dns.sh](../dns-common/on_boot.d/10-dns.sh) to `/mnt/data/on_boot.d` and update its values to reflect your environment +1. Copy [20-dns.conflist](../cni-plugins/20-dns.conflist) to `/mnt/data/podman/cni` after generating a MAC address. This will create your podman macvlan network. +1. Execute `/mnt/data/on_boot.d/10-dns.sh` 1. Run the AdguardHome docker container, be sure to make the directories for your persistent AdguardHome configuration. They are mounted as volumes in the command below. ```shell script @@ -40,3 +40,23 @@ 1. Browse to 10.0.5.3:3000 and follow the setup wizard 1. Update your DNS Servers to 10.0.5.3 (or your custom ip) in all your DHCP configs. 1. Access the AdguardHome like you would normally. + +## Troubleshooting + +If you get the following error: + +``` +Error adding network: failed to create macvlan: cannot assign requested address +``` + +When starting the container then the MAC address you generated is not good. You can cheat at this point and look at the address of `br$VLAN.mac` with `ifconfig br$VLAN.mac` and use that value. + +To start over you must remove the container and the macvlan device: + +``` +podman container rm adguardhome +podman network rm dns -f # expect an error here +ip link delete br$VLAN.mac +``` + +You can now run `10-dns.sh` again and start the container again. diff --git a/dns-common/on_boot.d/10-dns.sh b/dns-common/on_boot.d/10-dns.sh index 70aad11..31642b5 100644 --- a/dns-common/on_boot.d/10-dns.sh +++ b/dns-common/on_boot.d/10-dns.sh @@ -41,7 +41,7 @@ ln -s $CNI_PATH /opt/cni/bin for file in "$CNI_PATH"/*.conflist do if [ -f "$file" ]; then - ln -s "$file" "/etc/cni/net.d/$(basename "$file")" + ln -fs "$file" "/etc/cni/net.d/$(basename "$file")" fi done