Manage iptables log

Enable iptables log

-A INPUT -m state --state INVALID -j LOG --log-prefix "IPTABLES INPUT INVALID" --log-level 7 --log-tcp-options --log-ip-options
-A INPUT -i ! lo -j LOG --log-prefix "IPTABLES INPUT " --log-level 7 --log-tcp-options --log-ip-options
-A FORWARD -m state --state INVALID -j LOG --log-prefix "IPTABLES FORWARD INVALID" --log-level 7 --log-tcp-options --log-ip-options
-A FORWARD -p tcp -m tcp --dport 25 -j LOG
-A FORWARD -i ! lo -j LOG --log-prefix "IPTABLES FORWARD " --log-level 7 --log-tcp-options --log-ip-options
-A OUTPUT -m state --state INVALID -j LOG --log-prefix "IPTABLES OUTPUT INVALID" --log-level 7 --log-tcp-options --log-ip-options
-A OUTPUT -o ! lo -j LOG --log-prefix "IPTABLES OUTPUT " --log-level 7 --log-tcp-options --log-ip-options

Save log into a separate file

Add a line into /etc/syslog.conf:

kern.=debug /var/log/kern.debug.log

Create a log rotate configuration for kern.debug.log:

vim /etc/logrotate.d/kern.debug

/var/log/kern.debug.log {
rotate 7
daily
size 100M
compress
missingok
notifempty
postrotate
/sbin/killall -HUP syslogd
endscript
}
Advertisements

All about ggplot2 in R

Ggplot2 Guide

http://sharpstatistics.co.uk/r/ggplot2-guide/?utm_source=rss&utm_medium=rss&utm_campaign=ggplot2-guide

Manage linux logs with logrotate

Understand logrotate

http://www.rackspace.com/knowledge_center/article/understanding-logrotate-part-1

Logrotate and move to backup directory

http://www.ashishnepal.com/logrotate-and-move-to-backup-directory/

Links about OpenStack

How OpenStack works?

http://vmartinezdelacruz.com/in-a-nutshell-how-openstack-works/