Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

iptables logging output to custom file

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
kellyanneghj
Posts: 2
Joined: 2017-04-23 17:34

iptables logging output to custom file

#1 Post by kellyanneghj »

How do I log the results of my iptables logging to a custom file in /var/logs? I tried several different suggestions found via Google but none of them worked. For example, I tried the suggestions here:

https://unix.stackexchange.com/question ... r-iptables

but I am using LMDE2 and it uses systemd. I tried replacing syslog with a new systemd config file but that got me nowhere.

kellyanneghj
Posts: 2
Joined: 2017-04-23 17:34

Re: iptables logging output to custom file

#2 Post by kellyanneghj »

I figured it out:

To direct output of iptables logging do the following:

(1) go to the folder rsyslog.d
(2) create a blank text file with the name "10-iptables.conf". Note that the numeral ten here is vital because it tells the OS to processes this file first.
(3) in the file paste the following:

if ( $msg contains 'IN=' and $msg contains 'OUT=' )
then {
/var/log/iptables.log
stop
}

(4) then restart

sudo service rsyslog restart

This is the very last reply in the link I I posted in the OP but it is the only one that worked.

Post Reply