Manipulate network routing tables. Route packets of network traffic from one subnet to another by modifying the route table.


   Display route details:
      ROUTE [-f] PRINT [destination_host] [MASK subnet_mask_value] [gateway] 
         [METRIC metric] [IF interface_no.]

   Add a route:
      ROUTE [-f] [-p] ADD [destination_host] [MASK subnet_mask_value] [gateway] 
         [METRIC metric] [IF interface_no.]

   Change a route:
      ROUTE [-f] CHANGE [destination_host] [MASK subnet_mask_value] [gateway] 
         [METRIC metric] [IF interface_no.]

   Delete a route:
      ROUTE [-f] DELETE [destination_host] [MASK subnet_mask_value] [gateway] 
         [METRIC metric] [IF interface_no.] 

   -f          Clear (flush) the routing tables of all gateway entries.  If this is
               used in conjunction with one of the commands, the tables are
               cleared prior to running the command.

               The address (or set of addresses) that you want to reach.

   -p          Create a persistent route - survives system reboots.

               The subnet mask value for this route entry.
               This defines how many addresses are there.
               If not specified, it defaults to

   gateway     The gateway.

   interface   The interface number (1,2,...) for the specified route.
               If the option `IF interface_no` is not given, ROUTE will try
               to find the best interface available.

   metric      The metric, ie. cost for the destination.

Note that routes added to the table are not made persistent unless the -p switch is specified. Non-persistent routes only last until the computer is rebooted.

Symbolic names used for Destination_Host are looked up in the network database file NETWORKS.

The symbolic names for gateway are looked up in the host name database file HOSTS.

If the command is PRINT or DELETE. Destination or gateway can be a wildcard ('*'), or the gateway argument can be omitted.

An IP address mask of means everything. (rather like the *.* wildcard). In other words it says: When matching this pattern, don’t worry about matching any of the bits - everything matches.

If Destination_Host contains a * or ?, it is treated as a shell pattern, and only matching destination routes are printed. The '*' matches any string, and '?' matches any one char.



“Get your kicks on ROUTE 66” ~ Jack Kerouac.

Related commands

NETSTAT-rn - Display TCP/IP network connections, routing and protocol statistics.
TRACERT - Trace route to a remote host.
Equivalent bash command (Linux): ip route - Manipulate route table entries.

Copyright © 1999-2024
Some rights reserved