1 路由模式设置: 混合模式
2 DNS设置: redir_host
1. 开启转发
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf && sysctl -p
2. NAT 规则
nft add table ip nat
nft add chain ip nat postrouting { type nat hook postrouting priority 100 \; }
nft add rule ip nat postrouting oifname "eth0" masquerade
3. 转发允许
nft add table ip filter
nft add chain ip filter forward { type filter hook forward priority 0 \; policy accept \; }
4. ShellCrash 作为透明网关的特殊配置(关键!)
nft add rule inet fw4 forward iifname "eth0" accept
5. 持久化
nft list ruleset > /etc/nftables.conf && systemctl enable --now nftables