LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-03-2005, 05:51 AM   #1
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Blog Entries: 7

Rep: Reputation: 32
How to display open ports on specific NIC


Hi guys
I know that I can use netstat to display open ports , I use the following command to display the port and the service that accompanies it:

netstat -anp --tcp

But what I want to achieve is to display only the ports and the services that accompany them for a certain NIC like lets say 192.168.1.1.... instead of all the NICs

Another question:
I get the following output when I use the mentioned command :
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1252/sshd

What does the 0.0.0.0 refer to ? The localoop or what ?

Thanks to anyone willing to help !
 
Old 12-03-2005, 11:50 AM   #2
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by ALInux
Hi guys
I know that I can use netstat to display open ports...

Another question:
I get the following output when I use the mentioned command :
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1252/sshd

What does the 0.0.0.0 refer to ? The localoop or what ?
First of all congrats to LQ owners & all other members for upgrading LQ to VB.

Use #nmap -sS -sT -p0 -v <ip-address>
-sS for steath scan
-sT for tcp
-p0 for not to ping
-v verbose

You can refer man page of nmap for other options.

Over to second question... AFAIK 0.0.0.0 refers to the default network.. It works in cases as if you have started apache, it may starts on 0.0.0.0:80.

..amit..
 
Old 12-03-2005, 01:15 PM   #3
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
0.0.0.0 is the wildcard ipv4 address. (:: is the ipv6 equivalent.) If your server listens on 0.0.0.0:22, it's listening for and will accept connections to port 22 on any address assigned to the system.

Similarly, 0.0.0.0:* on your netstat output line means that the daemon listening on port 22 will accept a connection from a client initiating said connection from any client-side address and port.
 
Old 12-03-2005, 01:20 PM   #4
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
Oh, one more thing... To see listening (open) ports, use

Code:
netstat --protocol=inet,inet6 -pnl
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cannot Open Mail Server Ports 25, 110, and 220. Other Ports will open. Binxter Linux - Newbie 9 11-29-2007 02:03 AM
Allow Disallow Specific ports anybody1234 Linux - General 2 04-05-2005 02:21 PM
Simplest way to open and close specific ports ? Natimus Linux - Security 6 04-05-2005 09:01 AM
How to open specific ports on Mandrake 10? NorthStar Linux - Networking 2 09-04-2004 04:55 PM
How Do I Open Specific Ports? TankerKevo Red Hat 2 10-03-2003 12:31 AM

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

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