The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Capturing bad packets otheus IP Networking 1 10-15-2009 09:38 AM
using sed to replace a specific string on a specific line number using variables todd.cutting Shell Programming and Scripting 2 08-13-2009 09:40 PM
tcpdump -w file is not capturing all the packets radiatejava IP Networking 5 05-29-2009 08:36 AM
Reading and Manipulating captured packets (pflog file) PenguinDevil Security 0 12-29-2004 12:40 AM
NAT Packets/Port Openine MartinD IP Networking 3 08-21-2002 04:04 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-16-2009
lildee lildee is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 2
Help with capturing/reading total packets on specific port number

Hi guys,

I'm using a Linux system(Ubuntu) and I've been trying to find a method to read the total packets received/sent on a specific port (e.g port 80 or port 25) on a local machine. I can read the overall total packets received/sent from the /proc/net/dev file system. But what I can't do is read packets received/sent from a specific port. I don't think there is any information about total packets on a specific port in any of the /proc file system. So, what is the best way to get this information?

I would like a way to do this so that I can display the activity on a specific port for my program I'm working on. Thanks

---------- Post updated at 02:46 AM ---------- Previous update was at 02:34 AM ----------

Okay, i've found out that I can use tcpdump to do this. This can be one of the many ways. I would prefer a different method where I do not need to install packet capture libraries like libpcap for my program to work. Besides, I need to have root privilege to use libpcap. Any other ideas?

Last edited by lildee; 10-16-2009 at 08:59 AM..
  #2 (permalink)  
Old 10-16-2009
TonyFullerMalv's Avatar
TonyFullerMalv TonyFullerMalv is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 730
The iptables firewall can be made to simply log activity rather than actually filtering but it would need to load modules as root.
  #3 (permalink)  
Old 10-17-2009
lildee lildee is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 2
Thanks for the reply, I will look into iptables
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0