|
|
本帖最后由 mantouboji 于 2026-7-20 14:02 编辑
最新结果。
网上做好的docker都是些很老的版本0.6.0什么的,自己重新搞了一下0.8.1的,完全靠环境变量来配置,arm、arm64和x86_64 三个平台统一。
tar文件放在百度网盘,自己选择下载。
https://pan.baidu.com/s/1Z6icTPtPpTDJQQEu2PpLKA?pwd=tssc 提取码: tssc
- # RouterOS script to use phantun
- #
- # Yao Fei
- #
- # Interface
- /interface veth add address=192.168.91.20/24 comment=Phantun gateway=192.168.91.1 name=veth-ph
- /interface bridge port add bridge=dockers interface=veth-ph
- #Route
- /ip route add comment=phantun dst-address=192.168.200.2/32 gateway=192.168.91.20
- #Container
- /container envs add key=REMOTE_HOST list=phantun_envs value=YOUR_REMOTE_HOST
- /container envs add key=REMOTE_PORT list=phantun_envs value=443
- # for multi interfaces
- #/container envs add key=TUN_LOCAL list=phantun_envs_2 value=192.168.202.1
- #/container envs add key=TUN_PEER list=phantun_envs_2 value=192.168.202.2
- # phantun
- /container add comment=Phantun envlists=phantun_envs file=yf-phantun-aarch64.tar interface=veth-ph name=phantun \
- logging=yes restart-interval=23h root-dir=/usb1-part1/phantun start-on-boot=yes
- #Wireguard
- /interface wireguard peers add endpoint-address=192.168.91.20 endpoint-port=51820
复制代码
—————————————— 华丽的分割线 ————————————————
折腾了好久,终于有所收获,先记录一下。
这里面解决的核心问题主要有两点:
第一,晚上很多docker镜像是为了在普通Linux主机上运行的,跟RouterOS环境有一点差异,当然你可以自己重新做一个,咱比较懒,不愿意,就用这些现成的。按照不同的镜像,直接篡改丫的entrypoint,或者定义cmd变量,绕过里面各种乱七八糟。
第二,phantun的数据是从里面的tun设备地址192.168.200.2发出的,在RouterOS下不能按照普通Linux的方式作iptables NAT, 所以一定要加一条到主机的路由项目,告诉RouterOS如何把返回的数据送进container
|
WireGuard, RouterOS, WireGuard, RouterOS, WireGuard, RouterOS, WireGuard, RouterOS, WireGuard, RouterOS, routeros portal, RouterOSsdwan, routeros key
|