How to add Static Route to Windows

Sometimes you need add static route to Windows, I will show you how it could be done.

Why you need add route ?

  • you have two internet connection and you want to route all your connection to one of them
  • testing router configuration
  • you are use your windows as router ( BAD IDEA )

View the Windows routing table

Open your command line (Win+X) -> command prompt (admin)

Add static route to routing table

The subnet_mask and metric_cost components are optional to the command. Default subnet mask is, metric cost will be one greater than destination entry from routing table.

if you add route by this command it will lasts until the next reboot, so if you need add this route persistent add -p switch to command

Remove static route

You just need specify destination network to delete

This is all. Manage routes in windows is quite simple.

Leave a Comment

Your email address will not be published. Required fields are marked *