LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-04-2006, 05:34 PM   #1
rincewind
Member
 
Registered: Mar 2004
Posts: 32

Rep: Reputation: 15
Bandwith on a network card


Hello world!

Is there any good program running i bash or commando in linux where I can se how much one of my NICs send bytes and recived bytes over a timespan?

The machine im trying to this with is my home webserver, yet I can't find a suitable program to check this.. (webalizer only analyzis web trafic, I wanna do this on EVERY port (of coz, it would be nice to se how much bandwith it takes on diffrent port also)).

Does anyone know?

Regardz,
-- Rincewind
"If you run away, you live to run away another day!"
 
Old 06-04-2006, 06:28 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
I know this is going to sound geeky, but you can always use iptables. You can create dummy chains for a certain match of a packet (unless, of course, you already have such chains and don't need dummy ones). Netfilter keeps packet and byte counters for every chain (viewable with `iptables -nL CHAIN' and zeroed with `iptables -Z CHAIN').

So for example, if you want to see the amount of ingress traffic destined for port 80 on your webserver, you could either
  1. Create a dummy chain (if you already have a good ruleset that you don't want to disturb):
    Code:
    # Initialization stuff
    #         :
    #         :
    #         :
    
    # Create a dummy chain to `touch' while traversing the filters
    iptables -N WEBSERVER_IN
    iptables -A INPUT -p tcp --dport 80 -j WEBSERVER_IN
    
    # The rest of your normal rules, including the final
    # non-returning targets such as ACCEPT, DROP, or DENY
    #                         :
    #                         :
    #                         :
  2. Use an specific chain:
    Code:
    # Initialization stuff
    #         :
    #         :
    #         :
    
    # Create a chain to for the webserver
    iptables -N WEBSERVER_IN
    iptables -A INPUT -p tcp --dport 80 -j WEBSERVER_IN
    iptables -A WEBSERVER_IN -j ACCEPT
    
    # The rest of your normal rules, including the final
    # non-returning targets such as ACCEPT, DROP, or DENY
    #                         :
    #                         :
    #                         :
 
Old 06-04-2006, 06:33 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Not on an arbitrary port for an arbitrary time without special
tools/instructions.

ifconfig will tell you TX/RX since an interface was enabled.
You could use iptables LOG-target to record all packet sizes, though,
or use any of the traffic monitoring tools out there. Have a search
on http://freshmeat.net ... there's ipac-ng, for instance.


Cheers,
Tink
 
  


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
Slackware 10 network configuration. Problem with 8139 network card drivers ! Padmakiran Linux - Networking 8 03-27-2007 06:48 AM
linux shuts down built in network card then windows tells me network card is unplugge lesmoxhaybaker SUSE / openSUSE 8 08-29-2006 05:10 PM
3c905C network card in docking station. Cannot activate network device eth0. pathelms Linux - Networking 4 04-12-2006 02:55 PM
network card issue (the card itself no network problem) Youri Linux - Hardware 2 01-23-2006 08:58 AM
network card w/ bandwith limited? 4Gr Linux - Hardware 1 12-03-2004 04:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:42 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