Why the ping action can't log into iptables.log?

November 12, 2017 1.2k views
Firewall Logging CentOS

My os :centos 7.
yum remove firewalld
I want to log all the ping from 111.1111.111.111 into iptables.log.

cat /etc/rsyslog.conf
kern.* /var/log/iptables.log

systemctl restart rsyslog

iptables -N LOGGING
iptables -A INPUT -j LOGGING
iptables -A INPUT -p icmp –icmp-type 8 –source -j LOG
iptables -A INPUT -p icmp –icmp-type 8 –source -j DROP
service iptables save
service iptables restart

Now to ping from to my vps.

  1. iptables -A INPUT -p icmp –icmp-type 8 –source -j DROP can work. ping PING ( 56(84) bytes of data. ^C — ping statistics — 23 packets transmitted, 0 received, 100% packet loss, time 22003ms

2.iptables -A INPUT -p icmp –icmp-type 8 –source -j LOG can’t work

cat /var/log/iptables.log

Nothing in it.

Be the first one to answer this question.