Is it possible to run two services on the same ports with different IP but on the same machine?

It is possible. You just have to bind on the right IP address/interface each service using the same port.

Ports (be them UDP or TCP) have their own pool per IP address.

You can listen on the same port if you change: IP address or protocol (UDP or TCP).

See: http://www.bleepingcomputer.com/tutorials/tcp-and-udp-ports-explained/


Yes. Sockets (IP:Port) come in pairs and have to be unique. You can also bind multiple IPs to a single NIC.


This is easy only if the application supports binding limitations. If it does not then you can put the app into an LXC container if we are talking about Linux or Java (or something running well under WINE). If Windows does not offer something similar then you can use VMs.