服务器A
服务器B
如何使用 iptables 将流量从 eth0 转发到 wg0 10.66.66.2?我想将以下 TCP 和 UDP 端口转发到ServerB
TCP: 2302、27015-27030、27036-27037 UDP: 2302、4380、27000-27031、27036
我已经尝试过转发所有短信,但无济于事。
sudo iptables -A FORWARD --in-interface eth0 -j ACCEPT
sudo iptables --table nat -A POSTROUTING --out-interface wg0 -j MASQUERADE
Run Code Online (Sandbox Code Playgroud)
编辑:
iptables -L我需要注意遗留 iptables 和“正常”iptables 之间的歧义吗?
[root@vmd40065 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere …Run Code Online (Sandbox Code Playgroud)