首页 > 系统服务 > 详细

linux iptables 备忘

时间:2015-01-09 17:35:36      阅读:321      评论:0      收藏:0      [点我收藏+]
  1. 内网机器上网

    iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j SNAT -to-source 10.0.0.1

    or

    iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE


  2. 外部到内部映射

    端口映射

    iptables -t nat -A PREROUTING -d 10.0.0.1 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.100:80     

    IP 1v1

    iptables -t nat -A PREROUTING -d 10.0.0.2 -j DNAT --to-destination 192.168.1.100

    iptables -t nat -A POSTROUTING -s 192.168.1.100 -j SNAT --to-source 10.0.0.2

linux iptables 备忘

原文:http://xiaowei8.blog.51cto.com/2323881/1601153

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