首页 > 其他 > 详细

iptables常用命令

时间:2014-07-05 20:16:24      阅读:335      评论:0      收藏:0      [点我收藏+]

snat:

iptables -t nat -A POSTROUTING -s 192.168.1.14 -j SNAT --to-source 10.32.15.34

其中,-s 192.168.1.14是想要访问外网的内网主机的ip, --to-source 10.32.15.34为做nat的server的可以访问外网的ip地址

dnat

iptables -t nat -A PREROUTING -d 10.32.15.34 -p tcp -m tcp --dport 22222 -j DNAT --to-destination 192.168.1.14:22

-d 访问时的ip地址,即做nat server 的ip地址,--dport 做nat server上的端口, --to-destination 192.168.1.14:22 要做nat的目的地址

 

iptables常用命令,布布扣,bubuko.com

iptables常用命令

原文:http://www.cnblogs.com/lovemyspring/p/3822635.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!