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)
rayluvsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FarWestCommented:
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 255.255.255.255.
  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 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
             The route addition failed: The specified mask parameter is invalid.
 (Destination & Mask) != Destination.

Examples:

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

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

    > route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2

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

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

Open in new window

0
rayluvsAuthor Commented:
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.
0
FarWestCommented:
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
0
Become an IT Security Management Expert

In today’s fast-paced, digitally transformed world of business, the need to protect network data and ensure cloud privacy has never been greater. With a B.S. in Network Operations and Security, you can get the credentials it takes to become an IT security management expert.

rayluvsAuthor Commented:
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?)
0
FarWestCommented:
Exactly
0
rayluvsAuthor Commented:
Thanx.

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?
0
rayluvsAuthor Commented:
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.
0
Fred MarshallPrincipalCommented:
The most typical use for "route" with a single NIC is when particular destinations are NOT to be sent to the gateway.

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

So, when a PC launches a packet destined for 100.100.30.40, 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 10.0.0.0 mask 255.0.0.0 192.168.0.1 metric 2

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

route -p add 100.200.30.40 mask 255.255.255.0 10.0.0.5 metric 3 10.0.0.100

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 100.200.30.40 (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 10.0.0.5 - the VPN device.
This way, as PCs change, there is no need to add routes to them individually.
Either way works.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rayluvsAuthor Commented:
Thanx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Network Management

From novice to tech pro — start learning today.