Skip to content

How to Configure a Persistent Static Route Print

  • 0

Applies to: Windows Server 2019, Windows Server 2022, and Windows Server 2025.

A persistent route directs a specific destination network through an approved gateway after server restarts.

Prerequisites

  • Administrative access and an approved change window.
  • A verified backup and documented rollback plan.
  • A pilot environment or low-risk target for validation.

Step-by-step procedure

  1. Confirm the destination prefix, next hop, and interface index.
  2. Test reachability before changing routing.
  3. Create the route with an explicit metric.
  4. Validate path and asymmetric-routing risk.

Commands

Get-NetIPInterface -AddressFamily IPv4
New-NetRoute -DestinationPrefix "198.51.100.0/24" -InterfaceIndex 12 -NextHop "192.0.2.1" -RouteMetric 50 -PolicyStore PersistentStore
Get-NetRoute -DestinationPrefix "198.51.100.0/24"

Verification

Test-NetConnection reaches an approved destination through the intended next hop after restart.

Rollback

Remove only the named route with Remove-NetRoute and verify the previous path returns.

Security notes

  • Use least privilege and record the change.
  • Review relevant event logs after implementation.
  • Test before production rollout.

A persistent route still depends on a reachable next hop

Before adding a route, identify the source server, destination prefix, selected interface and gateway. The next hop must be reachable through that interface according to the actual network design. A route entry can be syntactically accepted while pointing at a gateway that cannot forward the traffic.

The example addresses and interface index are documentation values. Record Get-NetIPConfiguration and the existing route table before substituting your real values. Prefer a specific destination prefix over changing the default route when the requirement concerns only one remote network.

Windows considers route specificity and effective metrics when selecting a path. A lower route metric does not necessarily override a more specific route, and the interface metric also matters. Inspect the selected route and test an application connection from the intended source rather than assuming that a successful route-creation command proves reachability.

Persistence means the configuration is retained across restart, not that it repairs a failed gateway. During verification, confirm behaviour after a planned reboot where appropriate and document the matching removal command for the exact prefix, interface and next hop. Avoid broad cleanup commands that could delete unrelated routes.

Related resources

Canadian Windows VPS and RDS hosting: managed Windows VPS hosting. Refer to Microsoft Windows Server documentation.


Was this answer helpful?

« Back