Thursday, September 27, 2007

Adding static routes on windows

If a Windows machine has 2 network cards on it, each on a separate network, 1 or more static routes is necessary to tell windows the correct network to use for a given packet.  On Windows XP static routes can be added with the route ADD command.

 

So if NIC1 was on the 192.168.1.0 with a gateway of 192.168.1.1 and NIC2 was on 192.168.10.0 with a gateway of 192.168.10.1 2 static routes would be needed:

 

route ADD 192.168.1.0 MASK 255.255.255.0 192.168.1.1 -p

route ADD 192.168.10.0 MASK 255.255.255.0 192.168.10.1 -p

 

The -p makes the routes persistent (e.g., will survive reboots).  This will direct any traffic destined for 192.168.1.* through NIC1 and traffic destined for 192.168.10.* through NIC2.

 

Without the static route windows will probably choose to send all traffic out the NIC with the highest (or lowest) MAC address.

 

No comments :

Post a Comment