我正在尝试从一台服务器转发到另一台服务器。我尝试了许多 iptables 命令,但它们不起作用。难道我做错了什么?
这是我的设置:
我试过这些命令:
iptables -t nat -A PREROUTING -p tcp --dport 25 -j DNAT --to-destination 2.2.2.2:15324
iptables -A FORWARD -d 2.2.2.2 -p tcp --dport 15324 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Run Code Online (Sandbox Code Playgroud)
iptables -t nat -nvL
Chain PREROUTING (policy ACCEPT 459 packets, 17802 bytes) pkts bytes target prot opt in out source destination 19 1088 DNAT tcp -- * * 0.0.0.0/0 …