If you have played with a router, you will know the fun command abbreviations in the router.
For example, "sh int" means "show interface".
Now Windows 2000 also has a tool with a similar interface called netsh.
We enter netsh under the cmd shell of Windows 2000
Come out: netsh> prompt,
Enter int ip and display:
interface ip>
Then enter dump and we can see the network configuration of the current system:
# ----------------------------------
# Interface IP Configuration
# ----------------------------------
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 is a way to operate through interactive methods.
We can directly enter the command:
"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, it doesn't matter!
At the prompt, enter ? and you can find the answer. Convenient or not?
It turns out that there are some things that make people like in Microsoft's things. Unfortunately, very few of them are the most powerful!
Windows Network Command Line Program
This part includes:
Use ipconfig/all to view the configuration
Refresh the configuration using ipconfig/renew
Use ipconfig to manage DNS and DHCP category ID
Use Ping to test the connection
Use Arp to solve hardware address problems
Use nbtstat to solve the NetBIOS name problem
Use netstat to display connection statistics
Use tracert to track network connections
Test the router using pathping
Use ipconfig/all to view the configuration
When discovering and solving TCP/IP network problems, first check the TCP/IP configuration on the computer where the problem occurs. Can
Use the ipconfig command to obtain host configuration information, including IP address, subnet mask and default gateway.
Notice
For Windows 95 and Windows 98 clients, please use the winipcfg command instead of ipconfi
g Command.
When using the ipconfig command with /all option, a detailed configuration report for all interfaces will be given, including any
Configured serial port. Using ipconfig /all, you can redirect the command output to a file and
Paste the output into another document. You can also use this output to confirm the TCP/IP configuration of each computer on the network, or
The author further investigates the TCP/IP network problem.
For example, if the computer configured IP address is repeated with the existing IP address, the subnet mask will be displayed as 0.0.0
.0。
The following example is the ipconfig/all command output, which is configured to use DHCP server dynamic configuration
TCP/IP and use WINS and DNS servers to resolve names.
Windows 2000 IP Configuration
Node Type.. . . . . . . . : Hybrid
IP Routing Enabled.. . . . : No
WINS Proxy Enabled.. . . . : No
Ethernet adapter Local Area Connection:
Host Name.. . . . . . . . :
DNS Servers . . . . . . . : 10.1.0.200
Description. . . . . . . : 3Com 3C90x Ethernet Adapter
Physical Address. . . . . : 00-60-08-3E-46-07
DHCP Enabled.. . . . . . . : Yes
Autoconfiguration Enabled.: Yes
IP Address. . . . . . . . . : 192.168.0.112
Subnet Mask. . . . . . . . : 255.255.0.0
Default Gateway. . . . . . : 192.168.0.1
DHCP Server. . . . . . . . : 10.1.0.50
Primary WINS Server. . . . : 10.1.0.101
Secondary WINS Server. . . : 10.1.0.102
Lease Obtained.. . . . . . : Wednesday, September 02, 1998 10:32:13 AM
Lease Expires.. . . . . . : Friday, September 18, 1998 10:32:13 AM
If there is no problem with TCP/IP configuration, the next step is to be able to connect to other hosts on the TCP/IP network.
Refresh the configuration using ipconfig/renew
When solving TCP/IP network problems, first check the TCP/IP configuration on the computer that is encountered. If the computer
Enable DHCP and use the DHCP server to get configuration. Please use the ipconfig/renew command to start refreshing the rental
about.
When using ipconfig/renew, all network cards on computers using DHCP (except those manually configured
All adapters) try to connect to the DHCP server, update existing configurations or obtain new configurations.
You can also use the ipconfig command with /release option to immediately release the host's current DHCP configuration. have
For more information about DHCP and rental procedures, see How the client gets configuration.
Notice
For Windows 95 and Windows 98 customers with DHCP enabled, please use the rel of the winipcfg command
ease and renew options, instead of ipconfig /release and ipconfig /renew commands, manually
Release or update the customer’s IP configuration lease.
Use ipconfig to manage DNS and DHCP category ID
You can also use the ipconfig command:
Show or reset the DNS cache.
For more information, see View or resetting the customer resolver cache using ipconfig.
Refresh the registered DNS name.
For more information, see Update DNS Customer Registration with ipconfig.
Displays the DHCP category ID of the adapter.
For more information, see Display DHCP Category ID information on the client.
Set the DHCP category ID of the adapter.
For more information, see Setting DHCP Category ID Information on the client.
Use Ping to test the connection
Ping commands help verify IP-level connectivity. When discovering and solving problems, you can use Ping to target owners
Send ICMP to respond to the request by machine name or IP address. It is necessary to verify that the host can connect to TCP/IP networks and networks
When it comes to resources, please use Ping. You can also use Ping to isolate network hardware problems and incompatible configurations.
It is usually best to use the Ping command to verify whether the route between the local computer and the network host exists and to connect to it.
The IP address of the connected network host. Ping The IP address of the target host depends on whether it responds, as follows:
ping IP_address
When using Ping, the following steps should be performed:
Ping Loopback address to verify whether TCP/IP is installed on the local computer and whether the configuration is correct.
ping 127.0.0.1
Ping The IP address of the local computer is verified to be added to the network correctly.
ping IP_address_of_local_host
Ping The IP address of the default gateway Verify whether the default gateway is running and can be connected to the local host on the local network
News.
ping IP_address_of_default_gateway
Ping The IP address of the remote host verifies whether it can communicate through the router.
ping IP_address_of_remote_host
Ping command uses the name resolution of Windows socket style to resolve the computer name to an IP address, so if
The problem lies in the address or name resolution, not the network connection
The issue of commonality. For more information, see Using Arp to solve hardware address problems.
If Ping cannot be used successfully at any point, please confirm:
After installing and configuring TCP/IP, restart the computer.
IP address of the local computer on the General tab of the "Internet Protocol (TCP/IP) Properties" dialog box
Effective and correct.
Enable IP routing and links between routers are available.
You can use the different options of the Ping command to specify the size of the packet to be used, how many packets to be sent,
Whether to record used routes, the survival time (TTL) value to be used, and whether to set the "No segmentation" flag. Can
Check these options by typing ping -?.
The following example shows how to send two Pings to IP address 172.16.48.10, each of which 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, Ping waits 1,000 milliseconds (1 second) for each response to return before "Request Timeout" is displayed. If a remote system detected by Ping passes a long delayed link, such as a satellite link, the response may take longer to return. The longer timeout can be specified using the -w (wait) option.
Use Arp to solve hardware address problems
"Address Resolution Protocol (ARP)" allows the host to find the media access control address of the host on the same physical network, if the latter IP address is given. To make ARP more efficient, each computer caches IP to media access control address mapping eliminates duplicate ARP broadcast requests.
You can use the arp command to view and modify the ARP table entries on the local computer. The arp command is very useful for viewing ARP cache and solving address resolution problems.
For more information, see Viewing "Address Resolution Protocol (ARP)" cache and adding static ARP cache items.
Use nbtstat to solve the NetBIOS name problem
NetBIOS (NetBT) on TCP/IP parses the NetBIOS name into an IP address. TCP/IP provides many options for NetBIOS name resolution, 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 problem of NetBIOS name resolution. You can use the nbtstat command to delete or correct preloaded items:
nbtstat -n Displays the name registered locally on the system by programs such as server or redirector.
nbtstat -c Displays NetBIOS name cache, containing the name-to-address mapping of other computers.
nbtstat -R Clear the name cache and reload from the Lmhosts file.
nbtstat -RR Release the NetBIOS names registered on the WINS server and refresh their registration.
nbtstat -a name Execute the NetBIOS adapter status command on the computer specified by name. The adapter status command will return to the computer's local NetBIOS name table and the adapter's media access control address.
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<20> 324KB 19KB
CORP1 <03> Listening
Use netstat to display connection statistics
You can use the netstat command to display protocol statistics and the current TCP/IP connection. The netstat -a command will display all connections, while the netstat -r displays the routing table and active connections. The netstat -e command will display Ethernet statistics, while the netstat -s displays statistics for each protocol. If you use netstat -n, you cannot convert the address and port number to a name. Below is an example of the output 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 = 0
ICMP 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 Masks 0 0
Address Mask Replies 0 0
TCP Statistics
Active Opens = 597
Passive Opens = 135
Failed Connection Attempts = 107
Reset Connections = 91
Current Connections = 8
Segments Received = 106770
Segments Sent = 118431
Segments Retransmitted = 461
UDP Statistics
Datagrams Received = 4157136
No Ports = 351928
Receive Errors = 2
Datagrams Sent = 13809
Use tracert to track network connections
Tracert is a routing tracing utility that determines the path taken by IP datagram access targets. The Tracert command uses the IP Time of Survival (TTL) field and the ICMP error message to determine the route from one host to other hosts on the network.
Tracert Working Principle
By sending a "Internet Control Message Protocol (ICMP)" response packets with different IP Time of Survival (TTL) values to the target, the Tracert diagnostics determine the route taken to the target. Each router on the path is required to decrement at least one TTL on the packet before forwarding it. When the TTL on the packet is reduced to 0, the router should send the message "ICMP timed out" back to the source system.
Tracert first sends a response packet with TTL of 1, and increments TTL by 1 in each subsequent sending process until the target response or TTL reaches its maximum value, thereby determining the route. Determine the route by checking the message "ICMP timed out" sent back by the intermediate router. Some routers directly discard TTL expired packets without asking, which is not visible in the Tracert utility.
The Tracert command prints out the nearest router interface list in the path that returns the "ICMP Timed out" message in order. If the -d option is used, the Tracert utility does not query DNS on each IP address.
In the following example, the packet must go through two routers (10.0.0.1 and 192.168.0.1) to reach the host.
172.16.0.99. The default gateway of the host is 10.0.0.1, 192.168.0.0 IP address of the router on the network
The address 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.
Use tracert to solve the problem
You can use the tracert command to determine the stop location of the packet on the network. In the following example, the default gateway is determined 19
2.168.10.99 The host has no valid path. This may be a problem with router configuration, or 192.168.10.
0 The 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 reportsestination net unreachable.
Trace complete.
The Tracert utility is very useful for solving large network problems. At this time, several paths can be taken to reach the same one.
point.
Tracert Command Line Options
The 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 Specify the number of hops to track the route to the host called target_name .
-j host-list Specify the router interface list in the path used by the Tracert utility packet.
-w timeout Wait timeout The number of milliseconds specified for each reply.
target_name The name or IP address of the target host.
For more information, see Tracking paths using the tracert command.
Test the router using pathping
The pathping command is a routing tracking tool that combines the functions of the ping and tracert commands with other information that these two tools do not provide. The pathping command sends the packet to each router on the path to the final destination over a period of time, and then returns from each hop based on the computer results of the packet. Since the command shows the extent to which packets are lost on any given router or link, it is easy to determine the router or link that may cause network problems. Some options are available, as shown in the following table.
Options Name Function
-n Hostnames Do not resolve the address to the hostname.
-h Maximum hops The maximum number of hops to search for the target.
-g Host-list Release source routes along the route list.
-p Period The number of milliseconds to wait between pings.
-q Num_queries Num_queries Num number of queries per hop.
-w Time-out The number of milliseconds waiting for each reply.
-T Layer 2 tag Connect the layer 2 priority tag (for example, for IEEE 802.1p) to the packet and send it to each network device in the path. This helps identify network devices that do not have the Layer 2 priority configuration correctly. -T switch is used to test quality of service (QoS) connectivity.
-R RSVP isbase Che checks to determine whether each router in the path supports "Resource Retention Protocol (RSVP)", which allows the host to reserve a certain amount of bandwidth for the data stream. -R switch is used to test quality of service (QoS) connectivity.
The default hop count is 30, and the default waiting time before timeout is 3 seconds. The default time is 250 milliseconds, and the number of queries for each router along the path is 100.
The following is a typical pathping report. The statistics edited after the hop list indicate the packet loss 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/Sent = 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 running pathping, first check the route results when testing the problem. This path is the same as the path displayed by the tracert command. The pathping command then displays a busy message for the next 125 milliseconds (this time varies according to the hop count). During this time, pathping collects information from all previously listed routers and the links between them. At the end of this period, it displays the test results.
The information contained in the two columns on the far right is the most useful. 172.16.87.218 (hop 1) and 192.68.52.1 (hop 2) lost 13% of the packets. All other links work fine. Routers in hops 2 and 4 also lose packets addressed to them (as shown in This Node/Link column), but this loss does not affect the forwarded path.
The loss rate displayed for the link (marked as | in the rightmost column) indicates that the lost packet is forwarded along the path. This loss indicates a blocking link. The loss rate displayed on the routers (displayed by the IP address in the far right column) indicates that the CPU of these routers may be overloaded. These blocking routers may also be a factor in end-to-end problems, especially when software routers forward packets.
For example, "sh int" means "show interface".
Now Windows 2000 also has a tool with a similar interface called netsh.
We enter netsh under the cmd shell of Windows 2000
Come out: netsh> prompt,
Enter int ip and display:
interface ip>
Then enter dump and we can see the network configuration of the current system:
# ----------------------------------
# Interface IP Configuration
# ----------------------------------
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 is a way to operate through interactive methods.
We can directly enter the command:
"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, it doesn't matter!
At the prompt, enter ? and you can find the answer. Convenient or not?
It turns out that there are some things that make people like in Microsoft's things. Unfortunately, very few of them are the most powerful!
Windows Network Command Line Program
This part includes:
Use ipconfig/all to view the configuration
Refresh the configuration using ipconfig/renew
Use ipconfig to manage DNS and DHCP category ID
Use Ping to test the connection
Use Arp to solve hardware address problems
Use nbtstat to solve the NetBIOS name problem
Use netstat to display connection statistics
Use tracert to track network connections
Test the router using pathping
Use ipconfig/all to view the configuration
When discovering and solving TCP/IP network problems, first check the TCP/IP configuration on the computer where the problem occurs. Can
Use the ipconfig command to obtain host configuration information, including IP address, subnet mask and default gateway.
Notice
For Windows 95 and Windows 98 clients, please use the winipcfg command instead of ipconfi
g Command.
When using the ipconfig command with /all option, a detailed configuration report for all interfaces will be given, including any
Configured serial port. Using ipconfig /all, you can redirect the command output to a file and
Paste the output into another document. You can also use this output to confirm the TCP/IP configuration of each computer on the network, or
The author further investigates the TCP/IP network problem.
For example, if the computer configured IP address is repeated with the existing IP address, the subnet mask will be displayed as 0.0.0
.0。
The following example is the ipconfig/all command output, which is configured to use DHCP server dynamic configuration
TCP/IP and use WINS and DNS servers to resolve names.
Windows 2000 IP Configuration
Node Type.. . . . . . . . : Hybrid
IP Routing Enabled.. . . . : No
WINS Proxy Enabled.. . . . : No
Ethernet adapter Local Area Connection:
Host Name.. . . . . . . . :
DNS Servers . . . . . . . : 10.1.0.200
Description. . . . . . . : 3Com 3C90x Ethernet Adapter
Physical Address. . . . . : 00-60-08-3E-46-07
DHCP Enabled.. . . . . . . : Yes
Autoconfiguration Enabled.: Yes
IP Address. . . . . . . . . : 192.168.0.112
Subnet Mask. . . . . . . . : 255.255.0.0
Default Gateway. . . . . . : 192.168.0.1
DHCP Server. . . . . . . . : 10.1.0.50
Primary WINS Server. . . . : 10.1.0.101
Secondary WINS Server. . . : 10.1.0.102
Lease Obtained.. . . . . . : Wednesday, September 02, 1998 10:32:13 AM
Lease Expires.. . . . . . : Friday, September 18, 1998 10:32:13 AM
If there is no problem with TCP/IP configuration, the next step is to be able to connect to other hosts on the TCP/IP network.
Refresh the configuration using ipconfig/renew
When solving TCP/IP network problems, first check the TCP/IP configuration on the computer that is encountered. If the computer
Enable DHCP and use the DHCP server to get configuration. Please use the ipconfig/renew command to start refreshing the rental
about.
When using ipconfig/renew, all network cards on computers using DHCP (except those manually configured
All adapters) try to connect to the DHCP server, update existing configurations or obtain new configurations.
You can also use the ipconfig command with /release option to immediately release the host's current DHCP configuration. have
For more information about DHCP and rental procedures, see How the client gets configuration.
Notice
For Windows 95 and Windows 98 customers with DHCP enabled, please use the rel of the winipcfg command
ease and renew options, instead of ipconfig /release and ipconfig /renew commands, manually
Release or update the customer’s IP configuration lease.
Use ipconfig to manage DNS and DHCP category ID
You can also use the ipconfig command:
Show or reset the DNS cache.
For more information, see View or resetting the customer resolver cache using ipconfig.
Refresh the registered DNS name.
For more information, see Update DNS Customer Registration with ipconfig.
Displays the DHCP category ID of the adapter.
For more information, see Display DHCP Category ID information on the client.
Set the DHCP category ID of the adapter.
For more information, see Setting DHCP Category ID Information on the client.
Use Ping to test the connection
Ping commands help verify IP-level connectivity. When discovering and solving problems, you can use Ping to target owners
Send ICMP to respond to the request by machine name or IP address. It is necessary to verify that the host can connect to TCP/IP networks and networks
When it comes to resources, please use Ping. You can also use Ping to isolate network hardware problems and incompatible configurations.
It is usually best to use the Ping command to verify whether the route between the local computer and the network host exists and to connect to it.
The IP address of the connected network host. Ping The IP address of the target host depends on whether it responds, as follows:
ping IP_address
When using Ping, the following steps should be performed:
Ping Loopback address to verify whether TCP/IP is installed on the local computer and whether the configuration is correct.
ping 127.0.0.1
Ping The IP address of the local computer is verified to be added to the network correctly.
ping IP_address_of_local_host
Ping The IP address of the default gateway Verify whether the default gateway is running and can be connected to the local host on the local network
News.
ping IP_address_of_default_gateway
Ping The IP address of the remote host verifies whether it can communicate through the router.
ping IP_address_of_remote_host
Ping command uses the name resolution of Windows socket style to resolve the computer name to an IP address, so if
The problem lies in the address or name resolution, not the network connection
The issue of commonality. For more information, see Using Arp to solve hardware address problems.
If Ping cannot be used successfully at any point, please confirm:
After installing and configuring TCP/IP, restart the computer.
IP address of the local computer on the General tab of the "Internet Protocol (TCP/IP) Properties" dialog box
Effective and correct.
Enable IP routing and links between routers are available.
You can use the different options of the Ping command to specify the size of the packet to be used, how many packets to be sent,
Whether to record used routes, the survival time (TTL) value to be used, and whether to set the "No segmentation" flag. Can
Check these options by typing ping -?.
The following example shows how to send two Pings to IP address 172.16.48.10, each of which 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, Ping waits 1,000 milliseconds (1 second) for each response to return before "Request Timeout" is displayed. If a remote system detected by Ping passes a long delayed link, such as a satellite link, the response may take longer to return. The longer timeout can be specified using the -w (wait) option.
Use Arp to solve hardware address problems
"Address Resolution Protocol (ARP)" allows the host to find the media access control address of the host on the same physical network, if the latter IP address is given. To make ARP more efficient, each computer caches IP to media access control address mapping eliminates duplicate ARP broadcast requests.
You can use the arp command to view and modify the ARP table entries on the local computer. The arp command is very useful for viewing ARP cache and solving address resolution problems.
For more information, see Viewing "Address Resolution Protocol (ARP)" cache and adding static ARP cache items.
Use nbtstat to solve the NetBIOS name problem
NetBIOS (NetBT) on TCP/IP parses the NetBIOS name into an IP address. TCP/IP provides many options for NetBIOS name resolution, 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 problem of NetBIOS name resolution. You can use the nbtstat command to delete or correct preloaded items:
nbtstat -n Displays the name registered locally on the system by programs such as server or redirector.
nbtstat -c Displays NetBIOS name cache, containing the name-to-address mapping of other computers.
nbtstat -R Clear the name cache and reload from the Lmhosts file.
nbtstat -RR Release the NetBIOS names registered on the WINS server and refresh their registration.
nbtstat -a name Execute the NetBIOS adapter status command on the computer specified by name. The adapter status command will return to the computer's local NetBIOS name table and the adapter's media access control address.
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<20> 324KB 19KB
CORP1 <03> Listening
Use netstat to display connection statistics
You can use the netstat command to display protocol statistics and the current TCP/IP connection. The netstat -a command will display all connections, while the netstat -r displays the routing table and active connections. The netstat -e command will display Ethernet statistics, while the netstat -s displays statistics for each protocol. If you use netstat -n, you cannot convert the address and port number to a name. Below is an example of the output 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 = 0
ICMP 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 Masks 0 0
Address Mask Replies 0 0
TCP Statistics
Active Opens = 597
Passive Opens = 135
Failed Connection Attempts = 107
Reset Connections = 91
Current Connections = 8
Segments Received = 106770
Segments Sent = 118431
Segments Retransmitted = 461
UDP Statistics
Datagrams Received = 4157136
No Ports = 351928
Receive Errors = 2
Datagrams Sent = 13809
Use tracert to track network connections
Tracert is a routing tracing utility that determines the path taken by IP datagram access targets. The Tracert command uses the IP Time of Survival (TTL) field and the ICMP error message to determine the route from one host to other hosts on the network.
Tracert Working Principle
By sending a "Internet Control Message Protocol (ICMP)" response packets with different IP Time of Survival (TTL) values to the target, the Tracert diagnostics determine the route taken to the target. Each router on the path is required to decrement at least one TTL on the packet before forwarding it. When the TTL on the packet is reduced to 0, the router should send the message "ICMP timed out" back to the source system.
Tracert first sends a response packet with TTL of 1, and increments TTL by 1 in each subsequent sending process until the target response or TTL reaches its maximum value, thereby determining the route. Determine the route by checking the message "ICMP timed out" sent back by the intermediate router. Some routers directly discard TTL expired packets without asking, which is not visible in the Tracert utility.
The Tracert command prints out the nearest router interface list in the path that returns the "ICMP Timed out" message in order. If the -d option is used, the Tracert utility does not query DNS on each IP address.
In the following example, the packet must go through two routers (10.0.0.1 and 192.168.0.1) to reach the host.
172.16.0.99. The default gateway of the host is 10.0.0.1, 192.168.0.0 IP address of the router on the network
The address 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.
Use tracert to solve the problem
You can use the tracert command to determine the stop location of the packet on the network. In the following example, the default gateway is determined 19
2.168.10.99 The host has no valid path. This may be a problem with router configuration, or 192.168.10.
0 The 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 reportsestination net unreachable.
Trace complete.
The Tracert utility is very useful for solving large network problems. At this time, several paths can be taken to reach the same one.
point.
Tracert Command Line Options
The 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 Specify the number of hops to track the route to the host called target_name .
-j host-list Specify the router interface list in the path used by the Tracert utility packet.
-w timeout Wait timeout The number of milliseconds specified for each reply.
target_name The name or IP address of the target host.
For more information, see Tracking paths using the tracert command.
Test the router using pathping
The pathping command is a routing tracking tool that combines the functions of the ping and tracert commands with other information that these two tools do not provide. The pathping command sends the packet to each router on the path to the final destination over a period of time, and then returns from each hop based on the computer results of the packet. Since the command shows the extent to which packets are lost on any given router or link, it is easy to determine the router or link that may cause network problems. Some options are available, as shown in the following table.
Options Name Function
-n Hostnames Do not resolve the address to the hostname.
-h Maximum hops The maximum number of hops to search for the target.
-g Host-list Release source routes along the route list.
-p Period The number of milliseconds to wait between pings.
-q Num_queries Num_queries Num number of queries per hop.
-w Time-out The number of milliseconds waiting for each reply.
-T Layer 2 tag Connect the layer 2 priority tag (for example, for IEEE 802.1p) to the packet and send it to each network device in the path. This helps identify network devices that do not have the Layer 2 priority configuration correctly. -T switch is used to test quality of service (QoS) connectivity.
-R RSVP isbase Che checks to determine whether each router in the path supports "Resource Retention Protocol (RSVP)", which allows the host to reserve a certain amount of bandwidth for the data stream. -R switch is used to test quality of service (QoS) connectivity.
The default hop count is 30, and the default waiting time before timeout is 3 seconds. The default time is 250 milliseconds, and the number of queries for each router along the path is 100.
The following is a typical pathping report. The statistics edited after the hop list indicate the packet loss 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/Sent = 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 running pathping, first check the route results when testing the problem. This path is the same as the path displayed by the tracert command. The pathping command then displays a busy message for the next 125 milliseconds (this time varies according to the hop count). During this time, pathping collects information from all previously listed routers and the links between them. At the end of this period, it displays the test results.
The information contained in the two columns on the far right is the most useful. 172.16.87.218 (hop 1) and 192.68.52.1 (hop 2) lost 13% of the packets. All other links work fine. Routers in hops 2 and 4 also lose packets addressed to them (as shown in This Node/Link column), but this loss does not affect the forwarded path.
The loss rate displayed for the link (marked as | in the rightmost column) indicates that the lost packet is forwarded along the path. This loss indicates a blocking link. The loss rate displayed on the routers (displayed by the IP address in the far right column) indicates that the CPU of these routers may be overloaded. These blocking routers may also be a factor in end-to-end problems, especially when software routers forward packets.