Linux - SoftwareThis 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
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.
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!"
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
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
# :
# :
# :
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
# :
# :
# :
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.