ITPub博客

首页 > IT基础架构 > 网络安全 > Iptables 使用

Iptables 使用

原创 网络安全 作者:suzhouclark 时间:2011-11-03 13:17:29 0 删除 编辑
d[@more@]First you need to tell your kernel that you want to allow IP forwarding.
echo 1 > /proc/sys/net/ipv4/ip_forward

Then you'll need to configure iptables to forward the packets from your internal network, on /dev/eth1, to your external network on /dev/eth0. You do this will the following commands:

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
===============================================================
===============================================================

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9697/viewspace-1056118/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: Mail To Syntax
请登录后发表评论 登录
全部评论

注册时间:2010-03-26

  • 博文量
    124
  • 访问量
    335891