Adding static routes in Windows

Print Friendly, PDF & Email

So I learned something new today…something I should’ve been able to do a long time ago already – Adding routes in Windows.

To view the current routes:

route print

To add a temporary route

C:\> route add <target> mask <netmask> <gateway IP> metric <metric cost> if <interface>
 
C:\> route add 10.10.10.0 mask 255.255.255.0 192.168.1.1 metric 1

This Static route gets erased when the system reboots. To avoid this, use the -p (Persistent) switch to the above command and the route will remain even if you reboot your machine:

C:\> route add -p <target> mask <netmask> <gateway IP> metric <metric cost> if <interface>
 
C:\> route add -p 10.10.10.0 mask 255.255.255.0 192.168.1.1 metric 1

Thanks to www.itsyourip.com for clearing this up for me!

Share and Enjoy !

0Shares
0 0 0

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.