How To Add A Static Route To The Windows Routing Table

Sometimes you need to set up a static route in Windows to allow your PC to access a network that is not accessible with the default gateway route.  Then You need to add a static route.

To add or view the routing table we need to open up Command Prompt:

0ilosahred3434

After opening the Command Prompt, type the following command and press Enter:

1addstaticroutings334

Add a Static Route to the Windows Routing Table You can use the following syntax:

route ADD destination_network MASK subnet_mask gateway_ip metric_cost

For example:

route add 172.16.121.0  mask 255.255.255.0 10.231.3.1

2addstaticroutings334

If you use the route print command to look at the table then you will see your new static route.

3addstaticroutings334

After adding a static route it will be active until the next restart of your Windows PC.  To make the route persistent just add the -p option to the command.

For Example:

route -p add 172.16.121.0  mask 255.255.255.0 10.231.3.1

4addstaticroutings334

With route print, you can see  Persistent Routes

5addstaticroutings334

To delete static routes you can use the following syntax:

route delete destination_network

For Example:

 route delete 172.16.121.0

6addstaticroutings334

 

2 thoughts on “How To Add A Static Route To The Windows Routing Table

  1. Thanks for the information. I have a Windows 10 virtual machine running in Hyper-V inside of a host Windows 10 machine. Adding route tables per the above process works fine in the host machine, but does not work in the Win 10 Virtual Machine. Any suggestions? I just get an error that says Element not Found.

  2. It should be work. But If you have trouble with the run that cmd like as “route ADD” then you can try with netsh.
    For example:
    netsh
    interface
    ipv4
    show interfaces
    add route 172.16.121.0/24 “Internal” 10.231.3.1

Add Comment