How to add a static route to the Windows Routing Table – Vonnie

Did you know that your router isn’t the only device with a routing table?

Yup, any device that relies on TCP/IP for network communications has a routing table – including Windows.

Go ahead and open a command prompt (Windows Key + x + c) and type:

route-print

The output is divided into three sections:

  • Interfaces List
  • IPv4 Route Table
  • IPv6 Route Table

The Interfaces List enumerates all your interfaces by MAC address and the next two sections list your dynamic and persistent routes for IPv4 and IPv6.

Each line under Active Routes is a TCP/IP route to a network or a specific device on the network.

To add a route we use the route ADD command to tell Windows which Network to add and then we enter the Subnet mask and Gateway.

But why would you ever add a static route in the first place?  People often add static routes when troubleshooting routing related problems.  For example, maybe you can’t ping a workstation from a server or perhaps can successfully ping that workstation but the ICMP echo reply chronically times out.  Sometimes we can isolate networking problems like this by manually entering a known route.  That’s where static routes come in.

So let’s say we’re on the 10.255.70.0 network and the default gateway is 10.255.70.1 and we want to add static route to our management VLAN located on the 172.10.3.0 network.

Assuming our subnet mask is 255.255.248.0 we could add the route like this:

The format is as follows:

route ADD this network with this mask via this gateway IP.

The only drawback to this method is that after you reboot your static route will go poof!

In order to make it stay we need to make it persistent with the -p modifier.  So just add a -p to the end of the route and it’ll be permenent.

If later you decide to remove the static route, you can use route DELETE followed by the destination network IP.

That’s it for now!

Source: How to add a static route to the Windows Routing Table Vonnie

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.