7

iptables nat 端口映射转发

 3 years ago
source link: https://www.80shihua.com/archives/1370
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

iptables nat 端口映射转发

作者: dreamfly 分类: 未分类 发布时间: 2018-07-21 23:35

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE


//所有从eth0(外网卡)出来的数据包的源地址改成61.99.28.1
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to 61.99.28.1


//将外部服务器的ip访问转到目的ip端口
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 53 -j DNAT --to-destination 1.2.3.4:53

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK