Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Just curious if this is possible. Lets assume i run a pair of irc servers (or anything else) on a system with different ports- i'd like to have something listen into a single port, and forward packets based on hostname - any connections to A.foo.bar should be forwarded to one port, and any connections to B.foo.bar should be forwarded to another. Most proxies seem to be for http, and well, that's not the use case i have in mind.

I'm currently running ubuntu server 9.04 and 10.04, though i'd be willing to switch to another free OS to do this.

share|improve this question
add comment

2 Answers

I'm assuming that A.foo.bar and B.foo.bar resolve to the same IP.

There wouldn't be any way to do it without some sort of Application Layer proxying. You could use an HTTP or a SOCKS proxy connection on your clients so you can switch the connection based on hostname. You could probably also set up an IRC MitM that detects the hostname the client is trying to connects to, then handsoff to the correct server, but I don't know if the IRC protocol would provide enough info to do that.

share|improve this answer
add comment

You could use SQUID as a transparent proxy to accomplish this. It doesn't have to be HTTP.

But really, you have two different hostnames. You can point them to two different IPs and DNAT the traffic accordingly.

share|improve this answer
    
Assuming the clients can use an HTTP proxy. –  jdizzle Mar 10 '10 at 16:43
    
Huh? en.wikipedia.org/wiki/… –  Warner Mar 10 '10 at 16:58
    
a little most detail would help. most references to squid seem to do with http proxying –  Journeyman Geek Mar 10 '10 at 23:15
    
Is there a reason why you can't pursue the DNAT solution? –  Warner Mar 10 '10 at 23:21
    
I have a single ip address - if i understand DNAT correctly it is forwarding to nated ip by destination?. I might be wrong- so a specific example for a similar situation might help –  Journeyman Geek Mar 12 '10 at 11:15
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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