How do I get the number of (currently) established TCP connections for a specific port?
I have managed to get counters for traffic working by doing i.e for outgoing RTMP.
iptables -N $CHAIN
iptables -I OUTPUT -j $CHAIN
iptables -A $CHAIN -p tcp --sport 1935
iptables-save
But now i need the number of current (not a counter) connections, for each protocol
I can get the total number with: netstat -ant | grep ESTABLISHED | wc -l
Can anyone help? Im not an iptables guru.