We help IT Professionals succeed at work.

What is Windows application 'Route.exe' and give example

We googled 'route.exe' and found that It is used to block IP connections to the system but can't seem to fully understand the purpose of this utility as to how applying it to us.  Can an EE give as an easy-to-understand explanation of this tool and some real live example of it being used for? (we use Windows 7 & 8)
Watch Question

ROUTE.EXE is for managing Network Routing Table on your computer (which assign a gateway for the requested IP) either static or dynamic
setting a static route (fixed) of an IP to invalid interface can be used to block some IPs
here is the output for it's help

C:\>route -?

Manipulates network routing tables.

ROUTE [-f] [-p] [-4|-6] command [destination]
                  [MASK netmask]  [gateway] [METRIC metric]  [IF interface]

  -f           Clears 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.

  -p           When used with the ADD command, makes a route persistent across
               boots of the system. By default, routes are not preserved
               when the system is restarted. Ignored for all other commands,
               which always affect the appropriate persistent routes. This
               option is not supported in Windows 95.

  -4           Force using IPv4.

  -6           Force using IPv6.

  command      One of these:
                 PRINT     Prints  a route
                 ADD       Adds    a route
                 DELETE    Deletes a route
                 CHANGE    Modifies an existing route
  destination  Specifies the host.
  MASK         Specifies that the next parameter is the 'netmask' value.
  netmask      Specifies a subnet mask value for this route entry.
               If not specified, it defaults to
  gateway      Specifies gateway.
  interface    the interface number for the specified route.
  METRIC       specifies the metric, ie. cost for the destination.

All symbolic names used for destination 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,
(wildcard is specified as a star '*'), or the gateway argument may be omitted.

If Dest 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. Examples: 157.*.1, 157.*, 127.*, *224*.

Pattern match is only allowed in PRINT command.
Diagnostic Notes:
    Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
    Example> route ADD MASK IF 1
             The route addition failed: The specified mask parameter is invalid.
 (Destination & Mask) != Destination.


    > route PRINT
    > route PRINT -4
    > route PRINT -6
    > route PRINT 157*          .... Only prints those matching 157*

    > route ADD MASK METRIC 3 IF 2
             destination^      ^mask      ^gateway     metric^    ^
      If IF is not given, it tries to find the best interface for a given
    > route ADD 3ffe::/32 3ffe::1

    > route CHANGE MASK METRIC 2 IF 2

      CHANGE is used to modify gateway and/or metric only.

    > route DELETE
    > route DELETE 3ffe::/32

Open in new window


Yes, prior placing the question we "route -?" then proceeded to google about it; there's lot of tech info.  

Please excuse our ignorance on the topic, we are trying to understand it and find a use for it here.  

That said, why would we want to manage the network routing table on our computer?

We read up on 'network routing table' and found technical info (from wiki, microsoft, etc.):

A routing table is a set of rules, often viewed in table format, that is used to determine where data packets traveling over an Internet Protocol (IP) network will be directed.

In computer networking a routing table, or routing information base (RIB), is a data table stored in a router or a networked computer that lists the routes to particular network destinations, and in some cases, metrics (distances) associated with those routes.

During the routing process, the routing decisions of hosts and routers are aided by a database of routes known as the routing table. The routing table is not exclusive to a router. Depending on the routable protocol, hosts may also have a routing table that may be used to decide the best router for the packet to be forwarded. IP hosts have a routing table. IPX hosts do not have a routing table.

... this brings us back to What is route.exe? why use it? Can we see real-live example of its use?

Appreciate EE patiences with us.
Never mind, I'm here to help as far as I can
the real benefits of ROUTE is only when you have multiple NIC or network card (Route call it Interface)
in this case by default each IP you request will be matched with interface IP and MASK if the required IP belongs to that network it will submit to that interface, but when you assign a static route (for a single IP or multiple IP using mask) it will respect this entry and forward to the interface you set,

another implementation when using VPN, VPN client creates a virtual interface so that all the VPN LAN requests will be routed to VPN interface and you can see that on the routing -print command


Ok, trying to understand real live situations for route.exe; when you say multiple NIC, you mean a PC with 2 internet connections (one using to AT&T the Verizon)?  If so, route.exe must be used to tell the NICs their respective IP from the ISP?

(are we understanding correctly?)




We don't see in the near future that we will come to need 2 nics in a PC for 2 ISP.  That said, what else route.exe can be used for?


Hi, recently our question regarding what is route.exe and to supply an example was kindly answered with "... is only when you have multiple NIC or network card".

As our last enter states, we don't see that we will be needing to setup 2 nics in a PC so in order to close the question, we wanted to know what else route.exe can be used for?

Please advice.
The most typical use for "route" with a single NIC is when particular destinations are NOT to be sent to the gateway.

Our subnet has an internet gateway with IP address
We have a VPN device which connects to the internet with its own public address and LAN address of
We connect, via the VPN, to a service located at public IP address

So, when a PC launches a packet destined for, we want the packets to go directly to the VPN device.
In this case, we add a persistent route to that PC in this form:

route add destinationipp mask subnetmask gatewayip metric costmetric

route add mask metric 2

Assuming this PC / NIC has a LAN IP address of then:

route -p add mask metric 3

This is easy to do for testing and can work in small networks.
However, the more general approach is to put a very similar route in the gateway device.
Then, packets destined for (since it's an address NOT on the LAN) will go to the gateway device.
And, in turn, the gateway device will forward those packets back out onto the LAN destined for - the VPN device.
This way, as PCs change, there is no need to add routes to them individually.
Either way works.