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.

I have a Windows Server 2003 VM with two NICs, one that is connected to a private VLAN and one that is connected to a public-facing VLAN. I have manually assigned addresses to both connections. How can I configure Windows such that only traffic addressed to the private subnet (say, 10.5.1.0/24) will route through the private VLAN, and all other traffic should route through the public one? I should mention that the private VLAN is connected to a router/firewall VM that is connected to the same public VLAN as the one Windows Server 2003 is connected to, but of course the two have two different manually configured IP's.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You would set the default gateway on the public NIC. This will make all traffic that you don't have a specific route defined for use it.

Then, you need to add a static route to the internal network. You can do this with a route command.

route add 10.5.1.0 mask 255.255.255.0 x.x.x.x if y -p

Where x.x.x.x is your gateway on the internal network and y is the interface index of your internal NIC prefixed with 0x. You can find the index of each interface by running route print. If it was interface 2, for example, you would substitute 0x2 for y in the above example.

The -p at the end makes it persistent, so that the route will remain across reboots. If you just want to test, you can make add the route without -p and it will go away on reboot if it causes issues.

share|improve this answer
    
Perfect, thank you! I was really wondering, "What would the default gateway be for the LAN connection" but I didn't need to specify one. –  tacos_tacos_tacos Nov 21 '11 at 16:10
    
@JustinShin Yeah, no matter how many NICs you have, there can only be one default gateway. –  MDMarra Nov 21 '11 at 16:13
add 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.