1.将发向HostA:PortA的请求转发到HostB:PortB
- iptables -t nat -A PREROUTING -p tcp -i eth0 -d HostA --dport PortA -j DNAT --to HostB:PortB
- iptables -t nat -A POSTROUTING -j MASQUERADE
- echo 1 > echo 1 > /proc/sys/net/ipv4/ip_forward
时间: 2024-10-10 15:01:20
1.将发向HostA:PortA的请求转发到HostB:PortB