LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 09-06-2014, 06:12 AM   #1
RHCE_ran
Member
 
Registered: Oct 2013
Posts: 90

Rep: Reputation: Disabled
Confusion on output given by netstat


I gave the following commands on my production server with the outputs as below:

1) netstat -tulpn | wc –l
151

2) netstat -tupn | wc –l
139

Now the output of the 1st command is higher than the 2nd command. My understanding is that the port should be first open and then listening which should mean that 2nd command should give a higher value than command 1. Are there 3 states of a port which are

1) Open
2) Listening
3) Closed?

So is the transition between the ports from open->listening->closed as a life cycle of transitions? means that the port is first open, then listening & finally closed. Or is it that the status of a port can be straight from listening to closed.

I hope my question is clear of not much clarity in the output of netstat command.

Requesting a reply to my post.

Regards
 
Old 09-07-2014, 03:39 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
You have 2 different commands. Intentional?

1) netstat -tulpn
2) netstat -tupn
 
Old 09-08-2014, 04:51 AM   #3
RHCE_ran
Member
 
Registered: Oct 2013
Posts: 90

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
You have 2 different commands. Intentional?

1) netstat -tulpn
2) netstat -tupn
Thanks for your answer but request you to please give more details.

Regards
 
Old 09-08-2014, 06:16 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
more details on what?
open and listening are the same state!
you ought to save the output of the two commands (you executed) and compare them to find out the differences.
 
Old 09-09-2014, 02:58 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
From the netstat man page

Quote:
-l, --listening
Show only listening sockets. (These are omitted by default.)
That's why I asked.
 
  


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
netstat output rob.rice Linux - Networking 2 04-29-2007 09:18 AM
Netstat output Raafi Linux - Security 4 05-24-2005 10:14 PM
What does this netstat output mean? Kovacs Linux - Security 2 01-25-2004 06:32 PM
netstat -l output help dai Linux - Security 2 07-02-2003 03:40 PM
netstat output... WeNdeL Linux - Networking 3 03-20-2003 09:45 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

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