Redhat9+ADSL+IPTABLES+DHCPD解决方案
2010-09-27 12:21:54 来源:WEB开发网dns是否正常。
只有在确认adsl连接没问题后,我们才来配置iptables.
修改/etc/sysconfig/iptables(把原有的内容都删除),修改完如下
# firewall configuration written by lokkit
# manual customization of this file is not recommended.
# note: ifup-post will punch the current nameservers through the
# firewall; such entries will *not* be listed here.
*mangle
:prerouting accept [0:0]
:input accept [0:0]
:forward accept [0:0]
:output accept [0:0]
:postrouting accept [0:0]
*nat
:prerouting accept [0:0]
:postrouting accept [0:0]
:output accept [0:0]
[0:0]-a postrouting -o ppp0 -j masquerade
commit
*filter
:input accept [0:0]
:forward accept [0:0]
:output accept [0:0]
commit
修改/etc/sysctl.conf,把net.ipv4.ip_forward设置成1,如下:
net.ipv4.ip_forward = 1
如此一来,每次你重新启动机器或重新启动网络服务(/etc/init.d/network restart)时就会自动启动ip转发功能!
重起iptables服务:
/etc/rc.d/init.d/iptables restart
iptables -t nat -l -n 看代理规则是否正确,结果如下:
[root@localhost root]# iptables -t nat -l -n
chain prerouting (policy accept)
target prot opt source destination
chain postrouting (policy accept)
target prot opt source destination
masquerade all -- 0.0.0.0/0 0.0.0.0/0
编缉推荐阅读以下文章
- 暂无相关文章
- ››RedHat Linux 9下配置DHCP服务器教程
- ››Redhat9+ADSL+IPTABLES+DHCPD解决方案
- ››RedHat公司发布RHEL5.5企业版操作系统
- ››RedHatAS3.0下高可用性集群配置
- ››Redhatadvanceserver2.1集群的安装与管理
- ››redhatAS4.2 安装集群LVS
- ››redhat linux 下安装oracle 10g 的方法
- ››Redhat Enterprise Linux磁带机简单操作
- ››RedHatAS5整合Apache和Tomcat服务器应用
- ››Redhat红帽发布升级版企业Linux 5.2平台
- ››Redhat AS5 Squid透明代理配置过程解析
- ››Redhat Linux系统配置大量IP地址的方法
更多精彩
赞助商链接