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 05-22-2012, 09:44 PM   #1
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
list all connections to a specific port


is there a command I can use to list all connections made to a specific port such as port 5060? I want to list the clients not the services binded to the port, can netstat do this?


Thanks,

Wayne
 
Old 05-23-2012, 02:17 AM   #2
nikmit
Member
 
Registered: May 2011
Location: Nottingham, UK
Distribution: Debian
Posts: 178

Rep: Reputation: 34
cat /proc/net/ip_conntrack | grep sport=123 (or "dport=345") does the job on a debian system.
interesting to know if there is a more sofisticated way
 
Old 05-23-2012, 04:39 AM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

maybe "lsof" will help you:
Code:
root@~#>lsof -i :80
COMMAND   PID  USER   FD   TYPE DEVICE SIZE NODE NAME
httpd    1931  root    3u  IPv6   3153       TCP *:http (LISTEN)
httpd    9346 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   14809 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   16423 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   20864 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   25164 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   25581 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   26118 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   26251 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   26252 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   26253 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   26251 httpd   19u  IPv6 983561       TCP 192.168.0.10:http->1.2.3.4.dynamic.net:50453 (ESTABLISHED)
httpd   26252 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   26252 httpd   19u  IPv6 983623       TCP 192.168.0.10:http->1.2.3.4.dynamic.net:50456 (ESTABLISHED)
httpd   26253 httpd    3u  IPv6   3153       TCP *:http (LISTEN)
httpd   26253 httpd   19u  IPv6 983619       TCP 192.168.0.10:http->1.2.3.4.dynamic.net:50455 (ESTABLISHED)
see the outlined lines show connections to HTTP

Last edited by lithos; 05-23-2012 at 04:40 AM.
 
1 members found this post helpful.
  


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
List IP Adresses connected to specific Port militiaware Linux - Networking 1 10-25-2011 05:13 AM
Routing Specific Traffic Through Different Internet Connections afrorobot Linux - Networking 9 09-17-2008 04:57 PM
List Connections by Process? juanbobo Linux - Networking 3 05-30-2006 11:07 PM
FC4 forward specific incoming connections Letheli Linux - Networking 4 12-27-2005 04:36 AM

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

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