HOWTO: Add or Remove Static Route on Windows Systems

In this article we will look at what a static route is and why it should be add at all. We will use the so-called root or in other words we will prescribe routes using the route add command in the Windows command line. Before starting to practice, I would like to talk a little about the theory, what would you understand, what are you doing, and in what cases it might be useful for you.

Static routing is a type of routing where routes are explicitly specified when configuring a router. All routing occurs without the participation of any routing protocols.

Static route - is an administrator-defined route that causes packets moving between the source and destination to go along the specified path. In other words, this is an explicitly indicated path that a packet must travel from point A to point B.

Why do we need to be able to add static routes? Now it is very common for security to use Virtual Private Networks (VPN). VPNs are used both in organizations, for the organization of their secure network, and by providers, to provide access to the global Internet, to simple users. But, anyway, this sometimes causes minor inconveniences, both in organizations and among ordinary users.

For example, you have two computers at home, one of which has access to the Internet via VPN, it is also connected to the second computer’s local network, and every time it connects to the Internet, the connection between the two computers is lost because the first computer ( who connected to the VPN) is already on another network, and therefore unavailable from the second computer. This can be corrected just by configuring a static route.

Routes are network settings that are used by the operating system for organizing network traffic and accessing the local network and the Internet. With help of this page you will learn how to view, delete and add routes on a computer running Windows from XP to 10.

1. View Active Routes in Command Prompt Tool

To simply see the routing table on your computer, type the following at the command prompt Start-> Run-> cmd:

route print

View routes

2. How to Remove All Static Routes

This is done in the following way: run the command line and type the following command:

route -f

Remove all static routes

3. Add Static Route in Command Line Shell

To add a static IP route, in the command line running as administrator, enter the command:

route -p add 0.0.0.0 mask 0.0.0.0 192.168.95.1

Where:

  • route - the program itself that works with the routing table;
  • -p is a key that says that the route will be permanent, because (Important note!) without this key, all routes that you add will be deleted after rebooting, so if you want to use the route always, write this key if only once, then you can not write;
  • add - the command itself that adds an entry to the routing table;
  • 0.0.0.0 - the network with which you want to have a connection;
  • mask 0.0.0.0 - subnet mask;
  • 192.168.95.1 - the gateway address, usually the modem address.

    Add static route

    4. How to Remove Specific Static Route

    To remove static route open command line and type this command:

    route delete 0.0.0.0 mask 0.0.0.0 192.168.95.1

    Also consider using Action1 to to join domain remotely if:

    • - You need to perform this action on multiple (hundreds or even thousands) computers simultaneously.
    • - Some of your endpoints are laptops not connected to corporate network at all times.

    Action1 is a cloud-based platform for software deployment, software/hardware inventory, patch management, endpoint configuration and more. It is free with basic functionality.


    Other Relevant HOWTOs: