This article will guide you on how to enable #FirewallD logging for denied packets on #Linux. It is an important task to keep an eye on the rejected and dropped packets using FirewallD for #Linux system administrators.
To enable logging option you need to use #LOG iptables/kernel module. It turn on kernel logging of matching packets. When this option is set for a rule, the Linux kernel will print some information on all matching packets (like most IP header fields) via the kernel log.
To log a dropped packet in iptables:
1. iptables -N LOGGING: Create a new chain called LOGGING.
2. iptables -A INPUT -j LOGGING: All the remaining incoming packets will jump to the LOGGING chain.
3. line#3: Log the incoming packets to syslog (/var/log/messages).
To restart iptables:
i. To start firewall from a shell enter: # chkconfig iptables on. # service iptables start.
ii. To stop firewall, enter: # service iptables stop.
iii. To restart #firewall, enter: # service iptables restart.