We would like to use iptables to log all network connections except if the connecting address is A.B.C.D
or the connecting address is E.F.G.H
. These two addresses cannot be combined into a single CIDR range without the range including addresses we do want to include. I get part-way there by adding this iptables rule:
-I INPUT ! -s A.B.D.E -p tcp -m tcp --dport 3306 -m state --state NEW -j LOG --log-level 1 --log-prefix "New Connection "
However, this still logs connections from E.F.G.H
. Is there a way to get everything without logging either?
(These two addresses generate many connections and we don't need to log them.)