Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
IIRC the first number is the number of packets that have matched that rule and the second number is the total size of those packets. As to whether those numbers are for inbound or outbound packets, it depends on which chain your looking at. If you look closely at the data from iptables -L -v it should give you the data from 3 different chains (INPUT, FORWARD, and OUTPUT)
Something like this:
Chain INPUT (policy DROP 501 packets, 74758 bytes)
pkts bytes
6321 1210K SOME RULE HERE
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes
0 0 ANOTHER RULE HERE
Chain OUTPUT (policy DROP 50954 packets, 3752K bytes)
pkts bytes
38639 16M EVEN MORE RULES HERE
The first two chains (INPUT and FORWARD) apply to packets coming into the machine and the OUTPUT chain applies to outbound packets. Look at the iptables man page for the rest of the output of the -v option.
If you have it set up strictly as a router that just forwards packets across to the other interface, I believe that will show you the traffic. Say you have 2 forwarding rules (one for incoming packets from the net and another to forward packets from your LAN out). The output of iptables -L -v will look like this:
Chain FORWARD (policy DROP 12345 packets, 56789 bytes)
pkts bytes
0 0 RULE TO MATCH INCOMING PACKETS FROM NET (RULE A)
0 0 RULE TO FORWARD PACKETS FROM LAN (RULE B)
The data associated with RULE A will be all your inbound traffic, while the data associated with RULE B will be outbound traffic. If you're looking for something to monitor traffic, that is probably a bad way to do it, as that is going to include crap like ARP requests, DNS queries, etc. If that is what you're looking for try doing a google search for "traffiic monitors AND linux" or try looking at freshmeat or sourceforge. I'm kind of confused about what you're asking, but I hope that helps.
Last edited by Capt_Caveman; 06-27-2003 at 10:59 PM.
Yes i want to do traffic monitorig per ip with mrtg. I hope i can find a way to send the data to mrtg with snmp, because my apache server is on other computer.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.