Report this

What is the reason for this report?

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

Posted on November 12, 2017

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 111.111.111.111 -j LOG iptables -A INPUT -p icmp --icmp-type 8 --source 111.111.111.111 -j DROP service iptables save service iptables restart

Now to ping from 111.111.111.111 to my vps.

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

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

cat /var/log/iptables.log

Nothing in it.



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!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.