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
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:
Many network software programs have an option to bind to specific IP. Read the man page of particular software for more information.
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop