Windows Route table command

Source: Internet
Author: User
Tags name database

The Windows Route table command displays and modifies entries in the local IP address routing table. Syntax route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric] [if Interface] parameter-f clears all (The network mask is 255.255.255.255.255) the route table of the route entry whose destination is 127.0.0.0 and The netmask is 255.255.255.0) or Multicast Route entry whose destination is 224.0.0.0 and The netmask is 240.0.0.0. If it is used with one of the commands (such as add, change, or delete), the table is cleared before running the command. When the-p and add commands are used together, specify that the route is added to the Registry and initialize the IP route table when starting the TCP/IP protocol. By default, the added route is not saved when the TCP/IP protocol is enabled. When used with the print command, the permanent route list is displayed. All other commands ignore this parameter. The permanent route is stored in the registry at HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Tcpip \ Parameters \ PersistentRoutes. Command specifies the Command to run. The following table lists valid commands. Command purpose add route change delete route print route Destination specify route network Destination address. The destination address can be an IP network address (where the host address bit of the network address is set to 0), the host route is an IP address, and the default route is 0.0.0.0. Mask subnetmask specifies the netmask (also known as the subnet mask) associated with the target network address ). The subnet mask can be an appropriate subnet mask for IP addresses, 255.255.255.255.255 for host routes, and 0.0.0.0 for default routes. If this parameter is ignored, the subnet mask 255.255.255.255 is used. When defining a route, the destination address cannot be more detailed than the corresponding subnet mask due to the relationship between the destination address and subnet mask. In other words, if one of the subnet masks 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 reachable address set defined by the Network target and subnet mask. For a local connection subnet route, the gateway address is the IP address assigned to the connection subnet interface. For a remote route that can be used only by one or more routers, the gateway address is an IP address that can be directly reached allocated to the adjacent router. Metric Metric specifies the integer of the number of hops required for a route (range: 1 ~ 9999). It is used to select the route that best matches the destination address in the forwarding packet among multiple routes in the routing table. The selected route has the minimum number of hops. The number of hops reflects the quantity, speed, reliability, throughput, and management attributes of the hops. If Interface specifies the Interface index of the Interface that the target can reach. Use the route print command to display the index list of the interface and its corresponding interface. The interface index can be in decimal or hexadecimal format. For hexadecimal values, add 0x before the hexadecimal number. When the if parameter is ignored, the interface is determined by the gateway address. /? Display help at the command prompt. Note that the value in the number of hops column in the routing table is large because TCP/IP is allowed to automatically determine the number of hops of routes in the routing table based on the IP address, subnet mask, and default gateway configuration of each LAN interface.. By default, the auto-determine interface hops determine the speed of each interface and adjust the route hops of each interface. Therefore, the routes created by the fastest interface have the lowest hops. To delete the number of hops, disable automatic interface hops in the Advanced properties of the TCP/IP protocol for each LAN connection. If an appropriate entry exists in the local network file of the systemroot \ System32 \ Drivers \ Etc folder, the name can be used for Destination. As long as the name can be resolved to an IP address through the standard host name resolution technology such as "Domain Name System" (DNS) query, it can be used for Gateway, DNS query uses the local host file and NetBIOS name stored in the systemroot \ System32 \ Drivers \ Etc folder for resolution. For the print or delete command, you can ignore the Gateway parameter and use wildcards to indicate the target and Gateway. The value of Destination can be a wildcard specified by the asterisk. If the specified target contains an asterisk (*) or question mark (?), It is regarded as a wildcard and only prints or deletes matched target routes. An asterisk represents a sequence of any character, and a question mark represents any character. For example, 10. *. 1,192. 168. *, 127. *, and * 224 * are all effective use of the asterisk wildcard. An error message "Route: bad gateway address netmask" is displayed when an invalid combination of target and subnet mask (netmask) values is used. This error occurs when one or more bits in the target are set to 1 and their corresponding bits in the subnet mask are set to 0. You can use binary notation to indicate the target and subnet mask to check this situation. The subnet mask in binary format includes a series of 1 representing the destination network address and a series of 0 representing the destination host address. Check whether some bits of the target host address (defined by the subnet mask) are set to 1. Only the route commands of Windows NT 4.0, Windows 2000, Windows Millennium Edition, and Windows XP support the-p parameter. The route command of Windows 95 or Windows 98 does not support this parameter. This command is available only when the Internet Protocol (TCP/IP) is installed as a component of the network adapter attribute in a network connection. To show the complete content of the IP route table, type: route print to show the IP route table with 10. enter route print 10. * To add a default route with the default gateway address 192.168.12.1, type: route add 0.0.0.0 mask 0.0.0.0 192.168.12.1 to add a route with the target 10.41.0.0, subnet mask 255.0.0, And the next hop address 10.27.0.1, type: route add 10.41.0.0 mask route 255.0.0 10.27.0.1 to add a permanent route whose destination is 10.41.0.0, The subnet mask is 255.255.0.0, And the next hop address is 10.27.0.1. Type: route-p add 10.41.0.0 mask route 0.0 10.27.0.1 add the target 10.41.0. 0. The subnet mask is 255.0.0, the next hop address is 10.27.0.1, and the number of hops is 7. Type: route add 10.41.0.0 mask route 255.0.0 10.27.0.1 metric 7 to add the target 10.41.0.0, the subnet mask is 255.0.0, the next hop address is 10.27.0.1, and the interface index is 0x3. Type: route add 10.41.0.0 mask route 255.0.0 10.27.0.1 if 0x3 to delete the route with the target 10.41.0.0, for a route entry whose subnet mask is 255.255.0.0, type: route delete 10.41.0.0 mask 255.255.255.0.0 to delete an IP route table with 10. for all the starting routes, type: route delete 10. * set the target to 10.41.0.0 and the subnet mask to 255.255. The next hop address of the 0.0 route is changed from 10.27.0.1 to 10.27.0.25. Type: route change 10.41.0.0 mask route 0.0 10.27.0.25 route command routing ip add/delete/set/show interface add, delete, configure, or display general IP route settings on the specified interface. Routing ip add/delete/set/show filter add, delete, configure, or display IP packet filters on the specified interface. Routing ip add/delete/show boundary add, delete, or display multicast boundary settings on the specified interface. Routing ip add/set ipiptunnel add or configure IP interfaces in the IP address. Routing ip add/delete/set/show rtmroute add, configure, or display the route table manager route. Routing ip add/delete/set/show persistentroute add, delete, configure, or display continuous routing. Routing ip add/delete/set/show preferenceforprotocol add, delete, configure, or display the priority of the routing protocol. Routing ip add/delete/set/show scope add, delete, or display multicast scope. Routing ip set/show loglevel configuration or display the Global IP record level. Routing ip show helper displays all the Netsh utilities of the IP. Routing ip show protocol displays all running IP routing protocols. Routing ip show mfe displays multicast forwarding items. Routing ip show mfestats displays multicast forwarding item statistics. Routing ip show boundarystats displays IP multicast boundary. Routing ip show rtmdestinations displays the target in the route table manager route table. Routing ip show rtmroutes displays the routes in the route table of the route table manager. Routing ip nat set/show global configuration or display global Network Address Translation (NAT) settings. Routing ip nat add/delete/set/show interface add, delete, configure, or display the NAT settings of the specified interface. Routing ip nat add/delete addressrange add or delete an address range in the public address pool of the NAT interface. Routing ip nat add/delete addressmapping add or delete NAT address ing. Routing ip nat add/delete portmapping add or delete NAT port ing. Routing ip autodhcp set/show global configuration or display the global DHCP distributor parameters. Routing ip autodhcp set/show interface configuration or display DHCP distributor settings for the specified interface. Routing ip autodhcp add/delete exclusion adds or deletes an exclusion range in the DHCP distributor address range. Routing ip dnsproxy set/show global configuration or display global DNS proxy parameters. Routing ip dnsproxy set/show interface configuration or display DNS proxy parameters of the specified interface. Routing ip igmp set/show global configuration or display IGMP global settings. Routing ip igmp add/delete/set/show interface add, delete, configure, or display IGMP on the specified interface. Routing ip igmp add/delete staticgroup add or delete the static multicast group of the specified interface. Routing ip igmp show grouptable displays the IGMP Host group table. Routing ip igmp show ifstats displays IGMP statistics for each interface. Routing ip igmp show iftable displays the IGMP Host group for each interface. Routing ip igmp show proxygrouptable: displays the IGMP group table of the IGMP proxy interface. Routing ip igmp show rasgrouptable displays the group table of the Internet interfaces used by the remote access server. Routing ip ospf set/show global configuration or display global OSPF settings. Routing ip ospf add/delete/set/show interface add, delete, configure, or display OSPF on the specified interface. Routing ip ospf add/delete/set/show area add, delete, configure, or display the OSPF area. Routing ip ospf add/delete/show range add, delete, configure, or display a range in the specified OSPF area. Routing ip ospf add/delete/set/show virtif add, delete, configure, or display OSPF Virtual interfaces. Routing ip ospf add/delete/show neighbor add, delete, configure, or display OSPF neighbors. Routing ip ospf add/delete/show protofilter add, delete, configure, or display the routing information sources of OSPF external routes. Routing ip ospf add/delete/show routefilter add, delete, configure, or display the routing filtering of OSPF external routes. Routing ip ospf show areastats displays OSPF region statistics. Routing ip ospf show lsdb displays the OSPF link status database. Routing ip ospf show virtifstats displays OSPF Virtual link statistics. Routing ip relay set global configuration "DHCP relay agent" global settings. Routing ip relay add/delete/set interface add, delete, or configure "DHCP relay agent" settings on the specified interface. Routing ip relay add/delete dhcpserver add or delete the IP address of the DHCP server in the DHCP server address list. Routing ip relay show ifbinding display interface IP Address binding. Routing ip relay show ifconfig displays the "DHCP relay agent" configuration for each interface. Routing ip relay show ifstats displays DHCP statistics for each interface. Routing ip rip set/show global configure ip rip global settings. Routing ip rip add/delete/set/show interface add or configure ip rip settings on the specified interface. Routing ip rip add/delete peerfilter add or delete the RIP peer filter. Routing ip rip add/delete acceptfilter add or delete RIP route filters in the list of accepted routes. Routing ip rip add/delete announcefilter add or delete RIP route filters in the published route list. Routing ip rip add/delete/show neighbor add or delete RIP neighbors. Routing ip rip set/show flags configure advanced ip rip settings on the specified interface. Routing ip rip show globalstats displays global RIP parameters. Routing ip rip show ifbinding display interface IP Address binding. Routing ip rip show ifstats displays the RIP statistics for each interface. IPX netsh route command routing ipx add/set staticroute add or configure static IPX route in the IPX route table. Routing ipx add/set staticservice add or configure the static SAP service in the SAP service table. Routing ipx add/set filter add or configure IPX packet filter on the specified interface. Routing ipx add/set interface enables IPX routing on the request dialing interface, or configures IPX settings on the specified interface. Routing ipx set global configuration global IPX route settings. Routing ipx rip add/set filter add and configure the RIP route filter. Routing ipx rip set global configuration RIP settings for global IPX. The routing ipx rip set interface configures the RIP settings of IPX on the specified interface. Routing ipx sap add/set filter add or configure the SAP service filter. Routing ipx sap set global configuration SAP settings for global IPX. Routing ipx sap set interface configure the SAP settings of IPX on the specified interface. Routing ipx netbios add nbname add the static NETBIOS name to the IPX NetBIOS name table. Routing ipx netbios set interface configure IPX-based NetBIOS settings on the specified interface. Route helps Manipulates network routing tables. supplement by the respondent 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 guest SS bo Ots 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. 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 param Eter is the 'netmask' value. netmask Specifies a subnet mask value for this route entry. if not specified, it defaults to limit 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 gat Eway 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 *. the PRINT command will show both IPv4 and IPv6 routes, but the ADD, DELETE, and CHANGE commands work only for IPv4 routes. for IPv6 routes, use the 'interface ipv6' context in netsh.exe. 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 ADD 157.0.0.0 MASK route 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 PRINT> route PRINT 157 *.... only prints those matching 157 *> route CHANGE 157.0.0.0 MASK 0.0.0 157.55.80.5 METRIC 2 IF 2 CHANGE is used to modify gateway and/or metric only.> route PRINT> route DELETE 157.0.0.0> route PRINT

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.