LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-26-2003, 08:22 PM   #1
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Rep: Reputation: 15
iptable


i want to know what "iptables -L -v" tells me:
the first number is the output trafic or the input?

------------
sorry
stupid question.
pkts bytes
1715 111K

Last edited by cristi1979; 06-26-2003 at 08:27 PM.
 
Old 06-26-2003, 10:13 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
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.
 
Old 06-27-2003, 08:43 PM   #3
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
thanks

if my box is a router i can check the input/output from FORWARD chain, base on the -source/-destination ip?
 
Old 06-27-2003, 10:57 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
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.
 
Old 06-29-2003, 05:54 PM   #5
cristi1979
Member
 
Registered: Jun 2003
Posts: 71

Original Poster
Rep: Reputation: 15
thanks

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is an iptable? Baran Linux - Newbie 7 02-07-2005 05:14 PM
iptable summerfish Linux - Networking 1 07-16-2004 02:28 AM
iptable help Neomaster Linux - Security 5 05-29-2003 09:13 PM
Iptable Help cirkut5732 Slackware 4 04-10-2003 11:18 PM
iptable help Syntax Linux - General 1 12-29-2002 11:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration