If you are playing a router, you know that the router is very fun command abbreviation. For example, "Sh Int" means "show interface". Now Windows 2000 has a similar interface tool called Netsh.
We entered NetSh under the cmd shell of Windows 2000: Netsh> prompt, enter int ip display: Interface IP> and enter DUMP, we can see the current system network configuration:
# ---------------------------------- # Interface ip configure # ---------- ------------------------ Pushd Interface IP
# Interface IP Configuration for "Local Area Connection"
set address name = "Local Area Connection" source = static addr = 192.168.1.168 mask = 255.255.255.0 add address name = "Local Area Connection" addr = 192.1.1.111 mask = 255.255.255.0 set address name = "Local Area Connection" Gateway = 192.168.1.100 gwmetric = 1 set DNS name = "local area connection" Source = static addr = 202.96.209.5 set wins name = "local area connection" Source = static addr = none
POPD # end of interface ip configuration
The above introduction is one way to operate by interactive. We can enter the command directly: "Netsh Interface IP Add Address" Local Area Connection "10.0.0.2 255.0.0.0" to add an IP address.
If you don't know the grammar, don't be tight! At the prompt, enter? You can find the answer. Convenient and inconvenient? It turns out that Microsoft's things are there, there are so some people who love. Unfortunately, it is very few!
The part of the Windows Network Command Line program includes:
Using IPConfig / ALL View Configuration Using IPConfig / Renef Refresh Configuration Using IPConfig Management DNS and DHCP Category ID Using Ping Test Connection Using ARP Solving Hardware Address Questions Using NetBIOS Name Using NetStat Display Connection Statistics Using Tracert Tracking Network Connection Using Pathping Test Router Use IPConfig / ALL to view configuration discovery and resolve TCP / IP network issues, check the TCP / IP configuration on your computer. Host configuration information can be obtained using the ipconfig command, including IP addresses, subnet masks, and default gateways.
note
For Windows 95 and Windows 98 clients, use the WiniPCFG command instead of the IPConfi G command. When using the IPConfig command with / all option, a detailed configuration report for all interfaces, including any configured serial port. Using IPConfig / ALL, you can redirect the command output to a file and paste the output into other documents. You can also use this output to confirm the TCP / IP configuration of each computer on the network, or further investigate the TCP / IP network problem. For example, if the IP address of the computer configuration is repeated with the existing IP address, the subnet mask is displayed as 0.0.0.0.
The following example is the ipconfig / all command output, which is configured to dynamically configure TCP / IP using the DHCP server and use the WINS and DNS server to resolve the name.
Windows 2000 IP Configuration
Hybrid ip routing enabled ............: No
Ethernet Adapter Local Area Connection:
.................................................. 00-92.168.0.112 Subnet Mask............................. The........................................... 10.1.0.
If the TCP / IP configuration is no problem, the next test can be connected to other hosts on the TCP / IP network.
Use the IPConfig / Renew Refresh Configuration to resolve the TCP / IP network problem, check the TCP / IP configuration on the computer that encounters a problem. If the computer enables DHCP and uses the DHCP server to get the configuration, use the ipconfig / renew command to start refreshing the Rent.
When using IPConfig / Renew, all NICs on a computer (except those manual configuration adapters) are used to connect to DHCP servers, update existing configurations or get new configurations.
You can also immediately release the current DHCP configuration of the host using the ipconfig command with the / Release option. For more information on the DHCP and rental processes, please refer to how the client gets the configuration.
note
For Windows 95 and Windows 98 customers enabled by DHCP, use the REL Ease and Renew options for the Winipcfg command, not the ipconfig / release and ipconfig / renew commands, manually release or update the customer's IP configuration lease. Managing DNS and DHCP category IDs using IPCONFIG can also use ipconfig commands: display or reset DNS cache. For more information, see Use IPConfig to view or reset the customer resolution program.
Refresh the registered DNS name. For more information, see Updating DNS Customer Registration with IPConfig.
Displays the DHCP Category ID of the adapter. For more information, see Displaying the DHCP Category ID information on the client.
Set the DHCP category ID of the adapter. For more information, see Setting the DHCP Category ID information on the client.
Connection to the ping command using the PING test helps to verify the connectivity of the IP level. When discovering and resolving issues, you can send ICMP response requests to the target host name or IP address using ping. If you need to verify that the host can connect to the TCP / IP network and network resources, use ping. You can also use ping to isolate network hardware issues and incompatible configurations.
Usually, it is best to verify that the route between the local computer and the network host exists with the ping command, and the IP address of the network host to which you want to connect. The IP address of the PING target host does not respond, as follows:
PING ip_address
When using ping, you should perform the following steps:
Ping loopback address Verify that TCP / IP is installed on the local computer and whether the configuration is correct. Ping 127.0.0.1
Ping local computer IP address verification is added correctly to the network. PING ip_address_of_local_host
The IP address of the ping default gateway verifies whether the default gateway is running and whether it can be connected to the local host on the local network. PING ip_address_of_default_gateway
The IP address verification of the PING remote host can communicate via the router. PING ip_address_of_remote_host
The ping command parsing the computer name into an IP address with the name of the Windows socket style, so if the name is successful, the problem is failed to use the name PING, and the problem is on the address or name resolution, not the network communication problem. For more information, see Using ARP to resolve hardware address issues.
If you can't use ping in any point, please confirm:
Restart your computer after installing and configuring TCP / IP. "Internet Protocol (TCP / IP) Properties dialog box" General "IP address on the local computer on the General tab is valid and correct. Enable IP routing, and link between the router is available. You can use the different options of the ping command to specify the packet size to use, how many data packets are to be sent, whether to record the route used, the living time (TTL) value to use, and whether the "no segment" flag is set. Can I type ping -? View these options.
The following example shows how to send two pings to IP addresses 172.16.48.10, each is 1,450 bytes:
C: /> ping -n 2 -l 1450 172.16.48.10 pinging 172.16.48.10 with 1450 bytes of data:
Reply from 172.16.48.10:bytes=1450 Time <10ms TTL = 32 reply from 172.16.48.10:bytes=1450 time <10ms TTL = 32
Ping Statistics for 157.59.8.1: Packets: Sent = 2, Received = 2, Lost = 0 (0% LOSS), Approximate Roundtrip Times in Milli-Seconds: minimum = 0ms, Maximum = 10ms, Average = 2ms By default, The time to "request timeout" before the time waiting for 1,000 milliseconds (1 second) allows each response to return. If a long-term delayed link is passed through the remote system, such as a satellite link, the response may take longer to return. You can use the -w (wait) option to specify a longer time timeout. Using the ARP Solving Hardware Address Questions "Address Resolution Protocol (ARP)" Allows the host to find media access control addresses of hosts on the same physical network, if the latter's IP address is given. To make the ARP more efficient, each computer cache IP to the media access control address map eliminates the repeated ARP broadcast request.
You can use the ARP command to view and modify the ARP entry on the local computer. The ARP command is useful for viewing ARP cache and resolving address resolution issues.
For more information, see Viewing the Address Resolution Protocol (ARP) cache and add a static ARP cache item.
Solve NetBIOS names on TCP / IP to resolve NetBIOS names into IP addresses. TCP / IP provides a lot of options for NetBi OS name, including local cache search, WINS server query, broadcast, DNS server query, and LMHOSTS and host file search.
NBTSTAT is a useful tool to solve the NetBIOS name resolution problem. You can use the nbtstat command to delete or correct preloaded items:
NBTSTAT-N Displays the names local registered locally locally on the system, or the program, or a redirector. NBTSTAT -C Displays the NetBIOS name cache, contains the name of the other computer to the address mapping. NBTSTAT -R Clears the name cache and then reload from the LMHOSTS file. NBTSTAT -RR releases the NetBIOS name registered on the WINS server and refreshes their registration. NBTSTAT -A Name executes the NetBIOS adapter status command to the computer specified by the Name. The adapter status command will return to the local NetBIOS name table of the computer, as well as the media access control address of the adapter. NBTSTAT -S lists the current NetBIOS session and its status (including statistics), as shown in the following example: NetBIOS Connection Table
Local name State In / Out Remote Host Input Output ---------------------------------------- -------------------------- Corp1 <00> Connected Out Corpsup1 <20> 6MB 5MB CORP1 <00> Connected Out Corpprint <20> 108kb 116kb Corp1 <00> Connected Out Corpsrc1 <20> 299kb 19kb Corp1 <00> Connected Out CorpeMail1 <0> Listening Using NetStat Display Connection Statistics You can use the netstat command to display protocol statistics and current TCP / IP connections. The NetStat -a command will display all connections, and NetStat -r displays routing tables and active connections. The NetStat -E command will display the Ethernet statistics, and NetStat -s displays statistics for each protocol. If NetStat -n is used, the address and port number cannot be converted into a name. Below is an exemplary example of NetStat: c: /> netstat -e interface statistics
Received Sent Bytes 3995837940 47224622 Unicast Packets 120099 131015 Non-Unicast Packets 7579544 3823 Discards 0 0 Errors 0 0 Unknown Protocols 363054211
C: /> netstat -a
Active Connections
Proto Local Address Foreign Address State TCP CORP1: 1572 172.16.48.10:nbsession ESTABLISHED TCP CORP1: 1589 172.16.48.10:nbsession ESTABLISHED TCP CORP1: 1606 172.16.105.245:nbsession ESTABLISHED TCP CORP1: 1632 172.16.48.213:nbsession ESTABLISHED TCP CORP1: 1659 172.16.48.169:nbsession ESTABLISHED TCP CORP1: 1714 172.16.48.203:nbsession ESTABLISHED TCP CORP1: 1719 172.16.48.36:nbsession ESTABLISHED TCP CORP1: 1241 172.16.48.101:nbsession ESTABLISHED UDP CORP1: 1025 *: * UDP CORP1: snmp *: * UDP CORP1: NBNAME *: * UDP CORP1: NBDATAGRAM *: * UDP CORP1: NBNAME *: * UDP CORP1: NBDATAGRAM *: *
C: /> netstat -s ip statistics
Packets Received = 5378528 Received Header Errors = 738854 Received Address Errors = 23150 Datagrams Forwarded = 0 Unknown Protocols Received = 0 Received Packets Discarded = 0 Received Packets Delivered = 4616524 Output Requests = 132702 Routing Discards = 157 Discarded Output Packets = 0 Output Packet No Route = 0 Reassembly Required = 0 Reassembly Successful = 0 Reassembly Failures = Datagrams Successfully Fragmented = 0 Datagrams Failing Fragmentation = 0 Fragments Created = 0ICMP Statistics Received Sent Messages 693 4 Errors 0 0 Destination Unreachable 685 0 Time Exceeded 0 0 Parameter Problems 0 0 Source quenches 0 0 redirects 0 0 Echoes 4 0 Echo replies 0 4 TimeStamps 0 0 TimeStamp Replies 0 0 Address Mask REPLIES 0 0 0
TCP Statistics
Active Opens = 597 passive opens = 135 failed connection attempts = 107 reset connection = 91 current connections = 8 segments receive = 106770 segments required = 118431 segments retransmitted = 461
UDP statistics
DataGrams received = 4157136 NO ports = 351928 receive errors = 2 DataGrams Sent = 13809
Using Tracert Tracking Network Connection Tracert (Tracking Routing) is a routing trace utility to determine the path taken by the IP datagram access. The tracert command uses the IP Living Time (TTL) field and ICMP error messages to determine the route from one host to other hosts on the network.
Tracert works By sending a Different IP Survival Time (TTL) response packets to the target, Tracert Diagnostics determine the route taken by the target. Each router on the request path will deliver at least the TTL on the packet before forwarding the packet. When the TTL on the packet is reduced to 0, the router should return the "ICMP timeout" message.
Tracert first sends a response packet for TTL 1, incrementing TTL at a subsequent delivery process, until the target response or TTL reaches the maximum value, thereby determining the route. Determine the route by checking the "ICM P has timed out" from the intermediate router. Some routers are not inquired to discard the TTL expired packets directly, which can not see in the Tracert utility.
The tracert command prints out of the near-end router interface list in the path to the "ICMP Timeout" message. If you use the -d option, the Tracert utility is not queried to DNS on each IP address. In the following example, the packet must be reached by two routers (10.0.0.1 and 192.168.0.1) to reach 172.16.0.99. The default gateway for the host is 10.0.0.1, 192.168.0.0 The IP address of the router on the network is 192.168.0.1.
C: /> Tracert 172.16.0.99 -d Tracing Route to 172.16.0.99 Over A Maximum of 30 HOPS 1 2S 3S 2S 10, 0.0, 1 2 75 ms 83 MS 88 MS 192.168.0.1 3 73 MS 79 MS 93 MS 172.16. 0.99 TRACE COMPLETE. Solving problems with Tracert can use the tracert command to determine the stop position on the network. In the following example, the default gateway determines that 19 2.168.10.99 does not have a valid path. This may be the problem of router configuration, or 192.168.10. 0 network does not exist (wrong IP address).
C: /> Tracert 192.168.10.99
Tracing route to 192.168.10.99 over a maximum of 30 hops
1 10.0.0.1 Reports: Destination Net Unreachable.
TRACE COMPLETE.
The Tracert utility is very useful for solving large network problems. You can take several paths to the same point.
Tracert Command Line Options Tracert command supports multiple options as shown in the following table.
Tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
Option Description -D Specifies that the IP address is not resolved to the host name. -h maximum_hops Specifies the number of hops to track the route of the host called target_name. -j host-list Specifies a list of router interfaces in the Tracert utility packet. -w Timeout Waiting TIMEOUT for the number of milliseconds specified each time. Target_name The name or IP address of the target host.
For more information, see Tracking the path using the tracert command.
Using the PATHPING Test Router PATHPING command is a routing trace tool that combines the features of the ping and tracert commands and other information provided by these two tools. The PATHPING command sends the packet to each router to the path to the most final target, and then returns from each hop based on the packet-based computer result. Since the command displays the extent to which the packet is lost on any given router or the link, it is easy to determine the router or link that may cause a network problem. Some options are available, as shown in the following table.
Option Name Features - N HostNames does not resolve the address as a host name. -H Maximum HOPS Search The maximum number of hop points for the target. -g Host-List releases the source rout along the routing list. -p Period Waiting for milliseconds between ping. -q num_queries number of queries for each hop. -w time-out is the number of milliseconds waiting for each time. -T Layer 2 TAG connects the second layer priority tag (e.g., IEEE 802.1p) to the packet and sends it to each network device in the path. This helps identify network devices that do not correctly configure the second layer priority. -T switch is used to test service quality (QoS) connectivity. -R RSVP Test CHE Checks whether to determine whether each router in the path supports "Resource Retention Protocol (RSVP)", this protocol allows the host to retain a certain amount of bandwidth for the data stream. -R switch is used to test service quality (QoS) connectivity. The default hop number is 30, and the default waiting time before the timeout is 3 seconds. The default time is 250 milliseconds, and the number of times the query is performed along the path is 100.
The following is a typical pathping report. The statistics edited after the hop list indicate the loss of packets on each independent router.
D: /> PATHPING-N MSW
Tracing route to msw [7.54.1.196] Over a Maximum of 30 HOPS: 0 172.16.87.35 1 172.16.87.218 2 192.68.52.1 3 192.68.80.1 4 7.54.247.14 5 7.54.1.196
Computing statistics for 125 seconds ... Source to Here this node / link hop rtt lost / slow = PCT LOST / SENT = PCT Address 0 172.16.87.35 0/100 = 0% | 1 41MS 0/100 = 0% 0/100 = 0% 172.16.87.218 13/100 = 13% | 2 22ms 16/100 = 16% 3/100 = 3% 192.68.52.1 0/100 = 0% | 3 24MS 13/100 = 13% 0/100 = 0 % 192.68.80.1 0/100 = 0% | 4 21MS 14/100 = 14% 1/100 = 1% 10.54.247.14 0/100 = 0% | 5 24MS 13/100 = 13% 0/100 = 0% 10.54 .1.196
TRACE COMPLETE.
When you run Pathping, first check the results of the route when testing the problem. This path is the same as the path displayed by the tracert command. Then PATHPING command is displayed on the next 125 millisecond (this time varies depending on the hop count). During this time, PATHPING collects information between all the previous routers and their links. At the end of this period, it displays the test results.
The rightmost two-column this node / link lost / service = PCT and Address include the most useful information. 172.16.87.218 (Jump 1) and 192.68.52.1 (Jum 2) Lost 13% of the packet. All other links are working properly. The router in hops 2 and 4 is also lost to their packets (as shown in the this node / link bar), but the loss does not affect the forwarded path.