Source: www.net130.com Date: 2005-03-03
Route
Display and modify the entry in the local IP routing table. Use ROUTE without parameters to display help.
grammar
Route [-f] [-p] [Command [destination] [mask netmask] [Gateway] [metric metric]] [if interface]]
parameter
-f
Clear all the main routes (the network mask is 255.255.255.255), the loopback network route (the target is 127.0.0.0, the network mask is 255.255.255.0) or multicast routes (target 224.0.0.0, network The entry of the entries of the mask of 240.0.0.0). If it is used in conjunction with one of the commands (such as Add, Change or Delete), the table will be cleared before running the command.
-p
When using the add command, specify the route is added to the registry and initialize the IP routing table when the TCP / IP protocol is started. By default, the added routing will not be saved when the TCP / IP protocol is started. When used with the print command, a permanent routing list is displayed. All other commands ignore this parameter. Permanent routing is stored in the registry is HKEY_LOCAL_MACHINE / SYSTEM / CURRENTCONTROLSET / Services / TCPIP / Parameters / PersistentRoutes.
Command
Specifies the command to run. The following table lists a valid command. Command purpose
Add add route
Change changed the existing deposit
Delete delete routing
Print printing route
Destination
Specifies the network destination address of the route. The target address can be an IP network address (where the host address bit of the network address is set to 0), and the host route is an IP address, and for the default route is 0.0.0.0.
Mask Subnetmask
Specifies the net mask (also known as subnet mask) associated with the network destination address. The subnet mask can be an appropriate subnet mask for the IP network address, and the host route is 255.255.255.255, and for the default route is 0.0.0.0. If ignored, use the subnet mask 255.255.255.255. Defining the relationship between the route due to the target address and the subnet mask, the target address cannot be more detailed than the subnet mask therefor. In other words, if one of the subnet mask is 0, the corresponding bit in the target address cannot be set to 1.
Gateway
Specifies the previous or next hop IP address that exceeds the achievable address set defined by the network objectivity and the subnet mask. For subnet routing locally, the gateway address is an IP address assigned to the connected subnet interface. For remote routes that can be used through one or more routers, the gateway address is a direct access to the adjacent router, which can be directly reached.
Metric metric
To route an integer value (range 1 ~ 9999), it is used to select the route that matches the target address in the forwarding package in multiple routes in the routing table. The selected route has the least hop number. The number of hops can reflect the number of hops, the speed of the path, path reliability, path throughput, and management properties.
IF interface
Specifies the interface index of the interface that the target can arrive. Use the route print command to display a list of interfaces and their corresponding interface indexes. Decimal or hexadecimal values can be used for interface indexes. For hexadecimal values, add 0x in front of the hexadecimal number. When IF parameters are ignored, the interface is determined by the gateway address.
/?
Display help at the command prompt.
Comment
The value of the number of hops in the routing table is large because the TCP / IP is allowed to automatically determine the routing number of routing in the routing table in the IP address, subnet mask, and default gateway according to the IP address of each LAN interface. The default start-up automatic determination interface hop number determines the speed of each interface, adjusts the number of route hop points for each interface, so the route created by the fastest interface has the lowest hop number. To delete a large number of points, disable the number of automatic identified interface hops in the advanced properties of the TCP / IP protocol connected to each LAN. If there is an appropriate entry in the local network file in the SystemRoot / System32 / DRIVERS / ETC folder, the name can be used for DESTINATION. As long as the name can be used to decompose such a standard hostname parsing with the "Domain Name System" (DNS) to resolve the IP address, it can be used for GATEWAY, DNS query using the local host under the Systemroot / System32 / Drivers / etc folder. File and NetBIOS name resolution.
If it is a print or delete command, you can ignore the Gateway parameter, use wildcard to represent the target and gateway. The value of Destination can be a wildcard specified by an asterisk (*). If the specified target contains an asterisk (*) or question mark (?), It is considered to be a wildcard, only printed or delete the matching target route. The asterisk represents any character sequence and the question mark represents any character. For example, 10. *. 1, 192.168. *, 127. * and * 224 * are all effective use of asterisk wildcard.
The combination of invalid targets and subnet masks (net masks) values will display "Route: Bad Gateway Address Netmask" error message. There is one or more of the target to be set to 1, and this error occurs when the corresponding bit in the subnet mask is set to 0. This is inspected by binary representation to indicate the target and subnet mask. The subnet mask of binary representation includes two portions representing a series of 1 and a series of 0 to represent the target host address portion. Check if the target is determined to determine whether the target's host address portion (defined by the subnet mask) is set to 1.
Only Windows NT 4.0, Windows 2000, Windows Millennium Edition and Windows XP Route command supports the -p parameter. This parameter is not supported by Windows 95 or Windows 98's Route command.
This command is only available when an internet protocol (TCP / IP) protocol is installed as components of the network adapter property in the network connection.
example
To display the full content of the IP routing table, type:
Route Print
To display the route started in the IP routing table, type:
Route Print 10. *
To add the default gate address of 192.168.12.1, type:
Route add 0.0.0.0 mask 0.0.0.0 192.168.12.1
To add the target 10.41.0.0, the subnet mask is 255.255.0.0, the next hop address is 10.27.0.1, type:
Route Add 10.41.0.0 Mask 255.255.0.0 10.27.0.1
To add a target 10.41.0.0, the subnet mask is 255.255.0.0, the next hop address is 10.27.0.1 permanent route, type:
Route -P Add 10.41.0.0 Mask 255.255.0.0 10.27.0.1
To add a target 10.41.0.0, the subnet mask is 255.255.0.0, the next hop address is 10.27.0.1, the number of hops is 7, type:
Route Add 10.41.0.0 Mask 255.255.0.0 10.27.0.1 Metric 7 To add the target 10.41.0.0, the subnet mask is 255.255.0.0, the next hop address is 10.27.0.1, the interface index is 0x3, please type :
Route Add 10.41.0.0 Mask 255.255.0.0 10.27.0.1 IF 0x3
To delete the target is 10.41.0.0, the subnet mask is 255.255.0.0, type:
Route delete 10.41.0.0 mask 255.255.0.0
To delete all the routes starting with 10., type:
Route delete 10. *
To turn the target 10.41.0.0, the next hop address of the routing of the subnet mask is 255.255.0.0 is changed from 10.27.0.1 to 10.27.0.25, please type:
Route Change 10.41.0.0 Mask 255.255.0.0 10.27.0.25