- 论坛徽章:
- 0
|
我已安装好 IPFW 我用 IPFW的目的是 用他封闭所有的端口 只能用 22 80等端口
但是安好了以后 所有端口依然能访问
请问怎么才能把 默认的规则动作从 ``allow'' 改为 ``deny''
rc.conf
gateway_enable="YES" # 启动网关
firewall_enable="YES" # 激活firewall防火墙
firewall_script="/etc/rc.firewall" # firewall防火墙的默认脚本
firewall_type="/etc/ipfw.conf" # firewall自定义脚本
firewall_quiet="YES"
firewall_logging_enable="YES" # 启用firewall的log记录。
设置完成后我们再编辑/etc/syslog.conf文件:
ipfw.conf 设置是
######### TCP ##########
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 00005 deny tcp from any to any in tcpflags syn,fin
# 这5行是过滤各种扫描包
add 10001 allow tcp from any to 60.210.69.134 22 in
########## ICMP #########
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
add 30004 allow icmp from any to any icmptypes 11 in
用ipfw show 查看了显示 65535 3049 368228 allow ip from any to any 允许所有连接
请问我该怎么设置 才能屏蔽所有端口 只开自己需要的端口
我需要的端口是 22 80 81 等等!请大家帮忙解答下 该怎么设置
[ 本帖最后由 zjblove 于 2006-9-1 04:18 编辑 ] |
|