##LAN 口
docker network create -d macvlan \
--subnet=192.168.1.0/24 \
--gateway=192.168.1.254 \
--subnet=fe80::/16 \
--gateway=fe80::1 \
-o parent=eth0 maclan
##WAN 口
docker network create -d macvlan \
--subnet=192.168.254.0/24 \
--gateway=192.168.254.1 \
--subnet=fe81::/16 \
--gateway=fe81::1 \
-o parent=eth1 macwan
docker run -d \
--restart=always \
--privileged \
--network maclan \
-v $PWD/openwrt/etc:/etc \
--name=openwrt \
rdvde/openwrt:latest \
/sbin/init
docker network connect macwan openwrt
docker exec -it openwrt /bin/sh
/etc/init.d/network restart
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
net.ipv6.conf.default.accept_ra=2
net.ipv6.conf.all.accept_ra=2
sysctl -p
网络-接口-添加新接口,名称wan,
协议pppoe,设备选eth1,保存后填写宽带账号密码
wan口高级设置-获取ipv6地址-自动,
ipv6分配长度64,dhcp等关闭
lan口高级设置-ipv6分配长度64,dhcp服务器-ipv6设置,
RA服务&DHCPv6服务-选混合或服务器模式,NDP代理-禁用
#编辑/etc/network/interfaces(eth0为对应内网网卡名称)
auto eth0
iface eth0 inet manual
auto macvlan
iface macvlan inet static
address 192.168.1.252
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameservers 192.168.1.254
pre-up ip link add macvlan link eth0 type macvlan mode bridge
post-down ip link del macvlan link eth0 type macvlan mode bridge
docker run -d \
--restart=always \
--privileged \
--network maclan \
--network macwan \
-v $PWD/openwrt/config:/etc/config \
-v $PWD/openwrt/crontabs:/etc/crontabs \
-v $PWD/openwrt/dropbear:/etc/dropbear \
-v $PWD/openwrt/rc.local:/etc/rc.local \
-v $PWD/openwrt/shadow:/etc/shadow \
-v $PWD/openwrt/sysctl.conf:/etc/sysctl.conf \
-v $PWD/openwrt/mihomo/profiles:/etc/nikki/profiles \
-v $PWD/openwrt/mihomo/subscriptions:/etc/nikki/subscriptions \
-v $PWD/openwrt/mihomo/proxies:/etc/nikki/run/proxies \
-v $PWD/openwrt/mihomo/rules:/etc/nikki/run/rules \
-v $PWD/openwrt/mihomo/cache.db:/etc/nikki/run/cache.db \
--ip 192.168.1.254 \
--name=openwrt \
--hostname owrt \
rdvde/openwrt:latest \
/sbin/init
Content type
Image
Digest
sha256:8f65ef97c…
Size
181.3 MB
Last updated
6 months ago
docker pull rdvde/openwrt