kaaass / ZerotierFix

An unofficial Zerotier Android client patched from official client
GNU General Public License v2.0
1.67k stars 193 forks source link

[求助] 能当作路由,加入手机热点的其他设备能进入一个子网并激活bridge模式吗? #26

Closed YunofHD closed 1 year ago

YunofHD commented 1 year ago

如标题所示,请问能这么操作吗?把手机当作一个zerotier路由设备?

kaaass commented 1 year ago

由于 Android 系统对 VpnService 有限制,因此单凭借 Zerotier Fix 应该是不可以的。但是如果 Root 了的话可以尝试 VPN Hotspot 之类的程序。

2335662257 commented 4 months ago

安卓手机root后执行以下脚本即可(记得在zt上配置路由): sysctl -w net.ipv4.ip_forward=1 iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t raw -F iptables -t raw -X iptables -t security -F iptables -t security -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT PHY_IFACE=wlan0; ZT_IFACE=tun0 iptables -t nat -A POSTROUTING -o $PHY_IFACE -j MASQUERADE iptables -A FORWARD -i $PHY_IFACE -o $ZT_IFACE -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT ip rule add from all lookup main pref 1