Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Yesterday I had a discussion about running the same service, for example SMTP, on the same port on a server. I think this is possible by assigning multiple ip addresses to the server and bind the service to each ip/port combination. However we ended up in a discussion and came to the conclusion that we missed the theoretical background.

We got stuck at the metaphor that the server is the house, reachable by multiple (ip) addresses and ports are the rooms. The rooms have numbers, but there is only one room per number. This would mean that whatever address is used to reach the house, you will always end up in the same room.

I think it does not work that way, the combination of the ip/port port of the request makes the request unique. The OS can handle multiple services on the same port number as long as the service is binded to an ip address.

It is not a question on how to run two type X web servers on port 80 on OS type Y. I would like to know how this works on a conceptual level so I can understand and it explain this to somebody else


Maybe my question is a bit woolly. The question is: Is it possible to have multiple ip addresses on a server and split the traffic per ip address, hence having multiple ports 25 on one server.

And if so, how do I explain that to somebody who does not believe that. A good metaphor maybe?

share|improve this question

closed as off-topic by MadHatter, mdpc, Jenny D, Dennis Kaarsemaker, EEAA Dec 16 '13 at 0:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – MadHatter, Jenny D, EEAA
If this question can be reworded to fit the rules in the help center, please edit the question.

If you want to understand IP networking properly, I cannot too highly recommend Steven's TCP/Illustrated Volume 1, and volume 2 likewise. Once you've read those, feel free to ask questions! – MadHatter Dec 6 '13 at 8:22
1 – Iain Dec 6 '13 at 9:09
up vote 1 down vote accepted

I think the metaphor 'every server is a house' needs to be corrected as 'every IP Address is a house'. e.g. So lets say your server has 2 IP addresses in that way theoretically you have 2 * (2^16) unique combinations of 131072 Server sockets available to you.

Since you have different IP:Port combination available you can configure Sendmail (IP_Address_1:25) and Postfix on same server (IP_Address_2:25)

share|improve this answer

Every IP address on a system will have all ports available for use.

Many services can be configured to listen on one or more IP:Port pairs. If a service is listening on all IP:25 then the load could be split across each.

However what you're missing is how does the connecting device know where to connect ? It may be possible to use DNS round-robin to provide different IP addresses or in the case of SMTP (port 25) equally weighted MX records.

Actually the more I try and answer your question the more I realise that your lack of understanding needs to be improved so I'll again refer you to the excellent TCP/IP guide

share|improve this answer
I agree on my lack of understanding on TCP/IP. Reading the answers I understand that each IP address has its own set of ports. I understand how a device ends up at an ip through MX records or DNS. It was not about load balancing, just about the concept of an ip address/port combination. For now "Every IP address on a system will have all ports available for use." is good enough for me." I accepted the other answer because of the reference to the metaphor. Your answer and the reference to the guide is very much appreciated. – Jasper Duizendstra Dec 7 '13 at 12:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.