Windows route not followed

networkingroutingwindows

I add a route on the windows network like so:

route -p add 46.137.226.16 mask 255.255.255.255 10.20.1.1

The goal is for traffic to 46.137.226.16 to be routed via the VPN/remote gateway on 10.20.1.1.

It works, tracert tells me it goes via the remote gateway, and the server on 46.137.226.16 sees me coming from the remote network (what has a static IP configured for access to Remote desktop on 46.137.226.16)

But when my ADSL local network drops and comes back up, this route is not followed/obeyed anymore.
I can 'fix' it by deleting the route and recreating it. But the whole purpose of the -p flag is to persist the route.

The metric doesn't change, and is 1.

Best Answer

Add the following to your command:

route -p add 46.137.226.16 mask 255.255.255.255 10.20.1.1 METRIC 1 IF ##

Where ## is the relevant interface number from the top of "Route Print"

Route Print Example:

Assigning a metric 1 ensures that this will should always be the default route for this IP.