免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2188 | 回复: 5
打印 上一主题 下一主题

请教IPFW启动成功,还能PING。可是netstat -an 检测不到? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-06-15 13:39 |只看该作者 |倒序浏览
内核编制中打开下面的选项
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPFIREWALL_DEFAULT_TO_ACCEPT
编译重启。

编辑rc.conf 加入
gateway_enable="YES"
firewall_enable="YES"
firewall_script="/etc/rc.firewall"
firewall_type="/etc/ipfw.conf"
firewall_logging_enable="YES"
新建/etc/ipfw.conf 文件
add 00001 deny log ip from any to any ipopt rr
add 00002 deny log ip from any to any ipopt ts
add 00003 deny log ip from any to any ipopt ssrr
add 00004 deny log ip from any to any ipopt lsrr
add 30000 allow icmp from any to any icmptypes 3
add 30001 allow icmp from any to any icmptypes 4
add 30002 allow icmp from any to any icmptypes 8 out
add 30003 allow icmp from any to any icmptypes 0 in

重启后显示上面规则已经打开。
可是用在PING还能PING到,可是netstat -an 检测不到是谁在PING..
因为只当游戏服务器只要能防别人PING就可以了..
谢谢~

论坛徽章:
0
2 [报告]
发表于 2003-06-15 16:23 |只看该作者

请教IPFW启动成功,还能PING。可是netstat -an 检测不到?

ping是icmp包文的,所以你只需要:
ipfw add 00010 deny icmp from any to any
就ping不到了

论坛徽章:
0
3 [报告]
发表于 2003-06-15 16:36 |只看该作者

请教IPFW启动成功,还能PING。可是netstat -an 检测不到?

原帖由 "xiyang" 发表:
ping是icmp包文的,所以你只需要:
ipfw add 00010 deny icmp from any to any
就ping不到了
   

挡了网络不可达,网络重定向,超时之类的icmp报文不怎么好吧

楼主设了default to accept
规则又有
add 30002 allow icmp from any to any icmptypes 8 out
add 30003 allow icmp from any to any icmptypes 0 in

当然回显请求与应答能通过。把allow改成deny再试试

论坛徽章:
1
金牛座
日期:2014-05-29 15:55:47
4 [报告]
发表于 2003-06-15 17:53 |只看该作者

请教IPFW启动成功,还能PING。可是netstat -an 检测不到?

看来这位兄弟一半是参看我的文章来做,一半是参看别人的文章来做。
内核编制中打开下面的选项
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPFIREWALL_DEFAULT_TO_ACCEPT //这句是饶过默认的防火墙设置,也就是允许IPFW全开。你修改内核配置,完全照我的做来看看,相信效果就不同了。
编译重启。

论坛徽章:
0
5 [报告]
发表于 2003-06-15 19:58 |只看该作者

请教IPFW启动成功,还能PING。可是netstat -an 检测不到?

对对是的~
因为参考你文章的不能达到的目的,只好这样。。。。。

谢谢楼上各位,明天试一下!

如果我只让UDP 27015-27030<因为CS服务器就用到这几个端口>;
开放要加什么规则,谢谢!

论坛徽章:
0
6 [报告]
发表于 2003-06-16 08:55 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP