Quote:
Originally Posted by ivanatora
I have a linux gateway that serves 3-4 other PCs. I have one incoming line and I want to have graphical stats about total incoming speed.
|
Quote:
If you can help me think out a single iptables rule that can give me the number you would be great.
|
An
iptables rule does not require a targret; i.e. you don't need a
-j option on it. W/o a target it will just sit there and collect statistics for you. So If I understand your request and setup correctly, probably a single rule at the
beginning of the FORWARD chain something like
Code:
iptables -I FORWARD 1 -i <incoming interface> -d 192.168.0.0/24
would collect the statistics you want. I am assuming your incoming traffic is on a seperatate interface than your LAN. In addition or instead, you could match incoming with an address (such as ! 192.168.0.0/24, where the exclamation point means match anything else) or specifiy the output LAN interface with the
-o option.