WEB开发网
开发学院操作系统windows 2008 Redhat9+ADSL+IPTABLES+DHCPD解决方案 阅读

Redhat9+ADSL+IPTABLES+DHCPD解决方案

 2010-09-27 12:21:54 来源:WEB开发网   
核心提示: dns是否正常, 只有在确认adsl连接没问题后,Redhat9+ADSL+IPTABLES+DHCPD解决方案(5),我们才来配置iptables. 修改/etc/sysconfig/iptables(把原有的内容都删除),修改完如下 # firewall configuration writ

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

编缉推荐阅读以下文章

  • 暂无相关文章

上一页  1 2 3 4 5 6  下一页

Tags:Redhat ADSL IPTABLES

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接