Skip navigation

JSI Tip 4220. How do add a static persistent route by using the command-line?

Persistent route are stored in the registry at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes.

You can use the P switch with the route command to add a static route to the registry. The syntax is:

route -p add DestinationIP mask IpMask GatewayIP

Example:

route -p add 131.107.3.0 mask 255.255.255.0 131.107.3.1

NOTE: The above adds a data type REG_SZ entry with a data value of 131.107.3.0 255.255.255.0 131.107.3.1

NOTE: See tip 3908 » Static routes entered via the RRAS Administrator program are NOT active unless RRAS is started?



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish