Skip to main content
added 122 characters in body
Source Link
sjas
  • 604
  • 10
  • 10
watch -n1 -d "iptables -tfilter -vnxL | grep -v -e pkts -evE Chain'pkts|Chain' | sort -nk1 | tacnk1hr | column -t" 

Keep in mind, this will only show stuff for the table filter.

Add -t nat (or whichever tableIf you use besides filter) to your iptables callwant all tables, to check the rules there.try this:

watch -n1 -d "(iptables -tfilter -vnxL;iptables -tnat -vnxL;iptables -tmangle -vnxL;iptables -traw -vnxL;iptables -tsecurity -vnxL) | grep -vE 'pkts|Chain' | sort -nk1,1hr | column -t" 
watch -n1 -d "iptables -vnxL | grep -v -e pkts -e Chain | sort -nk1 | tac | column -t" 

Keep in mind, this will only show stuff for the table filter.

Add -t nat (or whichever table you use besides filter) to your iptables call, to check the rules there.

watch -n1 -d "iptables -tfilter -vnxL | grep -vE 'pkts|Chain' | sort -nk1hr | column -t" 

Keep in mind, this will only show stuff for the table filter.

If you want all tables, try this:

watch -n1 -d "(iptables -tfilter -vnxL;iptables -tnat -vnxL;iptables -tmangle -vnxL;iptables -traw -vnxL;iptables -tsecurity -vnxL) | grep -vE 'pkts|Chain' | sort -nk1,1hr | column -t" 
Source Link
sjas
  • 604
  • 10
  • 10

watch -n1 -d "iptables -vnxL | grep -v -e pkts -e Chain | sort -nk1 | tac | column -t" 

Keep in mind, this will only show stuff for the table filter.

Add -t nat (or whichever table you use besides filter) to your iptables call, to check the rules there.