Routing in Windows

 

Rounting in Windows

The Route Command
At this point, System #2 can communicate directly with System #1 and System #3. System #1 cannot reach System #3 or System#4
(because it does NOT know how to reach these networks).

System #1 needs information on how to reach System #3, by either defining System #2 as it's default Gateway or by manually manipulating the TCP/IP routing tables using the command line utility ROUTE. We are going to manipulate the Routing Table in order to accomplish this. Why? Well, let's say you change a Gateway/Router to another IP Address. You could easily update all machines with a batch file in a login script, but that's another topic.

If this is a small Network, you could easily add ALL Default Gateways in the TCP/IP Protocol's properties of all machines instead of even messing with the Routing Table.

Copied from the Route Command Index in the Windows NT Help File
Route

Manipulates network routing tables. This command is available only if the TCP/IP protocol has been installed.

route [-f] [-p] [command [destination] [mask subnetmask] [gateway] [metric costmetric]]

Parameters

-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. When used with the PRINT command, displays the list of registered persistent routes. Ignored for all other commands, which always affect the appropriate persistent routes.

command
Specifies one of four commands

Command Purpose
print Prints a route
add Adds a route
delete Deletes a route
change Modifies an existing route

destination
Specifies the computer to send command.

mask subnetmask
Specifies a subnet mask to be associated with this route entry. If not specified, 255.255.255.255 is used.

gateway
Specifies gateway.

All symbolic names used for destination or gateway are looked up in the network and computer name database files NETWORKS and HOSTS, respectively. If the command is print or delete, wildcards may be used for the destination and gateway, or the gateway argument may be omitted.

metric costmetric
Assigns an integer cost metric (ranging from 1 to 9999) to be used in calculating the fastest, most reliable, and/or least expensive routes.

On System #1 you would need to add the following route:

ROUTE ADD 192.168.2.0 mask 255.255.255.0 192.168.1.2 -p

This informs System#1, that all communications for the Network 192.168.2.x has to go via 192.168.1.2. If this is a Windows 9x machine, you would simply add 192.168.1.2 as the default gateway, which you could also do for a NT workstation. The choice is yours.

 

On System #2 you would need to add the following route:

ROUTE ADD 192.168.3.0 mask 255.255.255.0 192.168.2.11 -p

This informs System #2, that all communications for the Network 192.168.3.x  has to go via 192.168.2.11 ( which is System#3). Note: If you want all routes or routes not indentified (such as the Internet) to go through just one gateway you would route 0.0.0.0 mask 0.0.0.0 <Gateway Computer's IP Address>.

Note the '0' in the route-command above translates to 'any system with an address 192.168.3.x if a subnet of 255.255.255.0 was used, which in our example includes System#4

Note the -p switch used. This switch is only available in Windows NT. If you want the route to be persistent, use this switch.

You should now have a basic understanding. Configure System #3 and #4 using the same method. System #3 and System #4 will need to know how to reach Network #1. I guess I could show you, but then how would you learn. Note; each router should know about every router's network. Remember that Network #2, although it has no workstations, is a network.

If you would like more info on the ROUTE command, in Windows NT 4.0, click on Start then Help. Click on the Index Tab and type Route Utility.

 

Next