Skip to content

Instantly share code, notes, and snippets.

@BruceWind
Last active December 5, 2023 08:57
Show Gist options
  • Save BruceWind/2a7bf1c34b5eac7a5fd7047937af2443 to your computer and use it in GitHub Desktop.
Save BruceWind/2a7bf1c34b5eac7a5fd7047937af2443 to your computer and use it in GitHub Desktop.
run openwrt in docker

Ive looked at https://www.ahsup.top/post/linux/openwrt/ . and I established with these commands, which are different from setting on a raspberry pi. This is because my docker host is x86 ABI.

ip link set enp1s0 promisc on


docker network prune
docker network create -d macvlan --subnet=192.168.50.0/24 --gateway=192.168.50.1 -o parent=enp1s0 macnet


sudo docker run --restart always --name openwrt -d --network macnet --privileged  sulinggg/openwrt:x86_64 /sbin/init


nano  /etc/config/network
config interface 'lan'
        option ifname 'eth0'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.50.99'
        option gateway '192.168.50.1'
        option dns '192.168.50.1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment