habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

How to Add Static IP Route on Windows

1 min read

How to Add Static IP Route on Windows

In certain cases, our pc needs more than one interface and ip address. This post about how to add static IP route on windows. For example, conditions like this:

  • The PC has 2 internet interfaces, and wants to determine the outgoing traffic through which interface to a certain destination IP address range.
  • The PC has multiple IP addresses and needs to direct traffic to a particular subnet.
    How can I communicate with the IP address segment differently from the gateway without passing through the router or gateway?

Here’s the solution.

View Routing Table on Windows

At first, Before you get st arted adding routes you have to open Command Prompt (Admin). The trick is to type “cmd” in the loop icon and if cmd appears click “run as admin”.

How to Add Static IP Route on Windows

At the Command Prompt Admin, type the following command:

route print

Like this.

How to Add Static IP Route on Windows
  • destination Specifies the host.
  • MASK Specifies that the next parameter is the ‘netmask’ value.
  • netmask Specifies a subnet mask value for this route entry. If not specified, it defaults to 255.255.255.255.
  • gateway Specifies gateway.
  • interface the interface number for the specified route.
  • METRIC specifies the metric, ie. cost for the destination.

Add a Static Route

To add static route, type this command:

route ADD destination_network MASK subnet_mask gateway_ip metric_cost

Example :

route ADD 10.90.10.0 MASK 255.255.255.0 192.168.0.2

In the above command I did not define metric_cost, the value a metric_cost is one greater than the 0.0.0.0 destination entry will be used. See picture below.

See also  Windows VPN Disable Default Gateway
How to Add Static IP Route on Windows

The way to add a static route like this there are weakness if the PC is restarted. the route will disappear from the routing table.
To make it permanent, add the -p parameter to the command. Like this.

route -p ADD 10.90.10.0 MASK 255.255.255.0 192.168.0.2 

Delete Static Route Windows

To delete static routes you can use the following command:

route delete destination_network

For Example:

route delete 10.90.10.0

To see result, type route print and see IPv4 Route Table.

May be it’s helpful, please feel free to leave a comment if you have any questions and I’ll appreciate it.


habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Manage Windows Server with Sconfig

“Sconfig” stands for “Server Configuration”, and it is a command-line utility in Windows Server operating systems. It is used to perform basic configuration tasks...
habibzain
48 sec read

How Terminate or End a Running Process in Windows

To terminate or end a running process in Windows, we can use the “Taskkill” command. Here’s how to use it: Open the Command Prompt:...
habibzain
55 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *

Never miss good article from us, get weekly updates in your inbox