Command to manually configure the routes in the routing table.
Availability
The route.exe command is an external command that is available in the below Microsoft operating systems.
Windows 95
Windows 98
Windows ME
Windows 2000
Windows XP
Windows Vista
Windows 7
Syntax
ROUTE [-f] [-p] [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. 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. This option is not supported Windows'95. command | |||||
command | One of these: PRINT Prints a 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. ll 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*. Diagnostic Notes: Examples: > route PRINT
If IF is not given, it tries to find the best interface for a given > route PRINT One way to use this would be as follows: You can't ping the server that you are connecting to, but you know the ip address to be 127.16.16.10 >route PRINT Interface List Active Routes: ** notice that no gateway for the current ip goes to 255.255.255.0, so it must be added. Now do the below command. >route ADD 127.16.0.0 MASK 255.255.255.0 **Then do the below command: >route print Active Routes: **Notice the ** ip address gives me the default gateway. |