LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-31-2009, 08:04 AM   #1
Asteroid
LQ Newbie
 
Registered: May 2007
Posts: 27

Rep: Reputation: 15
Coun Packets sent


hi Guys,

I have a simple question, How can we count packets towards the following IP from my server.


Quote:
netstat -a | grep 100.400.120.140

app.3528 10.11.12.14.46277 50376 0 50400 0 ESTABLISHED
app.53184 10.11.12.14.10000 49800 0 50400 0 ESTABLISHED
I wonder if we can count packets sent and received towards the above mentioned node.



Also ifconfig -a output is as:


Quote:
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
ce0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 2
inet 10.4.2.159 netmask ffffff80 broadcast 10.4.2.255
groupname mrbtipmp
ether 0:3:ba:84:f1:31
eri0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 10.4.2.129 netmask ffffff80 broadcast 10.4.2.255
groupname mrbtipmp
ether 0:3:ba:7b:10:84
eri0:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 3
inet 10.4.2.158 netmask ffffff80 broadcast 10.4.2.255
BR//Asteroid
 
Old 01-31-2009, 01:14 PM   #2
Udi
Member
 
Registered: Jan 2009
Posts: 165

Rep: Reputation: 44
I don't have a very specific answer for you, but I think that the only way you can count packets to a specific address is with wireshark (it's a network traffic sniffer).
 
Old 01-31-2009, 08:45 PM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,053

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
If you are happy playing around with iptables rulesets, you could count with it (although there are a number of situations in which this idea might not be a particularly good one; eg, you have no experience with iptables, you don't have an existing firewall, except set up via a gui tool that doesn't do this, its a production server that you daren't mess around with, etc, etc).
 
Old 02-01-2009, 12:44 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Asteroid
I have a simple question, How can we count packets towards the following IP from my server.
# tcpdump host 100.400.120.140

Upon termination (Ctrl+C), tcpdump will show the number of packets captured. If you need these tracked over a long period of time, you should probably point the output to a dump file. See the tcpdump(8) manpages.

---

P.S. 100.400 is not even a real network...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
IV packets kyd Linux - Networking 1 07-30-2005 01:21 PM
packets sent VS packets received fsasya Linux - Networking 0 07-18-2004 08:11 PM
encapsulating TCP packets in UDP packets... yoshi95 Programming 3 06-03-2004 03:53 PM
anybody know what these packets are ? mr.moto Linux - Security 3 03-25-2003 04:17 AM
packets per second ixion Linux - Networking 1 01-28-2003 07:28 AM


All times are GMT -5. The time now is 08:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration