zerotier 开启局域网访问

duizhang··1 min read

linux 内部跳板的局域网机器

添加Managed Routes

开启转发

sudo sysctl -w net.ipv4.ip_forward=1

设置iptables

PHY_IFACE=enp1s0; ZT_IFACE=ztbto2t2lm

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
apt install iptables-persistent 
bash -c iptables-save > /etc/iptables/rules.v4