Networking

Change an existing Windows static route to persistent

Change an existing Windows static route to persistent

So this is not something that you will find yourself doing terribly often – having to change an existing Windows static route to persistent. ย However, if you have the need to add a persistent route in Windows and you didn’t think to make the route persistent when you created the route, let’s take a look at the simple process to verify and change your route. ย So why would you not make the route persistent to begin with? ย Well, if you are testing or troubleshooting a network connectivity issue and utilizing static routes in Windows to attempt to resolve, you may not at first want to make the routes static as with troubleshooting sometimes you try things and use the process of elimination.

What situation might you find the need for a static route? ย Let’s look at a use case – In a multihome/DMZ situation you may have two nics – DMZ and LAN. ย You have aย gateway address assigned on your DMZ nic and no gateway on your LAN connection per Microsoft best practice of a single gateway assigned. ย You have multiple internal subnets that would normally be routed by a gateway address on the LAN connection that simply can’t be routed because of the lack of a gateway address in your LAN network configuration; in steps the static route use case.

Changing a static route

Let’s look at the process to change a static route that has been created to persistent. ย To begin with, if you want to verify that a static route is indeed persistent, we can look at the registry to verify. ย Navigate to the following registry key:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpip ParametersPersistentRoutes

Any persistent routes will be displayed in the above registry location as a string value.

We may want toย change the static route instead ofย deletingย it and thenย adding it back in. ย Maybe you resolved your traffic flow problem by the addition of a static route and didn’t make the route persistent and now you want to make it persistent without disrupting traffic flow with a delete/add.

To change a static route to persistent we use the route changeย command show below. ย Note the addition of theย -p on the end.

route change 172.16.16.0 mask 255.255.255.0 10.30.1.1 -p

rtchange01

After you have issued theย route change command along with theย -p option, simply refresh your registry key to verify and you should see it appear.

 

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

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.