demand
The delay between A and D is very high. It is necessary to reduce the delay between A and B and improve the access speed.
achieve purpose
Use C server to forward A’s traffic to B, and access D through B
path
Access terminal A - C server - B server - D target server
environment
CB server CentOS 7.6 64bit
iptables command
编辑"/etc/sysctl.conf",将net.ipv4.ip_forward改成1
sysctl -p
iptables -t nat -A PREROUTING -p tcp --dport 源端口 -j DNAT --to-destination 目标地址:目标端口
iptables -t nat -A POSTROUTING -j MASQUERADE