Source based policy routing with one NIC
Greetings,
I know I am new here, but I have seriously tried for quite some time (weeks) to figure this out myself but I can't seem to get it to work.
Here's what I have:
- a Virtual Private Server (running Ubuntu) which I have root ssh access to
- a single external IP address to the internet
- a piece of server software that runs as expected right now, but I can select the ip address and port that it listens on
NOTE: This uses TCP packets, but does NOT use an HTTP layer.
- clients that need to connect to the server
What I want to do:
Run multiple copies of the server software on different ip addresses or ports and have different groups of clients connect to different processes.
How I want it to behave (ideally):
I now believe this is impossible (until IPv6 is the norm), but I want traffic directed to different copies of the software based on subdomains.
How I want it to behave (realistically):
Route the traffic to different copies of the software based on the source address of the client. I believe this is possible using the iproute2 package but I haven't been able to find a tutorial or example or any documentation relating closely enough to my situation. They mostly depend on having multiple NICs.
My questions:
How can I route based on source IP address to a specific port on either the NIC or the loopback, such that different copies will be able to listen on different ports?
Failing that, is it possible to set up multiple loopback adapters so that the different copies can listen on different IP addresses? How would I implement this? How would I route the traffic to these different IP addresses?
Thanks everyone in advance for your replies.
EDIT:
PS - The server needs to get data back to the clients as well, so this will probably require some additional routing rules.
Last edited by ardora; 12-01-2007 at 02:42 PM.
|