Go Back   Computer Forums > General Computing > Networking | DNS
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 01-04-2012, 03:30 AM   #1
Baseband Member
 
Join Date: Nov 2011
Posts: 29
Default Netstat prob

They say that netstat helps us in listing open and closed ports....I'm totally dumb about it...

For Example - 'netstat' simply gives a long output but I'm giving the a small part of the output here (the name of my lappie is Soumik-pc) :

TCP 117.201.105.152:1927 maa03s05-in-f21:https ESTABLISHED
TCP 117.201.105.152:1933 searchsites:http TIME_WAIT
TCP 117.201.105.152:1956 static:http ESTABLISHED
TCP 117.201.105.152:1957 103.5.198.219:http CLOSE_WAIT
TCP 117.201.105.152:1958 resinapps2:http TIME_WAIT
TCP 117.201.105.152:1961 resinapps2:http TIME_WAIT
TCP 127.0.0.1:1748 soumik-PC:1749 ESTABLISHED
TCP 127.0.0.1:1749 soumik-PC:1748 ESTABLISHED


How to list the open ports from here?
__________________

Soumikbhat is offline   Reply With Quote
Old 01-04-2012, 03:34 AM   #2
Baseband Member
 
Join Date: Nov 2011
Posts: 29
Default Re: Netstat prob

I think I'd better post the entire output as a file attachment - this output here looks too clumsy!
Attached Files
File Type: txt netstat.txt (2.1 KB, 5 views)
__________________

Soumikbhat is offline   Reply With Quote
Old 01-04-2012, 10:47 AM   #3
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: Netstat prob

Hi,

Well here is everything in that file.

Code:
Active Connections
  Proto  Local Address          Foreign Address        State
  TCP    117.201.105.152:1282   213:http               CLOSE_WAIT
  TCP    117.201.105.152:1745   maa03s05-in-f29:https  ESTABLISHED
  TCP    117.201.105.152:1746   maa03s05-in-f21:https  ESTABLISHED
  TCP    117.201.105.152:1854   maa03s05-in-f20:http   ESTABLISHED
  TCP    117.201.105.152:1856   searchsites:http       ESTABLISHED
  TCP    117.201.105.152:1865   static:http            ESTABLISHED
  TCP    117.201.105.152:1869   static:http            ESTABLISHED
  TCP    117.201.105.152:1872   maa03s05-in-f25:http   ESTABLISHED
  TCP    117.201.105.152:1873   maa03s05-in-f0:http    ESTABLISHED
  TCP    117.201.105.152:1875   maa03s05-in-f25:http   ESTABLISHED
  TCP    117.201.105.152:1878   maa03s05-in-f27:http   ESTABLISHED
  TCP    117.201.105.152:1881   a118-214:http          ESTABLISHED
  TCP    117.201.105.152:1886   66.151.153.11:http     ESTABLISHED
  TCP    117.201.105.152:1890   media:http             ESTABLISHED
  TCP    117.201.105.152:1893   maa03s05-in-f27:http   ESTABLISHED
  TCP    117.201.105.152:1894   maa03s05-in-f27:http   ESTABLISHED
  TCP    117.201.105.152:1895   static:http            ESTABLISHED
  TCP    117.201.105.152:1897   beacon:http            ESTABLISHED
  TCP    117.201.105.152:1900   a118-214:http          ESTABLISHED
  TCP    117.201.105.152:1922   media:http             ESTABLISHED
  TCP    117.201.105.152:1923   media:http             ESTABLISHED
  TCP    117.201.105.152:1924   maa03s04-in-f19:https  ESTABLISHED
  TCP    117.201.105.152:1926   maa03s05-in-f0:http    ESTABLISHED
  TCP    117.201.105.152:1927   maa03s05-in-f21:https  ESTABLISHED
  TCP    117.201.105.152:1933   searchsites:http       TIME_WAIT
  TCP    117.201.105.152:1956   static:http            ESTABLISHED
  TCP    117.201.105.152:1957   103.5.198.219:http     CLOSE_WAIT
  TCP    117.201.105.152:1958   resinapps2:http        TIME_WAIT
  TCP    117.201.105.152:1961   resinapps2:http        TIME_WAIT
  TCP    127.0.0.1:1748         soumik-PC:1749         ESTABLISHED
  TCP    127.0.0.1:1749         soumik-PC:1748         ESTABLISHED
To start with this is just showing all the connections that are open on you computer or that you have connected to.

I would start with looking at the manpage for netstat. Then if you still need help I will see what I can do for you.
__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 01-04-2012, 10:59 AM   #4
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: Netstat prob

Do you know how TCP/IP networking works,

where every communication coming from your PC has a source port, (where it's come from in the form IPaddressort) and a destination also in the format addressort?

that list is simply a list of what's connectted from where to what and the state of the connection.


I prefer using netstat -an to give an easier to read list.


TCP 192.168.16.173:64411 195.59.44.34:80 ESTABLISHED
TCP 192.168.16.173:64412 195.59.44.32:80 ESTABLISHED

This tells me that there is a (TCP) connection from my machine (192.168.16.173) to the server (195.59.44.34) on port (80) this is http. it tells me that the connection is established.

TCP [::]:80 [::]:0 LISTENING

this tells me that there is a TCP socket on my machine that is listening on port 80.

TCP 192.168.16.173:60311 65.55.8.8:443 CLOSE_WAIT

this tells me that there was a TCP connecttion from my machine to a remote server (65.55.8.8) on port 443, the state is close_wait, this means that all data has been transmitted and the port is ready to close.

for more information on the status have a look here: TCP Connection States and Netstat Output

does that make any more sense now?



Oh, one more thing to add, if you put netstat -n it tells you what process is using the connection as well..
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 01-07-2012, 11:33 AM   #5
Baseband Member
 
Join Date: Nov 2011
Posts: 29
Default Re: Netstat prob

So basically if I see only TCP and/or UDP in the output - that means only the ports used by TCP & UDP are open r8?
Soumikbhat is offline   Reply With Quote
Old 01-09-2012, 07:40 AM   #6
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: Netstat prob

yes.

if no UDP ports are listed, then no UDP ports are in use.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off



All times are GMT -5. The time now is 05:29 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0