How to add Static route in Windows

Sometimes in the environment, we have multiple interfaces in windows or if we want to route the traffic from a specific interface we need to add routes in the IP route table of windows. Adding static IP routes in windows is easy and simple. Follow the below steps to add static routes in windows.

  1. Open Command Prompt with administrative access.
  2. Use “ipconfig” to identify the interface you want to use for routing.
  3. Use “route print” to check the routing in the windows routing table.
  4. Add Static route in windows.

1. Open Command prompt with administrative access.

To open command prompt with administrative access. Go to Windows and write cmd then right click on command prompt and choose option “Run as administrator”.

add static route in windows

2. Use IPCONFIG to identify the interface you want to use for routing.

Now, First, we need to identify the interface which will be used for static IP routing.
To view, all the interface present in the windows use the below command-

3. Use “route print” to check the routing in the windows routing table.

After identifying the interface use below command to check the current routing in the windows routing table.

route print windows command

4. Add a static route in Windows.

To add static route in windows we need to use below syntax where we need to provide network address and its mask and after mask we need to mention the gateway which will be used to forward the traffic.

below is the example to route 192.168.35.0/24 network via 192.168.0.2

how-to-add-static-route-in-windows

The subnet_mask and metric_cost components are optional to the command. once you add a static route in windows, you can use command route print to view the routing in windows.

To delete a static route from windows use below commands

To delete the route with the destination network 192.168.35.0, all we’d have to do is type this command and hit Enter:

Leave a Comment