Enabling logging on Iptables aids in tracking traffic to our server. We can also use this to estimate the number of hits generated by any IP address. This article will show you how to enable logging for all packets filtered by Iptables.
Table of Contents
Enable Iptables Logging
iptables -A INPUT -j LOG
We can also define the IP address or range from which the log will be generated.
iptables -A INPUT -s 192.168.10.0/24 -j LOG
Use –log-level followed by a number to define the level of LOG provided by Iptables.
iptables -A INPUT -s 192.168.10.0/24 -j LOG --log-level 4
We can also add a prefix to the generated logs to make it easier to find logs in a big file.
iptables -A INPUT -s 192.168.10.0/24 -j LOG --log-prefix '** SUSPECT **'
Check Iptables Log
Check logs On Ubuntu and Debian
tail -f /var/log/kern.log
Check Logs on CentOS/RHEL and Fedora
Change the name of the Iptables LOG file
Insert the following line:
service rsyslog restart
44 Best Free Online Movie Streaming Sites
If you searched for the best free online movie streaming sites, then you have reached the right place. Here’s a…