Configure Protocols using iptables log file with ndpi

Sanshayan asked:

I am using iptables with ndpi to filter my network and add two rules to my iptables rules

they are

iptables -I INPUT -m ndpi --http -j LOG
iptables -I INPUT -m ndpi --google -j LOG

In my log file I can’t configure which log is for http and google protocols

My answer:


You can distinguish your log entries with --log-prefix. For instance:

iptables -I INPUT -m ndpi --google -j LOG --log-prefix "iptables INPUT: User went to Google: "

Remember to leave a space at the end of the prefix text, as it is prepended exactly as-is.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.