问题原文
原帖链接 · Masood Lapeh · CC BY-SA 4.0
What is the iptables equivalent to the following?
socat TCP-LISTEN:8080 TCP:some-random-host-in-another-network.com:80
Now multiple clients can connect to port 8080 of this middle host to actually access some-random-host-in-another-network.com:80.
I'm asking to see whether it improves the latency and throughput.
已采纳解答
原帖链接 · Nikita Kipriyanov · CC BY-SA 4.0
Something like the following:
iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination some-random-host-in-another-network.com:80
iptables -t nat -A POSTROUTING -d some-random-host-in-another-network.com -p tcp --dport 80 -j MASQUERADE
(this is bare minimum, likely you'd want to add permitting rules into filter FORWARD and so on)
This would translate both addresses, source and destination. The "some-random-host-in-another-network.com" will see connections as coming from this host and hide the original source.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
