The route Command

The route Command

As you know, networking device, such as routers, is used for routing purposes. Routing is used to manipulate the routing table and move packets over the networks by using the suitable paths.

 To view the routing table, you need to type the following route print command on the windows command prompt:

 C: /User/system 32> route print

The following options are associated with the route command:

  • -f: Allows you to clear the routing table of all gateway entries.
  • -p: Use this option with add command. The entire individual route will be added to the registry. When you start TCP/IP, these routes are used to initialize the IP routing table. If we use the —p option with the print command, it will show the list of determined routes that are stored in the registry location of HKEY_LOCAL_MACHENE SYSTEM \CurrentControlSet \ Services \ Tcpip \ Parameters \ PersistentRoutes
  • Command: Allows you to run the add, delete, change, or print command. The descriptions of these commands are as follows:
  • Add: Allows you to add a route
  • Delete: Allows you to delete the route or routes
  • Change: Allows you to modify the existing route
  • Print: Allows you to print the route or routes
  • Destination: Provides the network destination of a given route. The destination can be an IP network address, IP address for particular host route, or the that represents a default route.
  • Netmask: Provides subnet mask that is related to the destination network. The default destination subnet mask is and generally you see the host route.
  • Gateway: Specifies the gateway that depends on the network address and subnet mask.
  • Metric: Defines the cost metric (ranging from 1 to 9999) for a given route that helps you to select a suitable route from multiple routes in a routing table for transmitting the data packets.
  • Interface: Defines the interface number in the interface index over which the destination is reachable.
  • /?: Helps you to view the detailed functionality of the route command.

Some examples of the route command are as follows:

  1. Type route print to show all IP routing table.
  2. Type route add mask 0.0.U.0 to add a default route along with the default gateway address
  3. Type route add mask to add a route to the destination along with the subnet mask and the next-hop address.
  4. Type route -p add mask to add a persistent route to the destination along with the subnet mask and the next-hop address.
  5. Type route delete mask to delete the route to the destination with the subnet mask
  6. Type route change mask to change the next-hop address of a route along with the destination and subnet mask from to


Leave a Reply

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