CentOS 5
vi /etc/syslog.conf >> kern.* /home/log/kern.log #移除,自訂路徑
service syslog restart
#日誌轉發
iptables -A FORWARD -i $INIF -o $EXTIF -j LOG –log-prefix “INTERNET ACCESS: ” –log-level 6
讀取 iptables 規則
crontab -e
##每月的最後一分鐘
59 23 28-31 * * mv /home/log/kern.log /home/log/kern-$(date +%Y%m%d).log && touch /home/log/kern.log
Ubuntu 20.04
vi /etc/rsyslog.conf >> kern.* /home/log/kern.log #移除,自訂路徑
systemctl restart rsyslog.service
#Log Forward
iptables -A FORWARD -i $INIF -o $EXTIF -j LOG –log-prefix “INTERNET ACCESS: ” –log-level 6
讀取 iptables 規則
crontab -e
##每月的最後一分鐘
59 23 28-31 * * mv /home/log/kern.log /home/log/kern-$(date +%Y%m%d).log && touch /home/log/kern.log