Skip to contentSkip to conversation

nfacct + ipset usage

DISCUSSION Arthur Titeica 1 participant 1 message Nov 4, 2012

lore
Share & tools
lore
#0 lore raw

Hello,

I'm trying to get some numbers regarding the usage of certain services (vnc and samba). For this I've created 2 accounting objects with nfacct and used the bellow iptables rules.

# nfacct add vnc-test
# nfacct add smb-test
# iptables -A FORWARD -m set --match-set test src \
                    -m set --match-set test dst \
                    -m nfacct --nfacct-name vnc-test \
                    -p tcp --dport 5900:5902
# iptables -A FORWARD -m set --match-set test src \
                    -m set --match-set test dst \
                    -m nfacct --nfacct-name smb-test \
                    -p udp -m multiport --dports 137,138
# iptables -A FORWARD -m set --match-set test src \
                    -m set --match-set test dst \
                    -m nfacct --nfacct-name smb-test \
                    -p tcp -m multiport --dports 139,445

However, something seems wrong as I get the same numbers for both objects:

{ pkts = 00000000000000040947, bytes = 00000000000036315309 } = vnc-test; { pkts = 00000000000000040947, bytes = 00000000000036315309 } = smb-test;

Is there something I'm missing?

nfacct v1.0.0
iptables v1.4.16.2
kernek 3.6.5

Thank you!

Signature · 1 line
Arthur Titeica