+5 votes
482 views
How to use the route command in Windows 10

in Windows 10 by (552k points)
reopened | 482 views

1 Answer

+3 votes
Best answer

1. How to deploy network interfaces in Windows 10
2. How to use the route command for a specific interface in Windows 10

Windows 10 is one of the most chosen operating systems among users due to its ease of use or the importance they give to security among other aspects. In addition to this, Windows operating systems integrate a series of commands that have been developed to facilitate the administration of various parameters both at the user level and internal aspects of the system itself; and thanks to those commands, as administrators, we can obtain valuable information for general support..

One of these commands is focused on the network aspects which is more than essential to carry out all the delivery of services and system functions and is the route command. It is for this reason that through this TechnoWikis tutorial we will explain what it is and how to use the route command in Windows 10.

What is the route command?
With the route command it will be possible to view, add or delete routes on a server, so you can have better control over the system routing table.

The general syntax of the route command is as follows:

 ROUTE [-f] [-p] [-4 | -6] [target] command [MASK net_mask] [link_door] [METRIC metric] [IF interface] 
Entries in the routing table in Windows 10 can be originated from static or dynamic protocols, with the routing protocol it will be possible to view and modify using the MMC snap-in all IP routing and static routes.

The general route options are:

This option clears the routing tables of all entries in the system gateway. If integrated with one of the commands, the tables will be deleted before the command is executed.
 -F 
With this parameter, if used together with the ADD command, it is responsible for creating a persistent route on system startups. By default, routes are not preserved when the system restarts.
 -p 
This parameter forces the use of IPv4
 -4 

With this parameter we force the use of IPv6
 -6 
Print a route
 PRINT 

Add a route
 ADD 

Delete a route
 DELETE 

Modify an existing route
 CHANGE 
Through this parameter the host is specified
 destination 
Specifies that the following parameter is the value of the net_mask
 MASK 
Indicates the gateway to use
 door_link 
Indicates the interface number for the specified route
 Interface 
With this parameter we can specify the metric
 METRIC 

When using the route command, all symbolic names used for the destination are consulted in the network database file, NETWORKS. While the symbolic names for the gateway will be consulted in the host name database file, HOSTS. If the destination contains a * or? Character, it will be treated as a Shell model and only matching destination routes will be printed at its destination..

Now we will see how to use this command in Windows 10.


1. How to deploy network interfaces in Windows 10


The first step is to know what are the network interfaces available in the system (this includes virtual interfaces). For this we access the command prompt and execute the following line:
 netsh interface ipv4 show interfaces 
As a result we will see the following details
  • Index number of the interface.
  • Metric assigned.
  • MTU of each interface.
  • Current state of the interface.
  • Interface Name
image

2. How to use the route command for a specific interface in Windows 10


We may have several network interfaces in Windows 10 and only want to manage one of them.
Step 1

The route command offers us this management option, for this we must first add the new routing for the desired interface indicating IP addresses (IPv4 or IPv6), netmask (mask) and the name of the interface (IF:
route add 192.168.100.0 mask 255.255.255.0 192.168.12.100 IF 3.

Press "Enter" and the result will be as follows:

image
Step 2

As we see the command has been added correctly, now, to verify that the new routing has been added correctly we will print the details of the routes with the following line:
 route print 
In the result we will get details like
  • IP addressing (IPv4 or IPv6)
  • Network mask assigned.
  • Gateway used.
  • Interface used
  • Metric implemented.

There we can detect that the route that we added with the previous command has been integrated, which has a default metric of 36..

image
Step 3

If we want to filter the route results by address, we can execute, for example, to show only the addresses that start with 192, the following line:
 route PRINT 192 * 
image
Note
We must note that in the following reboot of the operating system this added route will be eliminated automatically, in case we want it to be permanent we must add the -p parameter like this:
 route -p add 192.168.100.0 mask 255.255.255.0 192.168.12.100 IF 3 

Finally, if we want to remove all the routes that start with a certain address, we must execute the following syntax:

 route delete 192. * 
In this case we will eliminate all routes that start with 192.

We have seen how the route command provides us with a much more complete form of administration for the routing process in Windows 10 allowing the used network interfaces to take alternate paths for correct and complete connectivity with remote computers.


by (3.5m points)
edited

Related questions

+4 votes
1 answer
asked Nov 20, 2019 in Windows 10 by backtothefuture (552k points) | 472 views
+5 votes
1 answer
asked Oct 5, 2019 in Windows 10 by backtothefuture (552k points) | 853 views
+5 votes
1 answer
asked Aug 23, 2019 in Windows 10 by backtothefuture (552k points) | 242 views
+3 votes
1 answer
+4 votes
1 answer
asked Nov 20, 2019 in Windows 10 by backtothefuture (552k points) | 342 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users