LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-19-2008, 02:46 AM   #1
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Rep: Reputation: 30
Port monitoring using netstat


Hi all,


How can I find out whether the port 8840 is up on my Linux box?
Code:
$ netstat -na |grep 8840
tcp        0      0 :::8840    :::*                  LISTEN
Is this enough to confirm , that the port 8840 is up? Is there any better option there with netstat to make sure the port is opened?


Thanks

Last edited by ZAMO; 08-19-2008 at 02:59 AM. Reason: typo
 
Old 08-19-2008, 02:52 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
A better way is
Code:
$ sudo lsof -nPi | grep \:<port number>
where <port number> would be 8840, or whatever you're looking for. That will tell if there's a process bound to that port. Whether it's "open" depends on your firewall configuration:
Code:
$ sudo iptables -nL
PS the output above indicates that 8840 is only bound to IPv6 addresses. Is there a typo, first you said 8840, then 8080. Which one are you looking for?

Last edited by chort; 08-19-2008 at 02:53 AM.
 
Old 08-19-2008, 02:58 AM   #3
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
Thank you for the suggestions..

Yes, I made a typo... Am looking for 8840
 
Old 08-19-2008, 08:17 AM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I usually do netstat -alnp | grep ::8840 that should return the process name that has the port open.


.i.e
Code:
it-etch:~# netstat -alnp | grep ::22

tcp6       0      0 :::22                   :::*                    LISTEN      3205/sshd
 
  


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
linux port usage (not listing in netstat outpit) Pico_01 Linux - General 3 07-08-2012 05:01 PM
Need help Monitoring RS232 Port delacr_a Linux - Hardware 1 06-08-2007 10:18 AM
USB Port Monitoring program?? funkymunky Linux - General 0 02-05-2005 10:12 AM
monitoring a port linuxboy69 Linux - General 4 11-18-2003 01:37 PM
netstat showing port 6000 mr.moto Linux - Networking 1 05-02-2002 10:37 PM

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

All times are GMT -5. The time now is 04:50 PM.

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