About Linux FAQ

Browse More FAQs:

Linux: Find out which network card or NIC server is bind or running on

Posted by Vivek Gite [Last updated: September 20, 2006]

Q. I have two network cards interface eth0 and eth1. Further eth1 has 4 aliases. All end user can use access any service using these IP address. So I want to find out which network card or NIC server/service is bind or running on. For example Apache web server or postfix mail server.

A. That is true, by default server will bind to all ports. You need to use combination of netstat and ifconfig to find out all binding ports for selected service.

For example, find out Postfix (port 25) is bind to which IP or network card (aliases):
$ netstat -tulpn | grep :25
Output:

tcp        0      0 192.168.5.10:25                0.0.0.0:*                   LISTEN      26586/master

Above command find out that Postfix is listing to which port and bind to which IP address.

From the output, you can see Postfix is bind to IP 192.168.5.10 address. Use ifconfig command to find out network card name:
# ifconfig

Many network software programs have an option to bind to specific IP. Read the man page of particular software for more information.

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.