带有多个链路的iptables的stream量统计

我有一个Linux防火墙设置3区:
– LAN为绿色(192.168.0.0/24)
– WLAN为蓝色(192.168.1.0/24)
– DMZ橙色(192.168.2.0/24)

所有区域都有系统运行,我想知道每个系统正在产生的外部stream量。 做一些testing有/必须总是有一些内部stream量,因为外部设备上的vnstat显示不同的stream量帐户。

做一些研究,我结束了这样的事情(例如一个内部IP和只上传):

/sbin/iptables -N TRAFFICFILTERUP /sbin/iptables -I OUTPUT -j TRAFFICFILTERUP /sbin/iptables -A TRAFFICFILTERUP -d 127.0.0.0/8 -j RETURN /sbin/iptables -A TRAFFICFILTERUP -d 192.168.0.0/24 -j RETURN /sbin/iptables -A TRAFFICFILTERUP -d 192.168.1.0/24 -j RETURN /sbin/iptables -A TRAFFICFILTERUP -d 192.168.2.0/24 -j RETURN /sbin/iptables -A TRAFFICFILTERUP -j LOG /sbin/iptables -N TRAFFICUP /sbin/iptables -A TRAFFICFILTERUP -j TRAFFICUP /sbin/iptables -A TRAFFICUP -s 192.168.2.1 

结果:

 iptables -L TRAFFICUP -nvx Chain TRAFFICUP (1 references) pkts bytes target prot opt in out source destination 0 0 all -- * * 192.168.2.1 0.0.0.0/0 iptables -L TRAFFICFILTERUP -nvx Chain TRAFFICFILTERUP (1 references) pkts bytes target prot opt in out source destination 0 0 RETURN all -- * * 0.0.0.0/0 127.0.0.0/8 0 0 RETURN all -- * * 0.0.0.0/0 192.168.0.0/24 0 0 RETURN all -- * * 0.0.0.0/0 192.168.1.0/24 1349 271065 RETURN all -- * * 0.0.0.0/0 192.168.2.0/24 402 171503 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 LOG flags 0 level 4 401 171249 TRAFFICUP all -- * * 0.0.0.0/0 0.0.0.0/0 

为什么TRAFFICUP没有stream量? 任何build议或是整个方法错误?

 /sbin/iptables -I OUTPUT -j TRAFFICFILTERUP 

应该

 /sbin/iptables -I FORWARD -j TRAFFICFILTERUP