You are not logged in.
Hi
i am new to macvlan. I've created a docker macvlan of 192.168.4.0, and there is a container on that network at 192.168.4.2 that I need to be able to reach from my typical network (192.168.2.0)
i've figured out how to do that, but the following ip commands need to be executed every time i reboot. I am using systemd-networkd
Is there a way to make these persistent in the configuration, or is the right/best answer to simply create a systemd unit file?
ip link add mynet-shim link enp8s0 type macvlan mode bridge
ip addr add 192.168.4.3/32 dev mynet-shim
ip link set mynet-shim up
ip route add 192.168.4.2/32 dev mynet-shim
for reference, here is how i set up the docker macvlan. it is persistent.
docker network create -d macvlan -o parent=enp8s0 \
--subnet 192.168.0.0/16 \
--gateway 192.168.4.1 \
--ip-range 192.168.4.2/32 \
--aux-address 'host=192.168.4.3' \
mynet
I also have the necessary static route set on my router to direct 192.168.4.x traffic to my server. It all works. just want it to be persistent.
Offline
Did you take a look at the Wiki?
https://wiki.archlinux.org/title/System … LAN_bridge
Offline