Networking

Change an existing Windows static route to persistent

Change an existing Windows static route to persistent

Highlights

  •  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.
  •  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.
  •  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.

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 has over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, Brandon 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.

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.