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:
After opening the Command Prompt, type the following command and press Enter:
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
If you use the route print command to look at the table then you will see your new static route.
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
With route print, you can see Persistent Routes
To delete static routes you can use the following syntax:
route delete destination_network
For Example:
route delete 172.16.121.0
Jon Leman
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.
AsimA
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