pix防火牆端:centos
logging on //打開日誌tcp
logging host log 192.168.56.18 //指定日誌主機ide
logging trap debugging //指定日誌消息的級別post
no logging message 106011 //關閉用戶經過WEB訪問時重置的日誌信息(因數據量較大,對本人無用)測試
ASA防火牆(7.0以上)debug
logging enablerest
logging timestamp日誌
logging standbyip
logging trap debugging //指定日誌消息的級別it
logging history debugging
logging host inside 192.168.56.18 //指定日誌主機
centos端:
打開防火牆514端口。(測試時本人關閉防火牆)
touch /var/log/pix.log //創建日誌名稱
修改rsyslog配置
vi /etc/sysconfig/rsyslog
SYSLOGD_OPTIONS="-c 2 -r -x -m 0"
KLOGD_OPTIONS="-x"
修改rsyslog.conf配置
vi /etc/rsyslog.conf
#pix firewall syslog messages
local4.debug /var/log/pix.log
# Provides UDP syslog reception
$ModLoad imudp //去掉註釋
$UDPServerRun 514 //去掉註釋
# Provides TCP syslog reception
$ModLoad imtcp //去掉註釋
$InputTCPServerRun 514 //去掉註釋
修改logrotate.conf配置
vi /etc/logrotate.conf
#/var/log/pix.log
/var/log/pix.log {
daily //天天一次
dateext //按日期命名
create
rotate 7 //7次一循環,即保留7個文件
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
/etc/init.d/rsyslog restart 重啓日誌系統(service rsyslog restart)