No Account Yet?

You are not logged in.

Add to: JBookmarks Add to: Facebook Add to: Windows Live Add to: Digg Add to: Del.icoi.us Add to: Reddit Add to: StumbleUpon Add to: Slashdot Add to: Netscape Add to: Furl Add to: Yahoo Add to: Blogmarks Add to: Technorati Add to: Newsvine Add to: Google Information
Using netstat to find active network connections E-mail
Linux HowTo's - Beginner Linux HowTo's
Written by dexxtreme dexxtreme   
Saturday, 24 May 2008 05:21

To list all open network ports on your machine, run netstat -lnptu. Here is a breakdown of the parameters:

l - List all listening ports
n - Display the numeric IP addresses (i.e., don't do reverse DNS lookups)
p - List the process name that is attached to that port
t - List all TCP connections
u - List all UDP connections

 

 

In this example, there are a number of open ports. For example, you can see:

print server (lpd on port 515)
rsync server (rsyncd on port 873)
database server (mysqld on localhost port 3306)
web server (httpd on port 80)
dns server  (named on port 53)
openssh (sshd on port 22)
syslog (syslog-ng on port 514)
snmp (snmpd on port 161)
dhcp server (dhcpd on port 67)
tftp server (in.tftpd on port 69)
time server (ntpd on port 123)
several services related to importing an NFS filesystem

You can also change the "l" to an "a" to list both listening and active ports.

 

You can also use netstat to show the current routing table by running  netstat -rn:


 

Comments
Search RSS
Only registered users can write comments!

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Sunday, 25 May 2008 01:09 )