Iptables log connection

Here is an example to log new tcp connections (port 22):

-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j LOG –log-prefix “New Connection: ” –log-level 4

Here is an example to log any tcp connections:

iptables -A INPUT -m state --state NEW -j LOG --log-prefix "New Connection: "
iptables -A OUTPUT -m state --state NEW -j LOG --log-prefix "New Connection: "