Route Add and Delete on Windows 10, 2016 Server – Static Route Simplified

Sometimes you need to create static route to make communication with different network which is connected via different gateway than the default gateway set in your computer IP address. Gateways is simply a network router which route the network traffic between different networks. When you have more than one gateway (router) on your network, then you may need to implement static route technique on Windows 10, Windows 2012 R2 or Windows 2016 server. Static route will tell the Operating System to send network packets to appropriate router instead of sending to default router. This simple guide shows how to add and delete static route on Windows 10/2012 R2 and 2016 server Operating Systems.

There are few useful commands you must know. Route delete, add and print. These commands will be handy to any user who has administrative access and know which router/gateway should be used for which network.

Route Add on Windows 10 and Windows 2012 R2/2016 Server

Make sure you run below commands on command prompt (or PowerShell) which is opened as Administrator.

run as cmd

This is to add the entries.

route add mask

It indicates that any packets to (in class C – network should be forwarded to router (gateway). Obviously the PC/server which we run this command is in network, because the PC/server should communicate to gateway from the same network.

The issue with the above command is, when you shutdown or restart the computer, these route entries will disappear. To make it permanent and save in Windows OS routing table, we should use –p key with the route add command. So, permanent static route add on Windows 10 command will be like this;

route add –p mask

Read Also: How to find the IP address of a network printer on Windows OS

Route Print

Okay, you kept on adding static route entries, now how to see them? or if you need to modify a route entry which is already in the routing table on Windows 10 or Windows 2016 server, how to modify it? Firstly, we have to see the existing route entries on the computer. To do it, use route print command.

Route print

route print Windows 10

Route Delete on Windows 10/2012 R2/2016

This is to delete an existing persistent route entry from a computer. Even though we have added a route entry with network, network mask and gateway, to delete, we need to mention the network only. So, it goes like this;

route delete

That will delete the route entry from the computer. You may not need to restart the computer to take effect.

How to Modify a Static Route Entry on Windows 10/2016

Let’s say that after the recent network change, now the network should be routed through gateway. Obviously you have to modify the existing route for this network and change the gateway to, how to modify it?

You can’t modify an existing route entry. The simple method is delete it and enter the new route entry. So, in this case you would perform below commands.

Route delete

Route add –p mask

We hope this simple guide will help in understanding the route add, delete and print commands in Windows 10 client PC and 2012 R2 and 2016 server Operating Systems. Make sure you open the command prompt or PowerShell as Administrator to perform these commands. If you want to use cosmetic variables to identify the fast hops to reach a network, you can use metric key as described at Microsoft site here.