FreeBSD4.8 IPFW How to!
来源: 作者: 出处:综艺读书 2006-10-10测试机IP为211.162.77.73
网卡为:xl0
内核中加了流量管理,你可以根据实际需要增删。
uname -a
如果你用的是默认内核GENERIC则如下操作:
=============================================
|
|
|||
cp GENERIC ./GENERIC_IPFW
---------------------------------
ee GENERIC_IPFW 添加以下内容
options IPFIREWALL
options IPDIVERT
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIM99v=100
options IPSTEALTH
options ACCEPT_FILTER_DATA
options ACCEPT_FILTER_HTTP
options ICMP_BANDLIM
options DUMMYNET
---------------------------------
config ./GENERIC_IPFW
cd ../../compile/GENERIC_IPFW
make depend all install
---------------------------------
ee /etc/rc.conf 添加以下内容
##########IP-firewall#################
firewall_enable="YES"
firewall_script="/etc/rc.firewall"
firewall_type="/etc/ipfw.conf"
firewall_quiet="YES"
firewall_logging_enable="YES"
---------------------------------
ee /etc/syslog.conf 添加以下内容
!ipfw
*.* /var/log/ipfw.log
---------------------------------
ee /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 00005 deny tcp from any to any in tcpflags syn,fin
#######tcp#########
add 10000 allow tcp from 211.162.77.77 to 211.162.77.73 22 in
add 10001 allow tcp from any to 211.162.77.73 21,25,80,110,3306,5999 in
add 19997 check-state
add 19998 allow tcp from any to any out keep-state setup
add 19999 allow tcp from any to any out
######udp##########
add 20001 allow udp from any 53 to me in recv xl0
add 20002 allow udp from any to 211.162.77.73 53 in recv xl0
add 29999 allow udp from any to any out
######icmp#########
add 30000 allow icmp from any to any icmptypes 3,4
add 30001 allow icmp from any to any icmptypes 8 out
add 30002 allow icmp from any to any icmptypes 0,11 in
相关图文阅读
频道图文推荐
相关专题
阅读排行榜
·FreeBSD下构建安全的Web服务器 (10次浏览)
最新技术文档
·FreeBSD下构建安全的Web服务器 07-11
·在FreeBSD4.x中制作启动菜单 12-12
·在FREEBSD 5中使用MRTG画图 12-07
·浅谈FreeBSD 5.2常用操作的改变 12-02
·FreeBSD如何通过代理上网更新 11-21
·拿刀砍才能进freebsd系统的修复方法 10-27
·FreeBSD新手建议 10-14
·CERT? Advisory CA-2003-25 Buffer Overflow in Se 10-12
·FREEBSD下使用crunch集成编译程序 10-10
·FreeBSD下配置IPSec:WinXP------FreeBSD 10-10
·在FreeBSD4.x中制作启动菜单 12-12
·在FREEBSD 5中使用MRTG画图 12-07
·浅谈FreeBSD 5.2常用操作的改变 12-02
·FreeBSD如何通过代理上网更新 11-21
·拿刀砍才能进freebsd系统的修复方法 10-27
·FreeBSD新手建议 10-14
·CERT? Advisory CA-2003-25 Buffer Overflow in Se 10-12
·FREEBSD下使用crunch集成编译程序 10-10
·FreeBSD下配置IPSec:WinXP------FreeBSD 10-10
站内各频道最新更新文档
站内最新制作专题
热门关键字导读
站内频道文章精选
百度推荐,商机无限
搜索您感兴趣的内容




