Working macvlan setup on rockpro 64 OMV v4

  • Hello,


    Finally managed to configure macvlan on rockpro64 with OMV version 4.1.28-1. Thought to share my document notes for anyone having problems setting up macvlan on rockpro64 or in general.


    Brief

    lan interface: eth0

    lan network 192.168.2.0/24

    ip range used by dockers: 192.168.2.225 - 192.168.2.254


    Below are setup steps in different stages from my notes during setup. It involves:

    • creating subinterface (called mac0) to be used for communicating with host and defining part of the network address that will be used by dockers so that host would know how to route packets
    • creating macvlan docker network
    • host routing table changes if not using CIDR e.g. 192.168.2.224/27 for 192.168.2.0/24 lan

    Information sources

    Below are the links to information that helped me to set it up and some important points.

    ·         General information on how omv generates configs.

    o   Omv generates configs of necessary os config files when doing any changes, it stores the necessary information in other files

    ·         debian uses /etc/network/interfaces file where interface settings are defined, it is generated by omv scripts/helper-functions

    ·         Omv forum post about editing or creating new script for your custom network interface settings

    o   Customize /etc/network/interfaces the OMV way [>= 1.11]

    ·         Below forum is the one that pointed to creating corrects routes, the last one, bottom one and an additional link to source of information

    o   https://stackoverflow.com/ques…20host%20and%20containers.

    o   https://blog.oddbit.com/post/2…-docker-macvlan-networks/

    ·         Post regarding promiscuous mode on eth0 on rockpro64 after each boot, tested and it pings no problem mac0 ip whereas before it would do 1 every 20 secconds or so

    o   https://www.reddit.com/r/OpenM…/omv5_pihole_setup_guide/

    ·         Below is a good post about promiscious load on cpu, in a switched network is not existent

    o   https://serverfault.com/questi…us-mode-add-to-the-server


    Creating sub interface (virtual network interface) mac0

    1.       Define mac0 interface within omv or edit /etc/network/interfaces file in other linux distros

    a.       nano /usr/share/openmediavault/mkconf/interfaces.d/macvlan0



    2.       Make file executable and generate /etc/network/interfaces file

    a.       chmod +x /usr/share/openmediavault/mkconf/interfaces.d/macvlan0

    b.       omv-mkconf interfaces


    3.       Test if it can be brought up and down, make sure to do “if down” first and confirm that ip link or ip add doesn't have mac0 entry

    a.       ifdown mac0

    b.       ifup mac0

    c.        reboot OS if all is good or just try to restart networking service


    4.       Make sure correct route exists

    a.       ip route

    Creating macvlan docker network

    1.       Create docker network that has limited ip range so that host would know which interface to use to route packets, use online cidr calculators

    a.       use “aux address” to make sure they are not used in docker network

    b.       docker network create -d macvlan --subnet=192.168.2.0/24 --gateway=192.168.2.1 --ip-range 192.168.2.224/27 --aux-address 'host=192.168.2.244' --aux-address 'NAS=192.168.2.245' -o parent=eth0 homeLan


    2.       Test communication, try pinging from within docker host and other devices on network

    a.       docker run --name alpine --net=homeLan --ip=192.168.2.241 -itd alpine /bin/sh

    b.       docker exec -it alpine /bin/sh

    Troubleshooting / packet capture

    1.       To troubleshoot network communication, you may need to use tcpdump, just open a separate ssh shell and ping on one and monitor output on the other

    a.       Define interface e.g. eth0 or mac0 and add not to monitor ssh port and define what ip to monitor or not to monitor

    b.       tcpdump -e -i eth0 port not 22 and host 192.168.2.241

  • Great post! Are you aware of OMV 4 being EOL though?

    omv 6.9.6-2 (Shaitan) on RPi CM4/4GB with 64bit Kernel 6.1.21-v8+

    2x 6TB 3.5'' HDDs (CMR) formatted with ext4 via 2port PCIe SATA card with ASM1061R chipset providing hardware supported RAID1


    omv 6.9.3-1 (Shaitan) on RPi4/4GB with 32bit Kernel 5.10.63 and WittyPi 3 V2 RTC HAT

    2x 3TB 3.5'' HDDs (CMR) formatted with ext4 in Icy Box IB-RD3662-C31 / hardware supported RAID1

    For Read/Write performance of SMB shares hosted on this hardware see forum here

  • Great post! Are you aware of OMV 4 being EOL though?

    Thank you for your post and sorry for late reply, i didn't get notification about your post for some reason.


    It is running fine for me now and i will look at upgrade if something drastically stops working. Too many scripts for different things are scheduled and i spent too much time on setting up omv4 and many dockers. I have backup in place and spare hardware in case original fails.

    • Offizieller Beitrag

    Thank you for your post and sorry for late reply, i didn't get notification about your post for some reason.


    It is running fine for me now and i will look at upgrade if something drastically stops working. Too many scripts for different things are scheduled and i spent too much time on setting up omv4 and many dockers. I have backup in place and spare hardware in case original fails.

    You only get notifications if someone quotes you, or if you subscribe to a thread (above the top "reply" button, that sort of looks like a bookmark icon)

  • You only get notifications if someone quotes you, or if you subscribe to a thread (above the top "reply" button, that sort of looks like a bookmark icon)

    Thank you for clarification. I enabled email notifications as they were only showing after login in top right corner.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!