威联通docker openwrt 旁路由
前言
春节期间身边只有这台威联通ts-216了,uu加速器手机版貌似只能加速switch,加速xbox似乎只能用uu加速盒或者路由器。于是研究一下在威联通nas自带的docker上安装openwrt,并安装一下uu加速器。
步骤
- 打开网卡混杂模式
| 1 | ip link set eth0 promisc on | 
- 创建macvlan
主路由的ip是192.168.2.1
| 1 | docker network create -d macvlan --subnet=192.168.2.0/24 --gateway=192.168.2.1 -o parent=eth0 macnet | 
- docker导入openwrt镜像
从openwrt官网下载64位的armvirt版本的default-rootfs.tar.gz 现在uu加速器还不支持openwrt 22以上的,我就只下载21的了。
| 1 | docker import xxx.tar.gz openwrt | 
- 创建容器1 docker run --name openwrt --restart always -d --network macnet --ip=192.168.2.111 --privileged openwrt /sbin/init 
- 进入容器设置/etc/config/networknetwork内容1 docker exec -it 容器id /bin/sh 1 
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20config device 
 option name 'br-lan'
 option type 'bridge'
 list ports 'eth0'
 option ipv6 '0'
 option promisc '1'
 
 config interface 'lan'
 option proto 'static'
 option ipaddr '192.168.2.111'
 option netmask '255.255.255.0'
 option ip6assign '60'
 option device 'br-lan'
 option gateway '192.168.2.1'
 list dns '192.168.2.1'
 
 config device
 option name 'eth0'
 option ipv6 '0'
 option promisc '1'
- 重启容器
- 设置防火墙
 关闭syn-flood protection 设置forward为accept
- 添加iptables规则1 
 2iptables -t nat -I POSTROUTING -j MASQUERADE 
 iptables -t nat -A POSTROUTING -o br-lan -j SNAT --to 192.168.2.111
威联通docker openwrt 旁路由
https://www.huihongcloud.com/2024/02/15/qnap/威联通docker openwrt 旁路由/