Index of /iptables
iptables stats
by Eric O'Callaghan
You need to have GeoIP working with PHP
This just shows what country (using GeoIP) and destination ports are most popular in iptables.log
This cron job should make an IP:PORT text file from your iptables.log every 10 minutes, so that this PHP script can read it
0,10,20,30,40,50 * * * * cat /var/log/iptables.log | grep TCP | awk {'print $9 $19'} | sed 's/SRC=//' | sed 's/DPT=/:/' | grep -v WINDOW | sort -n > /var/www/iptables.txt
This is strictly for IPv4; IPv6 is not supported
UDP traffic from iptables.log is not counted at all
If logrotate or whatever swaps out the iptables.log, it's obviously going to affect your stats