I run Ubuntu Budgie 19.10 on an Intel based pc, dedicated as NAS. This system runs PiHole as a docker container, and within Docker, a macvlan has been created to make sure the PiHole docker receives its own dedicated IP address from the router. This all works fine.
In order to reach the PiHole webinterface from the host PC (I can already access it from any other device in my LAN), I need to create a macvlan bridge on the host PC:
ip link add mynet-shim link eno1 type macvlan mode bridge
ip addr add 192.168.88.10/24 dev mynet-shim
ip link set mynet-shim up
ip route add 192.168.88.5 dev mynet-shimThis works fine, after running these commands, I can access my PiHole (192.168.88.5/admin) webUI via the hostPC itself (192.168.88.10). Note I don't understand these commands, or macvlan, I just search the internet and try to understand as much as possible. Lots of trial and error :)
However, after a reboot, this macvlan bridge is gone. How do I make it persistent? I understand I might have to create a file /etc/network/interfaces, but I will be forced to define ALL interfaces there.. not just this thing I created manually, also virtual or real interfaces that are created automatically. I am not sure if I am capable of that.
What would be the best way to figure this out?
1 Answer
Maybe too late but I've been struggling with this and the solution is a piece of cake. Hope it can help somebody out
Just edit your /etc/network/interfaces and add this after you interface settings:
#MacVLAN
# Create new macvlan interface on the host
up ip link add mynet-shim link eno1 type macvlan mode bridge
# Add the host address and bring up the interface
up ip addr add 192.168.88.10/24 dev mynet-shim
up ip link set mynet-shim up
# Tell our host to use that interface to communicate with containers
up ip route add 192.168.88.5 dev mynet-shim