zerotier 开启局域网访问

duizhangduizhang
1 min read

zerotier 开启局域网访问

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
0
Subscribe to my newsletter

Read articles from duizhang directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

duizhang
duizhang