Iptables 实现端口转发

字体大小: 中小 标准 ->行高大小: 标准

目标

将本机的7088端口转发至其他主机

主机IP:1.1.1.1

目标主机IP和端口:2.2.2.2:1521

方法

iptables -t nat -A PREROUTING -p tcp -m tcp --dport 7088 -j DNAT --to-destination 2.2.2.2:1521

iptables -t nat -A POSTROUTING -p tcp -m tcp --dport 1521 -j SNAT --to-source 1.1.1.1

service iptables save

service iptables restart

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/65441.html