Всем привет!
Стоит FreeBSD 4.7
На ней поднят шлюз,NAT,ipfw,syslogd и еще многое...
Хочу понять как мне сделать так чтобы ipfw писал свои логи в /var/log/ipfw.log для всех правил, которые есть в rc.firewall
Все правила у меня написаны без использования слова log, т.е.
при такой строке ${fwcmd} add allow ip from 192.168.0.0/24 to 192.168.0.0/24
лог не ведется
а при такой строке ${fwcmd} add allow log ip from 192.168.0.0/24 to 192.168.0.0/24
лог ведется.
Так вот. Кто знает как сделать так, чтобы все пакеты которые попадают в Firewall отображались в /var/log/ipfw.log в независемости от того прошел пакет или был отброшен, так как нужна именно информация где видно какое правило какой пакет отбросило.
Ниже привожу данные файла /etc/syslog.conf# $FreeBSD: src/etc/syslog.conf,v 1.13.2.3 2002/04/15 00:44:13 dougb Exp $
#
# Spaces ARE valid field separators in this file. However,
# other *nix-like systems still insist on using tabs as field
# separators. If you are sharing this file between systems, you
# may want to use only tabs as field separators here.
# Consult the syslog.conf(5) manpage.
#*.* /var/log/all.log
*.err;kern.debug;auth.notice;mail.crit /dev/console
*.notice;kern.debug;lpr.info;mail.crit;news.err /var/log/messages
security.* /var/log/security
auth.info;authpriv.info /var/log/auth.log
mail.info /var/log/maillog
lpr.info /var/log/lpd-errs
cron.* /var/log/cron
*.emerg *
# uncomment this to log all writes to /dev/console to /var/log/console.log
#console.info /var/log/console.log
# uncomment this to enable logging of all log messages to /var/log/all.log
# touch /var/log/all.log and chmod it to mode 600 before it will work
#*.* /var/log/all.log
# uncomment this to enable logging to a remote loghost named loghost
#*.* @loghost
# uncomment these if you're running inn
# news.crit /var/log/news/news.crit
# news.err /var/log/news/news.err
# news.notice /var/log/news/news.notice
!startslip
*.* /var/log/slip.log
!pppd
*.* /var/log/ppp.log
!ftpd
*.* /var/log/ftpd
!ipfw
*.* /var/log/ipfw.logЗаранее спасибо за все Ваши ответы.
Надеюсь они меня спасут!!!
ipfw работает не в userspace и поэтому, приведённый тобой пример не работает.man ipfw
log [logamount number]
When a packet matches a rule with the log keyword, a message will
be logged to syslogd(8) with a LOG_SECURITY facility. The log-
ging only occurs if the sysctl variable net.inet.ip.fw.verbose is
set to 1 (which is the default when the kernel is compiled with
IPFIREWALL_VERBOSE ) and the number of packets logged so far for
that particular rule does not exceed the logamount parameter. If
no logamount is specified, the limit is taken from the sysctl
variable net.inet.ip.fw.verbose_limit. In both cases, a value of
0 removes the logging limit.Засим в /etc/syslog.conf
security.info /var/log/ipfw.log