How to replace default network interface with macvlan?

    • How to replace default network interface with macvlan?

      Hi,

      I've set up docker containers which use macvlan interfaces.These include pi-hole and a vpn server (softether). Everything works fine, except for one little thing: I can't reach the webinterface if I am connected from external via vpn. This is by design, because macvlan are isolated and can't communicate with it's parent device. But the different macvlan interfaces can communicate with each other. (I.e. the vpn-connection is filtered by pihole).

      I found a solution how docker containers with macvlan interfaces could communicate with OMV - theoretically. The idea is to replace the physical interface with a macvlan interface and let all communication run through it. To achive this, /etc/netwokrs/interfaces needs to be modified.

      Look here: reddit.com/r/docker/comments/6…ommunicating_with/dqd16zx and here: infrastructuredevops.com/01-05-2018/docker-macvlan.html
      Unfortunately I don't know how to put this in Openmediavault (I am also a bloody linux noob).

      OMV has control over the interfaces, so that they can't be edited directly (openmediavault.readthedocs.io/en/latest/various/files.html).
      According to this post (Customize /etc/network/interfaces the OMV way [>= 1.11]) it is possible to add additional interfaces. But I'm not sure if it is possible to edit or override a existing interface....

      Anyway, I created a new file "my-macvlan" in /etc/network/interface.d/ with the following content (since I use dhcp and want a static mac address I had to modify the template):

      Source Code

      1. auto enp1s0
      2. allow-hotplug enp1s0
      3. iface enp1s0 inet manual
      4. auto macvlan0
      5. iface macvlan0 inet dhcp
      6. dns-nameservers 192.168.1.1
      7. dns-search fritz.box
      8. pre-up ip link add macvlan0 link enp1s0 address: 6E:26:8F:C9:E3:C5 type macvlan mode bridge
      9. pre-down ethtool -s $IFACE wol g
      10. post-down ip link del macvlan0 link enp1so type macvlan mode bridge
      Display All

      I restartet OMV afterwards but nothing changed. My /etc/network/interface remainded unchanged:

      Source Code

      1. # Include additional interface stanzas.
      2. source-directory interfaces.d
      3. # The loopback network interface
      4. auto lo
      5. iface lo inet loopback
      6. # enp1s0 network interface
      7. auto enp1s0
      8. allow-hotplug enp1s0
      9. iface enp1s0 inet dhcp
      10. dns-nameservers 192.168.1.1
      11. dns-search fritz.box
      12. pre-down ethtool -s $IFACE wol g
      13. iface enp1s0 inet6 manual
      14. pre-down ip -6 addr flush dev $IFACE
      Display All


      Where did I make a mistake? Can this even work?
    • Users Online 1

      1 Guest