码迷,mamicode.com
首页 > 系统相关 > 详细

Linux启用nat路由

时间:2014-05-25 04:51:21      阅读:398      评论:0      收藏:0      [点我收藏+]

标签:linux route

此配置为精简配置,若要基于安全考虑,请详细设置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

Linux启用nat路由

标签:linux route

原文地址:http://foolishfish.blog.51cto.com/3822001/1416726

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!