I’ve been trying to log iptables to a file. from my understanding its suppose to log to kern.log or messages but that doesn’t seem to be happening. when using the Digital Ocean console when inputting ‘iptables -A INPUT -j LOG’ it’ll start logging the NIC but outputs it to the console not to kern.log or messages. even adding ‘kern.warning /var/log/iptables.log’ to rsyslog yields the same results. What am I doing wrong or how can I monitor traffic and log to file as this is how I was monitoring traffic and rejecting IPs via fail2ban and log files with regular expressions but that doesn’t seem to work anymore. any help would be appreciated. Thanks.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.