Ref: https://tecadmin.net/enable-logging-in-iptables-on-linux/
Enabling logging on iptables is helpful for monitoring traffic coming to our server. This we can also find the number of hits done from any IP. This article will help enable logging in iptables for all packets filtered by iptables.
Enable Iptables LOG
We can simply use following command to enable logging in iptables.
We can also define the source ip or range for which log will be created.
To define level of LOG generated by iptables us –log-level followed by level number.
We can also add some prefix in generated Logs, So it will be easy to search for logs in a huge file.
View Iptables LOG
After enabling iptables logs. check following log files to view logs generated by iptables as per your operating system.
On Ubuntu and Debian
iptables logs are generated by the kernel. So check following kernel log file.
No comments:
Post a Comment