Routing based on source address in Windows Server 2008 R2

routingwindows-server-2008-r2

I'm implementing a direct routing load balanced solution using Windows Server 2008 R2 as back-end server. I've configured a loopback interface with the external IP address. This works, I am receiving packets with the external IP address and respond to them appropriately. However our infrastructure requires that traffic which is being load-balanced should go through a different gateway then any other traffic originating from the server, ie. updates etc. So basicly I need to route packets based on source address (external IP) to another gateway. The built-in Windows 'route' command allows routing based on destination address only. I've tried setting a default gateway on the loopback interface and mangled with weak/strong host send/receive parameters on the interfaces, however this didn't work.

Is there any way around this, possibly using third party tools?

Best Answer

A somewhat kludgy solution to this would be to have a router/VM running like something DDWRT/OpenWRT in front of the Windows box to achieve the re-routing/mangling. Although, I haven't used this yet, this project also looks somehwat promising, http://wipfw.sourceforge.net/doc.html It almost looks like iptables for Windows?