1

I currently have quite a few rules on our server and I use this to monitor it:

iptables -vL

This displays packets hitting each rule, however is there a way to only display DROP rules? I'm not interested in seeing ACCEPT rules etc as it takes up too much room.

1
  • 1
    try using grep to diplay only interesting lines?
    – bgtvfr
    Aug 31, 2016 at 9:42

1 Answer 1

3

Assuming you are using a shell script to execute this command and store the full output somewhere I would suggest using grep as bgtvfr suggested.

iptables -vL | grep DROP >> logfile.txt

1
  • As both btgvfr and inaki suggest, this is the UNIX way. +1 from me.
    – MadHatter
    Aug 31, 2016 at 10:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .