1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| $ docker pull crazygit/lean-openwrt-x86-64
$ docker run --rm crazygit/lean-openwrt-x86-64 cat /etc/banner _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt 19.07.2, r10947-65030d81f3 -----------------------------------------------------
$ ifconfig
$ docker network create -d macvlan --subnet=192.168.2.0/24 --gateway=192.168.2.1 -o parent=enp6s0 openwrt-LAN
$ docker network ls |grep openwrt-LAN 21dcddacc389 openwrt-LAN macvlan local
$ docker run --restart always --name openwrt -d --network openwrt-LAN --privileged crazygit/lean-openwrt-x86-64
$ docker ps -a
$ docker exec -it openwrt /bin/sh $ vi /etc/config/network
config interface 'lan' option type 'bridge' option ifname 'eth0' option proto 'static' option ipaddr '192.168.2.6' option netmask '255.255.255.0' option gateway '192.168.2.1' option dns '192.168.2.1' option broadcast '192.168.2.255' option ip6assign '60'
$ /etc/init.d/network restart
ip link add link enp6s0 vLAN type macvlan mode bridge ip addr add 192.168.2.7/24 brd + dev vLAN ip link set vLAN up
ip route replace default via 192.168.2.6 dev vLAN
ip route del default ip route add default via 192.168.2.6 dev vLAN
ip route replace default via 192.168.2.1 dev enp6s0
default via 192.168.2.1 dev enp6s0 onlink
echo "nameserver 192.168.1.6" > /etc/resolv.conf
|