Search My Techie Guy

Ad from yllix

Saturday, May 14, 2016

Adding a Static IP route in a Windows Routing Table


This short post is to show you how to add a static IP route in a windows routing table.

Problem or Goal: 

Statically add an IP route in a windows routing table.


For my case, my laptop had two interfaces (The Local Area Connection on cable and the Wireless Network Connection), and i wanted to force traffic to a certain destination network out the LAN cable interface.


Statically define an IP route to your desired destination network and force it through the gateway that connects to the right interface.

route ADD MASK
route ADD “network” MASK “subnet mask”  “gateway ip”
route ADD MASK
You can use this command to print the status of your routing table:
netstat -rn
Your routing table should now reflect that change, and all traffic to the 10.10.10.x network will now be sent through the interface that connects to the gateway. 
The route add change will only stick across reboots if you add it with the -p flag, for example:
route -p ADD MASK

Problem Solved?

Post a Comment