Windows route command

Adding a routing

In this example I have connected to a VPN and only certain servers are meant to be accessed via the VPN.

Routing a single IP

The IP I have been given by the VPN is

route add mask

Routing a subnet

Any network connection to will go via the VPN.

route add mask

Any network connection to 192.168.1.* will go via the VPN.

Making a route permanent

To make it permanent you must add the -p switch

route -p add mask

Next time the computer is reboot the route will reappear.

Checking active routes

Use "route print" the command will show you the active route table.

Published: Monday, 14 February 2011