Action1 5 How-to Articles 5 How to Add or Remove Static Route on Windows

How to Add or Remove Static Route on Windows

September 27, 2019

By Peter Barnett

In this article, we will look at what a ‘static route’ is and why it should be added at all. We will use the so-called ‘Root’ — meaning we will prescribe routes using the ‘route add’ command in the Windows command line. Let’s recap the theory and in what cases using the ‘route add’ in this way may be useful for you.

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

A ‘static route’ is an administrator-defined route causing packets that move between the source and destination to go along the specified path. It 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? It is very common for security to use Virtual Private Networks (VPN). VPNs are used both by organizations — for the organization of their secure networks — and by providers — to provide access to the global Internet to simple users. This sometimes causes minor inconveniences, however, to organizations and among ordinary users.

For example, if you have two computers at home, the first of which has access to the Internet via VPN, it is also connected to the second computer’s local network. Every time it connects to the Internet, the connection between the two computers is lost because the first computer (the one connected to the VPN) is already on another network and therefore unavailable to 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, as well as accessing the local network and the Internet. With help of the information on this page, you will learn how to view, delete, and add routes on a computer running a version of 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

Remove Specific Static Route

How to Manage Static Route with Action1

The first thing you need to do is login to the Action1 dashboard.

Next, on the left side menu, select the Managed Endpoints item and mark the endpoint for which you want to block the port.

managed endpoints

Then click on the More Actions button and select the Run Command option.

run command

In the window that opens, enter the command route -p add 0.0.0.0 mask 0.0.0.0 192.168.95.1 to add a static route you need.

Action1 route add

In case you need to delete a route use this command route delete 0.0.0.0 mask 0.0.0.0 192.168.95.1

Action1 route delete

After clicking the Next Step button, you need to select the endpoints for which you are going to add or remove static route. To do this, click Add Endpoints and select the desired endpoint.

select managed endpoints

Click Next Step and in the next step you can schedule the execution time of your command. Then click Finish.

schedule and finish

Consider Using Action1 Cloud RMM Solution

Action1 allows IT professionals to efficiently manage configurations for computers within and outside the local network. In addition, the platform offers total control of patch management, software distribution, remote desktop, as well as many other features to run your IT security and administration as seamlessly as possible.

See What You Can Do with Action1 RMM

 

Join our weekly LIVE webinar “Patching and remote management” to learn more

about Action1 RMM features and use cases for your IT needs.

 

Related Posts