Linux启用nat路由

时间:2014-05-25 04:51:21   收藏:0   阅读:398

此配置为精简配置,若要基于安全考虑,请详细设置iptables的策略

eth0 为外网接口,eth1 为内网接口

intranet --> eth1 --> nat --> eth0 -->internet

vim /etc/sysctl.conf
    net.ipv4.ip_forward=1
sysctl -p
iptables -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t filter -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -t filter -A FORWARD -o eth1 -i eth0 -j ACCEPT
service iptables save

本文出自 “foolishfish” 博客,请务必保留此出处http://foolishfish.blog.51cto.com/3822001/1416726

Linux启用nat路由,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!