歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Iptables 實現端口轉發

Iptables 實現端口轉發

日期:2017/2/28 15:33:05   编辑:Linux教程

目標

將本機的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

Copyright © Linux教程網 All Rights Reserved