Route and IPConfig

zhaozj2021-02-16  166

Route

Display and modify the entry in the local IP routing table. Use ROUTE without parameters to display help.

Syntax Route [-f] [-p] [command [destination] [mask netmask] [Gateway] [metric metric]] [if interface]]

Parameters -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 routing (target 224.0. 0.0. The routing of the network mask is 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.

When using the add command, the specified route is added to the registry and initializes the IP routing table when starting the TCP / IP protocol. 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 The following table lists a valid command. Added Routing Change Change the exit Route Delete Delete Route Print Print Routing

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 top or next hop IP address that exceeds the reachable 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 For routing the integer value of the required hop number (range is 1 ~ 9999), it is used to select the most matching route to the target address in the forwarding package in multiple routing 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 goal contains an asterisk or question mark (?), It is considered to be a wildcard, only print 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. Note: 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 a 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 the 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, type: route add 10.41.0.0 Mask 255.255.0.0 10.27.0.1 IF 0x3

To delete the target 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 routes started in the IP routing table, 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

IPCONFIG IPConfig Displays all current TCP / IP network configuration values, refresh Dynamic Host Configuration Protocol (DHCP), and Domain Name System (DNS) settings. Use IPCONFIG without parameters to display the IP address, subnet mask, and default gateway of all adapters.

Syntax ipconfig [/ all] [/ renew [adapter> [/ release [adapter> [/ flushdns] [/ displaydns] [/ registerdns] [/ showclassid adapter] [/ setclassid adapter] [/ setClassID adapter] [

Parameters / ALL Displays full TCP / IP configuration information for all adapters. In the absence of this parameter, IPConfig only displays the default gate value of the IP address, subnet mask, and each adapter. The adapter can represent a physical interface (such as a installed network adapter) or a logical interface (such as a dial-up connection). / renew [adapter] Updates DHCP configurations of all adapters (if an adapter is not specified), or a specific adapter (if an adapter parameter) is included. This parameter is only available on a computer that has a network card configured to automatically obtain an IP address. To specify the adapter name, type the adapter name displayed using the IPConfig command without parameters. / release [adapter] Sends a DHCPRELEASE message to the DHCP server to release all adapters (if an adapter is not specified) or the current DHCP configuration of the specific adapter (if an adapter parameter) is configured and discards the IP address configuration. This parameter can disable the TCP / IP configured to automatically obtain an adapter for the IP address. To specify the adapter name, type the adapter name displayed using the IPConfig command without parameters. / flushdns cleans and reset the contents of the DNS client parser. If necessary, during DNS troubleshooting, you can use this procedure from the cache to discard your negative cache records and any other dynamic additive records. / DisplayDNS Displays the contents of the DNS client parser cache, including recording preloaded from the local host file and any resource records recently obtained by the name query by the computer. DNS Customer Services uses this information to quickly resolve the name of frequent queries before querying the DNS server configured. / RegisterDNS initializes the manual registration of the DNS name and IP address configured on your computer. You can use this parameter to troubleshoot the failed DNS name registration or resolve dynamic update issues between customers and DNS servers without having to restart the customer computer. The DNS settings in the TCP / IP Protocol Advanced property can determine which names are registered in the DNS. / showclassid adapter Displays the DHCP category ID of the specified adapter. To see the DHCP category ID of all adapters, you can use an asterisk (*) wildcard instead of Adapter. This parameter is only available on a computer that has a network card configured to automatically obtain an IP address. / setClassID Adapter [classid] Configure the DHCP category ID of a specific adapter. To set up the DHCP category ID of all adapters, you can use an asterisk (*) wildcard instead of Adapter. This parameter is only available on a computer that has a network card configured to automatically obtain an IP address. If the DHCP category ID is not specified, the current category ID is deleted. /? Display help at the command prompt. Note ipconfig is equivalent to WinIPCFG, which is available on Windows Millennium Edition, Windows 98, and Windows 95. Although Windows XP does not provide a graphical interface as a WiniPCFG command, you can use the Network Connection to view and update the IP address. To do this, turn on the network connection, right-click on a network connection, click Status, and then click the Support tab. This command is best for computers configured to automatically get IP addresses. It enables users to determine which TCP / IP configuration values ​​are configured by DHCP, auto-dedicated IP address (APIPA), and other configurations. If the Adapter name contains spaces, use quotation marks (ie "Adapter Name" on both sides of the adapter name. For the adapter name, IPConfig can use an asterisk (*) wildcard character to specify an adapter that is starting with the specified string, or the name contains a specified string adapter.

For example, local * can match all adapters at starting with string locals, while * con * can match all adapters containing string CON. 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 basic TCP / IP configuration of all adapters, type: ipconfig

To display the full TCP / IP configuration of all adapters, type:

IPConfig / ALL

Only the configuration of the "local connection" adapter is allocated by DHCP, type:

IPCONFIG / Renew "Local Area Connection"

To clean up the DNS parser cache during the resolution of DNS, type:

IPConfig / FlushDNS

To display the DHCP category ID of all adapters starting with LOCAL, type:

ipconfig / showclassid local *

To set the DHCP category ID of the Local Connection adapter to TEST, type:

Ipconfig / setClassID "Local Area Connection" TEST

转载请注明原文地址:https://www.9cbs.com/read-8922.html

New Post(0)