NT/2000/XP: Add a temporary route to the Windows routing table
A route describes the gateway IP address and network interface to use when sending packets to a network. The routing table on a host holds a list of destination networks and the routes to those networks. This recipe describes adding entries to this routing table that will not persist following a reboot. These temporary routes are useful during troubleshooting or when making changes to the network topology.
To add a route to the network 192.168.1.1/24 (corresponding to a subnet mask of 255.255.255.0) through the gateway 172.16.100.1, use the following command:
route add 192.168.1.1 mask 255.255.255.0 172.16.100.1
This is the simplest method of adding a temporary route. The subnet mask parameter is optional and defaults to 255.255.255.255 which specifies that the target is a single IP address instead of a network.
An optional routing metric can be added to the route command for more complex situations. The metric can be considered a cost for using the route. If a routing table contains multiple routes to the same destination, the cheapest route (lowest cost or metric) will be used. To add a route with a metric of 10 to the host 192.168.15.123 through the gateway 172.16.10.1, use the following command:
route add 192.168.15.123 172.16.10.1 metric 10
In this case, the subnet mask is not given so the command defaults to the mask 255.255.255.255.
It is possible to use names instead of numbers for the gateway and subnets. If you use a name for the gateway, the name is looked up in the hosts file ({windows_home}\system32\drivers\etc\hosts) and the corresponding IP address is used. Named subnets will be looked up in the networks file ({windows_home}\system32\drivers).
If multiple network interfaces are available to route to the same destination, the interface can be specified in the route command. The interface number associated with the interface is shown using the route print command. Windows will automatically guess which interface is most appropriate for the given route. If you are dissatisfied with Windows’s guess, the optional if {interface} parameter can be used. To specify that the previous route example should use interface 2 (identified with the hexadecimal value 0×2 in the route print command), use the following command:
route add 192.168.15.123 172.16.10.1 metric 10 if 2











qq said on May 18, 2010
how to fix the value of interface list..
Peter said on August 3, 2011
simply do a ROUTE PRINT values of your interfaces are infront of iface name
jalal said on October 5, 2011
The ROUTE is not working for a MAIL SERVER.
I used the add route command to access the standby mail server 192.168.1.17 instead of the main mail server 192.168.1.11, but the connection to the standby mail server could not be established
route add 192.168.1.11 mask 255.255.255.255 192.168.1.17