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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!