Chinaunix

标题: 关于IPFW与FREEBSD5的问题 [打印本页]

作者: tyyx    时间: 2003-01-29 17:27
标题: 关于IPFW与FREEBSD5的问题
以前用4.7按照iceblood的两片文章做了一个网关,今天升级到5.0感觉稳定了不少,问题也不少.....
第一个options                IPFIREWALL_VERBOSE     
       options                IPFIREWALL_VERBOSE_LIMIT=100  
在编译内核的时候通不过,不知道干什么用的取消掉了.
第二个,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
这几个什么意思啊?提示不能识别ipopt
在5.0中这几句该怎样写啊?
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
这几句也是,不能识别icmptypes....
能帮帮手吗?

作者: quakelee    时间: 2003-01-29 17:34
标题: 关于IPFW与FREEBSD5的问题
原帖由 "tyyx" 发表:
以前用4.7按照iceblood的两片文章做了一个网关,今天升级到5.0感觉稳定了不少,问题也不少.....
第一个options                IPFIREWALL_VERBOSE     
       options                IPFIREWALL_VERBOSE_LIMIT=100  
在编译内核的时候通不过,..........

IPFIREWALL_VERBOSE
IPFIREWALL_VERBOSE_LIMIT=100  这两项是用来限定,
比如你自己添加一个新的规则,未指定规则编号的话,将会在最后一条规则的编号后面加上limit后面规定的数字产生新的编号
后面那几项确实是不能用了IPFW2开始规则更新了,去看看man 8 ipfw吧,说了也说不清楚
作者: tyyx    时间: 2003-01-29 17:59
标题: 关于IPFW与FREEBSD5的问题
谢谢回复!
这个网关我是用的2G的硬盘,装了src和ports后硬盘就差不多了,没装man...
呵呵,奇怪的是google中有关ipfw2的中文资料是在是太少了....
作者: quakelee    时间: 2003-01-29 18:01
标题: 关于IPFW与FREEBSD5的问题
你不知道freebsd.org上面有web界面的man page么?
作者: tyyx    时间: 2003-01-29 18:01
标题: 关于IPFW与FREEBSD5的问题
我在编译内核的时候加上了options                IPFIREWALL      
options                IPDIVERT       那现在是ipfw还是ipfw2在工作啊.....
作者: tyyx    时间: 2003-01-29 18:11
标题: 关于IPFW与FREEBSD5的问题
[quote]原帖由 "quakelee"]你不知道freebsd.org上面有web界面的man page么?[/quote 发表:

在看,谢谢!
作者: shen2k    时间: 2003-01-29 18:17
标题: 关于IPFW与FREEBSD5的问题
老兄:
用ipfilter吧。ipfw应该都过时了
作者: tyyx    时间: 2003-01-29 18:33
标题: 关于IPFW与FREEBSD5的问题
ipopt 改成ipoptions就行.icmptypes 不知道怎么办
作者: quakelee    时间: 2003-01-29 19:55
标题: 关于IPFW与FREEBSD5的问题
原帖由 "shen2k" 发表:
老兄:
用ipfilter吧。ipfw应该都过时了

ipf我老觉得用的不太直观,在说了ipfw为什么过时了?
据我所知ipfw2的功能比ipf多:)
作者: tyyx    时间: 2003-01-29 22:09
标题: 关于IPFW与FREEBSD5的问题
原帖由 "shen2k" 发表:
老兄:
用ipfilter吧。ipfw应该都过时了

讲实话,不会用......现在都是先照葫芦画瓢....
作者: quakelee    时间: 2003-01-29 22:13
标题: 关于IPFW与FREEBSD5的问题
我觉得ipfw用起来简单点,不过ipf也有很多狂热支持者hoho~
ipfw2出来以后功能还是很不错的
作者: MaxBSD    时间: 2003-01-29 22:14
标题: 关于IPFW与FREEBSD5的问题
这用ipf很容易实现,看看我的。

# allow certain classes of ICMP
pass in quick  proto icmp all icmp-type 0 group 100
pass in quick  proto icmp all icmp-type 3 group 100
pass in quick  proto icmp all icmp-type 11 group 100
block in log proto icmp all group 100

ipf想用Bandwidth管制的可以结合Altq。ipfw实在是过时了。
作者: quakelee    时间: 2003-01-29 22:19
标题: 关于IPFW与FREEBSD5的问题
有这么严重么?max看新的man page了么ipfw2的?
各种底层的封包好像ipf不行吧?
作者: MaxBSD    时间: 2003-01-29 22:21
标题: 关于IPFW与FREEBSD5的问题
最后上一贴,过年咯。

Altq的安装

HOWTO install ALTQ on FreeBSD 4.3
27-May-2001

this howto was used to install altq on a stock standard freebsd 4.3 clean installation, presuming you installed the kernel sources in /usr/src directory

cd /usr/src

fetch or wget is your friend, when downloading files. these urls were for the current distribution as of this date

fetch ftp://ftp.csl.sony.co.jp/pub/kjc/altq-3.0.tar.gz

fetch ftp://ftp.csl.sony.co.jp/pub/kjc/altq-3.0-sys-altq-freebsd-4.3.patch

# unpackage the archive

gzip -d altq-3.0.tar.gz

tar -xvf altq-3.0.tar

# rename the new patch for freebsd 4.3

cp altq-3.0-sys-altq-freebsd-4.3.patch   altq-3.0/sys-altq/sys-altq-freebsd-4.3.patch

# patch the kernel and altq src (a backup is made).

# it helps if you have done a 'make clean' recently (optional).

mkdir sys-altq

cd sys

tar cvf - . | (cd ../sys-altq; tar xf -)

cd /usr/src/sys-altq

Now, apply the actual patch itself

patch -p < /usr/src/altq-3.0/sys-altq/sys-altq-freebsd-4.3.patch

# should say something like this after patching and completing successfully


Hunk #6 succeeded at 2389.
Hunk #7 succeeded at 2846.

mkdir altq

cp /usr/src/altq-3.0/sys-altq/altq/* altq/

kame provides a default kernel config file called ALTQ. you may merge your KERNEL config with ALTQ, the only options i needed to ensure i was alright so far.. ymmv or you may not need these. incidentally, some may not approve, but i compiled in ipfilter support and the two coexist quite happily.

cd i386/conf/

cp ALTQ ALTQ.mybackup

vi ALTQ

options SOFTUPDATES

maxusers 64

:wq

Finish compiling the altq tools

config ALTQ

cd ../../compile/ALTQ

make depend

make clean

make

  

# keep a backup of your currently booting kernel

cp /kernel /kernel.mybackup

# install the new kernel which should now include altq support

make install


reboot using the new kernel now
sync

reboot

if at this point all succeeded and rebooted

# finish setting up altq

cd /usr/src/altq-3.0

sh MAKEDEV.altq all

make

make install

# now create a suitable configuration for each nic, I used ed1
# save this file as /etc/altq.conf the default configuration file




--------------------------------------------------------------------------------

# sample configuration file for 56k link
#
interface ed1 bandwidth 33K cbq
class cbq ed1 root NULL pbandwidth 100

#

# meta classes

#

class cbq ed1 ctl_class root pbandwidth 10 control

# CBQ/TYPE, Iface, Name, Parent/Null

class cbq ed1 fast_class root borrow pbandwidth 70
filter ed1 fast_class 0 0 0 53 17 # dns
filter ed1 fast_class 0 0 0 53 6 # dns
filter ed1 fast_class 0 0 0 6667 6 # irc
filter ed1 fast_class 0 6667 0 0 6 # irc
filter ed1 fast_class 0 0 0 22 6 # ssh
filter ed1 fast_class 0 22 0 0 6 # ssh

class cbq ed1 slow_class root borrow pbandwidth 15 default



--------------------------------------------------------------------------------

# at this point you should be able to start using altq

# for bandwidth shaping and prioritising.

# start the daemon

/usr/local/sbin/altqd

# use this to dump statistics occasionally

/usr/local/bin/altqstat -c 2



See: http://www.csl.sony.co.jp/person/kjc/kjc/software.html#ALTQ
作者: MaxBSD    时间: 2003-01-29 22:22
标题: 关于IPFW与FREEBSD5的问题
原帖由 "quakelee" 发表:
有这么严重么?max看新的man page了么ipfw2的?
各种底层的封包好像ipf不行吧?


没很详细看,ipfw2是stateful的吗?不是的话就免看了。
作者: quakelee    时间: 2003-01-29 22:24
标题: 关于IPFW与FREEBSD5的问题
看来我有必要学习一下ipf之后再来讨论那个比较好:)
作者: MaxBSD    时间: 2003-01-29 22:38
标题: 关于IPFW与FREEBSD5的问题
原帖由 "quakelee" 发表:
看来我有必要学习一下ipf之后再来讨论那个比较好:)
嗯,有必要。比如ipf可以在很多平台上用(Net, Free, Open, Solaris),如果你同时用几个系统的话维护一个rule set就可以了,ipfw暂时只在Free上有。

你说ipfw比ipf直观可能是没用过ipfstat -t。
作者: quakelee    时间: 2003-01-29 23:11
标题: 关于IPFW与FREEBSD5的问题
原帖由 "MaxBSD" 发表:
牛?斜匾?1热鏸pf可以在很多平台上用(Net, Free, Open, Solaris),如果你同时用几个系统的话维护一个rule set就可以了,ipfw暂时只在Free上有。

你说ipfw比ipf直观可能是没用过ipfstat -t。


不要光说我,你研究一下ipfw2吧
嘻嘻
作者: 红袖添香    时间: 2003-02-01 18:42
标题: 关于IPFW与FREEBSD5的问题
[quote]原帖由 "MaxBSD"]你说ipfw比ipf直观可能是没用过ipfstat -t。[/quote 发表:


就是那个象 top 一样的东东,是挺好的~

不过 Darren Reed 的 license 问题最终害了自己,最终导致 OpenBSD 用户放弃了 ipfilter,现在大概只有 2.x 以前的用户还在用它,而多数都改用 pf 了。
作者: quakelee    时间: 2003-02-01 19:45
标题: 关于IPFW与FREEBSD5的问题
原帖由 "红袖添香" 发表:


就是那个象 top 一样的东东,是挺好的~

不过 Darren Reed 的 license 问题最终害了自己,最终导致 OpenBSD 用户放弃了 ipfilter,现在大概只有 2.x 以前的用户还在用它,而多数都改用 pf 了。


红袖jj
pf是什么,我没听说过,我觉得ipfw挺好用的,上手很快的,ipf好像有点乱,回头有机会试试
作者: 红袖添香    时间: 2003-02-01 19:54
标题: 关于IPFW与FREEBSD5的问题
原帖由 "quakelee" 发表:

红袖jj
pf是什么,我没听说过,我觉得ipfw挺好用的,上手很快的,ipf好像有点乱,回头有机会试试


pf 是 packet filter,是 openbsd 下才有的。我觉得很好用。
作者: quakelee    时间: 2003-02-01 19:57
标题: 关于IPFW与FREEBSD5的问题
原帖由 "红袖添香" 发表:


pf 是 packet filter,是 openbsd 下才有的。我觉得很好用。


这么好,不过还是希望啥时候免费的火墙能提供预警功能
嘻嘻
作者: 红袖添香    时间: 2003-02-01 20:23
标题: 关于IPFW与FREEBSD5的问题
原帖由 "quakelee" 发表:
这么好,不过还是希望啥时候免费的火墙能提供预警功能
嘻嘻


最好还有发SMS?
作者: quakelee    时间: 2003-02-01 20:30
标题: 关于IPFW与FREEBSD5的问题
原帖由 "红袖添香" 发表:


最好还有发SMS?


哎哟你怎么知道我要说这个,唉~
相见恨晚哈哈哈




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2