unifi-utilities / unifios-utilities

A collection of enhancements for UnifiOS based devices
GNU General Public License v3.0
3.91k stars 420 forks source link

Trying to follow Pi-hole instructions leads to MACVLAN error #85

Closed emlynmac closed 3 years ago

emlynmac commented 3 years ago

Describe the bug Following the instructions at https://github.com/boostchicken/udm-utilities/tree/master/run-pihole does not work.

At step 4 (Execute /mnt/data/on_boot.d/10-dns.sh) the response contains errors:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   658  100   658    0     0   1519      0 --:--:-- --:--:-- --:--:--  1519
100 35.3M  100 35.3M    0     0  10.5M      0  0:00:03  0:00:03 --:--:-- 14.3M
grep: /run/dnsmasq.conf.d/custom.conf: No such file or directory
podman-dns: Container pihole not found, make sure you set the proper name, you can ignore this error if it is your first time setting it up
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.
iptables: No chain/target/match by that name.

Executing step 6:

 podman run -d --network dns --restart always \
    --name pihole \
    -e TZ="America/Los Angeles" \
    -v "/mnt/data/etc-pihole/:/etc/pihole/" \
    -v "/mnt/data/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/" \
    --dns=127.0.0.1 \
    --dns=1.1.1.1 \
    --dns=8.8.8.8 \
    --hostname pi.hole \
    -e VIRTUAL_HOST="pi.hole" \
    -e PROXY_LOCATION="pi.hole" \
    -e ServerIP="10.0.5.3" \
    -e IPv6="False" \
    pihole/pihole:latest

gives further errors:

Storing signatures
ERRO[0022] Error adding network: failed to create macvlan: cannot assign requested address 
ERRO[0022] Error while adding pod to CNI network "dns": failed to create macvlan: cannot assign requested address 
ERRO[0022] Error removing timer for container c1b93255094d47b90741964f4529f1bf89c3b8c00320850acfdbc27376fa2d48 healthcheck: unable to get systemd connection to remove healthchecks: dial unix /run/systemd/private: connect: no such file or directory 
Error: error configuring network namespace for container c1b93255094d47b90741964f4529f1bf89c3b8c00320850acfdbc27376fa2d48: failed to create macvlan: cannot assign requested address

UDM Information

Additional context Clean install; no other components.

arfak commented 3 years ago

in /mnt/data/podman/cni/20-dns.conflist

delete line 9: "mac": "ab:cd:ef:01:23:45",

It works for me.

emlynmac commented 3 years ago

Aha! Thanks - should the config file be updated, or are there cases where specifying the MAC is useful?

boostchicken commented 3 years ago

You want that a mac address there do not delete it. Just please generate a mac address of your own that is legit.

robpneu commented 3 years ago

@boostchicken I'm also stuck on this step and am seeing the exact same error. I have generated a random mac address and put it in but it refuses to run with it. Is there some sort of mac address "legit" check that I'm missing (and it is failing on)?

I tried deleting the mac address line in 20-dns.conflist entirely, as @arfak suggested, and it was able to run, seemingly fine, though I did not doing anything more than verify it was running with "podman ps" and then visiting http://10.0.5.3/.

d1rtym0nk3y commented 3 years ago

same issue for me, i get the following error when a mac address is specified

ERRO[0000] Error adding network: failed to create macvlan: cannot assign requested address

Model       UDM-Pro
Version     1.8.5.2964
Controller  6.0.43

tried multiple generated mac's and formats, but only works with the mac address removed.

robpneu commented 3 years ago

Okay, I figured it out: the mac address is failing due to a "legit" check. The first 3 bytes need to match a real manufacturer (you can refer to the lists here and here for examples) and the manufacturer part of the mac address I'd randomly generated was not valid because of that. So I just changed the first 3 bytes of the address I'd previously randomly generated to match a random prefix from one of those lists and voila! No more error and pihole starts up as it should.

ArmandH commented 3 years ago

wow that worked i had same error

chr-lei commented 2 years ago

Okay, I figured it out: the mac address is failing due to a "legit" check. The first 3 bytes need to match a real manufacturer (you can refer to the lists here and here for examples) and the manufacturer part of the mac address I'd randomly generated was not valid because of that. So I just changed the first 3 bytes of the address I'd previously randomly generated to match a random prefix from one of those lists and voila! No more error and pihole starts up as it should.

Found this almost a year later but jeez I am glad I did - I was pulling my hair out!