In this tutorial, I will explain how to add a static route on a Windows computer (Servers or Desktop).
To illustrate this tutorial, we will use this diagram:

Here we have a computer on the network (Network 1), which has as default gateway the equipment in 10.0.12.1, on the network there is a second router with the IP 10.0.12.254 which allows access to the network (Network2).
To access the Network 2 network, you must declare the path manually in Windows and this is done on the command line.
To access the Network 2 network, you must declare the path manually in Windows and this is done on the command line.
Open a command prompt as administrator.
Here is the generic syntax:
route add network-ip MASK network-mask gateway -P
Which gives here:
route add 172.16.128.0 MASK 255.255.248.0 10.0.12.254 -P

The -P parameter allows you to make the route persistent, without this parameter after a reboot the route will no longer be available.
To verify that the route is added, we will display the routing table:
route print

We can see that the route has been added to the routing table.