Loading... # Raspi Openwrt ## Run In Docker ```bash # open mixed network on reaspi4 bash > sudo ip link set eth0 promisc on # create the macvlan network bash > docker network create -d macvlan -subnet=192.168.xxx.x/24 -gateway=192.168.xxx.1 -o parent=eth0 macnet bash > docker network ls # pull the image bash > docker pull sulinggg/openwrt:rpi4 # exec the container docker run –restart always –name openwrt -d –network macnet -v /etc/resolv.conf:/etc/resolv.conf –privileged sulinggg/openwrt:rpi4 /sbin/init # enter the container bash > docker exec -it openwrt sh # set up static ip bash > vim /etc/config/network ############################ config interface 'lan' option type 'bridge' option ifname 'eth0' option proto 'static' option ipaddr '192.168.xxx.10' option netmask '255.255.255.0' option ip6assign '60' option gateway '192.168.xxx.1' option broadcast '192.168.xxx.255' option dns '192.168.xxx.1' ############################ # restart container network bash > /etc/init.d/network restart ``` ## Note > Append this config to firewall rule if the openwrt without network ```config iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE ``` © Reprint prohibited Support Appreciate the author AliPayWeChat Like If you think my article is useful to you, please feel free to appreciate