PDF(110.8 KB) View with Adobe Reader on a variety of devices
ePub(143.9 KB) View in various apps on iPhone, iPad, Android, Sony Reader, or Windows Phone
Mobi (Kindle)(99.6 KB) View on Kindle device or Kindle app on multiple devices
Updated:December 7, 2022
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This document describes how to use the Microsoft Windows route command.
Cisco recommends that you have knowledge of these topics:
How to troubleshoot Cisco ICM
How to configure and troubleshoot TCP/IP
How to troubleshoot Microsoft Windows
The information in this document is based on these software versions:
Microsoft Windows NT
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
This section explains each of the options that you can use with the route command:
The -f option clears the routing tables of all gateway entries. If you use the -f option in conjunction with one of the commands, the tables are cleared before you run the command.
By default, routes are not preserved when you restart the system. Use the -p option with the add command to make a route persistent. Use the-p option with the print command to view the list of registered persistent routes.
The command option specifies one of the six commands in this table:
Prints a route
Adds a route
Deletes a route
Modifies a current route
Specifies the computer to send command
Specifies a subnet mask to be associated with this route entry (default subnet mask is 255.255.255.255)
The destination specifies the network destination of the route. The destination can be an IP network address, an IP address for a host route, or a default route.
A netmask is a 32-bit mask that you can use to divide an IP address into subnets and specify the available hosts in the network. If you do not specify a netmask the default value 255.255.255.255 applies.
The gateway option specifies the default gateway. All symbolic names used for the destination or gateway are looked up in the network and computer name database files NETWORKS and HOSTS. If the command is print or delete , you can use wildcards for the destination and gateway, or you can omit the gateway.
The metric option assigns an integer cost metric (that ranges from 1 to 9999) which you can use to calculate the fastest, most reliable, and least expensive routes.
"IF" specifies the interface index for the interface over which the destination is reachable. If you do not specify IF , an attempt is made to find the best interface for a given gateway.
Here is an example of the route command:
Example of the Route Command
In order to view the entire contents of the IP routing table, issue the route print command.
In order to add a persistent route to the destination 10.19.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.10.0.1, issue the route -p add 10.19.0.0 mask 255.255.0.0 10.10.0.1 command.
In order to view the routes in the IP routing table that begin with "172.", issue the route print 172.* command.
In order to delete all routes in the IP routing table that begin with "172.", issue theroute delete 172.*command.