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

Is there a simple way to route certain domains (i.e. debian.org) through a different network interface. Here is the situation. I have a server with two interfaces eth0 going to the local network and tun0 going to an openvpn network. I would like to have all requests going to *.debian.org go out tun0 and the rest go through eth0. Is there a simple way to do this using names as opposed to ip addresses?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Not so much. The routing system is definitely IP based and names have no meaning. By the time traffic gets to the level of routing it has been turned from a name into a number. Any system that claims to do this is just dereferencing domain names to their IP components.

share|improve this answer
    
That sucks... :). Any pointers on what to look next? –  rmarimon Jan 25 '11 at 21:18
    
@rmarimon Pretty much what you already know. Set up static routes to the debian subnets you want tunneled. –  sysadmin1138 Jan 25 '11 at 21:32

What kind of traffic are you routing?

If it's HTTP, you could configure vhosts and proxy *.debian.org to IP addresses or domain names that resolve to IP's on the tun0 subnet. You can use modproxy or modrewrite for this. If your routes are setup correctly and it's just HTTP traffic, this should work.

share|improve this answer

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.