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, 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.


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 mask 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.

| 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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