Windows Network Commands

Source: Internet
Author: User

If you've ever played a router, you know what's funny about the commands in the router.

For example, "sh int" means "show interface". Now Windows 2000 also has a similar interface to the tool called Netsh.

We entered Netsh on the Windows 2000 cmd Shell and came out:netsh> prompt, input int IP is displayed: interface ip> then enter dump,

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 Conn Ection "Source = static Addr = 192.168.1.168 Mask = 255.255.255.0 add address name =" Local area Connection "addr = 19 2.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 = STA Tic addr = None popd # End of interface IP configuration

One way to do this is by interacting.

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 do not know the grammar, it does not matter Oh! At the prompt, enter? You'll find the answer. Convenient, not convenient ah?

The original Microsoft stuff inside, there are some things that people like. Unfortunately, very few of them!

Windows network command-line program

This section includes: Using Ipconfig/all to view the configuration

Refresh the configuration with Ipconfig/renew

Managing DNS and DHCP class IDs using ipconfig

To test a connection using Ping

Resolving hardware address problems with ARP

Resolving NetBIOS name issues with Nbtstat

Using Netstat to display connection statistics

Using tracert to track network connections

Test your router with pathping

viewing configurations with Ipconfig/all

When you discover and troubleshoot TCP/IP network problems, first check the TCP/IP configuration on the computer where the problem occurs.   You can use the ipconfig command to obtain host configuration information, including the IP address, subnet mask, and default gateway.   Note For Windows 95 and Windows 98 clients, use the winipcfg command instead of the ipconfig command. When using the ipconfig command with the/ALL option, detailed configuration reports for all interfaces are given, including any configured serial ports. With 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 TCP/IP configuration for each computer on your network, or to investigate TCP/IP network issues further.   For example, if the computer is configured with an IP address that duplicates an 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 a DHCP server and resolves names using WINS and DNS servers. Windows $ IP Configuration Node Type ... : Hybrid IP Routing Enabled ..... : No WINS Proxy Enabled ..... : No Ethernet Adapter Local area Connection:host Name ....   : corp1.microsoft.com 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 Ad Dress ..... . : 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, 1998 10:32:13 AM Lease Expires ....   : Friday, September, 1998 10:32:13 AM If there is no problem with TCP/IP configuration, the next test can connect to other hosts on the TCP/IP network. When you use the Ipconfig/renew refresh configuration to troubleshoot TCP/IP network problems, first check the TCP/IP configuration on the computer that is experiencing the problem. If the computer enables DHCP and uses a DHCP server to obtain the configuration, use the Ipconfig/renew command to start refreshing the lease. When using ipconfig/renew, all network cards on a computer using DHCP (except those that are configured manually) try to connect to the DHCP server, update existing configurations, or obtain new configurations. You can also use the ipconfig command with the/release option to immediately release the host's current DHCP configuration.   For more information about the DHCP and lease process, see how clients get the configuration. Note For DHCP-enabled Windows 95 and Windows 98 customers, use the release and renew options of the winipcfg command instead of the ipconfig/release and Ipconfig/renew commands   , manually release or update the client's IP configuration lease. Using Ipconfig to manage DNS and DHCP class IDs can also be used with the ipconfig command: To display or reset the DNS cache.   For more information, see Use ipconfig to view or reset the client resolver cache. Refreshes the registered DNS name.   For more information, see Update DNS client registrations with Ipconfig. Displays the DHCP class ID of the adapter.   For more information, see Displaying DHCP class ID information on a client computer. Sets the DHCP class ID of the adapter. For more information, see Setting upThe DHCP class ID information on the client computer. Using ping to test the connection ping command helps verify IP-level connectivity. When a problem is discovered and resolved, you can use Ping to send an ICMP response request to the target host name or IP address. Use Ping when you need to verify that the host can connect to TCP/IP networks and network resources.   You can also use Ping to isolate network hardware problems and incompatible configurations. It is usually better to use the Ping command to verify the presence of a route between the local computer and the network host and the IP address of the network host to which you want to connect.   Ping the destination host's IP address to see if it responds, as follows: Ping IP_Address The following steps should be performed when using ping: Ping loopback addresses Verify that TCP/IP is installed on the local computer and that the configuration is correct.   Ping 127.0.0.1 Ping The local computer's IP address to verify that it is correctly added to the network.   Ping Ip_address_of_local_host Ping The IP address of the default gateway to verify that the default gateway is running and that it can communicate with local hosts on the local network.   Ping Ip_address_of_default_gateway Ping The IP address of the remote host to verify that it can communicate through the router. The ping ip_address_of_remote_host ping command resolves the computer name to an IP address with the name resolution of the Windows sockets typeface, so if the address succeeds, but Ping with name fails, the problem is with address or name resolution, not network connectivity The problem.   For more information, see Resolving Hardware address problems with ARP.   If you cannot successfully use Ping at any point, confirm that you restart the computer after you install and configure TCP/IP.   The IP address of the local computer on the General tab of the Internet Protocol (TCP/IP) Properties dialog box is valid and correct.   With IP routing, and the link between routers is available. You can use the different options of the Ping command to specify the size of the packet to use, how many packets to send, whether to log used routes, the time-to-live (TTL) value to use, and whether to set the Do not fragment flag. You can type ping-?   View these options. The following example shows how to send two pings to an IP address 172.16.48.10, each 1,450 bytes: c:\>ping-n 2-l1450 172.16.48.10 Pinging 172.16.48.10 with 1450 bytes of data:reply from 172.16.48.10:bytes=1450 time Connected out CORPSUP1 6MB 5MB CORP1 Connected out corpprint 108KB 116KB CORP1 Connected out CORPSRC1 299KB 19KB CORP1 Connected O UT CORPEMAIL1 324KB 19KB CORP1 Listening using netstat display connection statistics you can use the Netstat command to display protocol statistics and the current TCP/IP connection. The netstat-a command displays all connections, and NETSTAT-R displays the routing table and the active connection. The NETSTAT-E command displays Ethernet statistics, and netstat-s displays statistics for each protocol. If you use Netstat-n, you cannot convert the address and port number to a name. Here is an example of netstat output: c:\>netstat-e Interface Statistics Received Sent Bytes 3995837940 47224622 Unicast Packet s 120099 131015 non-unicast packets 7579544 3823 discards 0 0 Errors 0 0 Unknown Protocols 363054211 c:\>nets Tat-a Active Connections Proto Local address Foreign address State TCP corp1:1572 172.16.48.10:nbsession Establishe D TCP corp1:1589 172.16.48.10:nbsession established TCP corp1:1606 172.16.105.245:nbsession ESTABLISHED TCP CORP1:16 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 CORP 1: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:\&G T;netstat-s IP Statistics Packets Received = 5378528 Received Header Errors = 738854 Received Address Errors = 23 Datagrams Forwarded = 0 Unknown Protocols Received = 0 Received Packets discarded = 0 Received Packets deliver ed = 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 Open s = 597 Passive Opens = 135 Failed Connection attempts = 107 Reset Connections = Current Connections = 8 Segm Ents Received = 106770 segments Sent = 118431 Segments retransmitted = 461 UDP Statistics Datagrams Received = 415 7136 No Ports = 351928 Receive Errors = 2 Datagrams Sent = 13809 Use tracert to track network connection tracert (trace route) is a route trace utility for determining IP The path that the datagram takes to access the target.   The Tracert command uses the IP time-to-Live (TTL) field and the ICMP error message to determine the route from one host to another host on the network. How Tracert works by sending an Internet Control Message Protocol (ICMP) response packet that sends different IP time-to-live (TTL) values to the target, the Tracert diagnostics determines the route to the destination. Each router on the path is required to decrement at least 1 of the TTL on the packet before forwarding the packet.   The TTL on the packet is reduced to 0 o'clock, and the router should send the "ICMP timed out" message back to the source system. The Tracert sends a response packet with a TTL of 1 and increments the TTL by 1 for each subsequent send process until the target response or TTL reaches the maximum value to determine the route. The route is determined by checking the "ICMP timed out" message sent back by the intermediate router. Some routers directly discard TTL-expired packets without asking, which is tracerT is not visible in the utility program. The Tracert command prints the list of near-end router interfaces in the path that returns the "ICMP timed out" message in order.   If you use the-D option, the Tracert utility does not query DNS on each IP address. In the following example, a packet must pass through two routers (10.0.0.1 and 192.168.0.1) to reach the host 172.16.0.99.   The default gateway for the host is the IP address of the router on the 10.0.0.1,192.168.0.0 network is 192.168.0.1. C:\>tracert 172.16.0.99-d tracing route to 172.16.0.99 over a maximum of hops 1 2s 3s 2s 10,0.0,1 2 ms 83   Ms 192.168.0.1 MS 3 ms 172.16.0.99 Trace complete. Solve problems with Tracert you can use the TRACERT command to determine where a packet stops on the network. In the following example, the default gateway determines that the 192.168.10.99 host does not have a valid path.   This may be a problem with the router configuration, or the 192.168.10.0 network does not exist (the wrong IP address). C:\>tracert 192.168.10.99 tracing route to 192.168.10.99 over a maximum of hops 1 10.0.0.1 reportsestination net   Unreachable.   Trace complete.   The Tracert utility is useful for solving large network problems, where several paths can be taken to reach the same point.   The Tracert command line Options Tracert Command supports a variety of 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 metric to track the route to the host called Target_name.  -j host-list Specifies the list of router interfaces in the path used by the Tracert utility packet. -w timeout waits for a timeout to specify the number of milliseconds for each reply.   Target_name the name or IP address of the target host. For more information, see Trace paths using the tracert command. Using the Pathping Test Router pathping command is a route tracking tool that combines the functionality of the ping and Tracert commands with other information not provided by the two tools. The Pathping command sends packets over time to each router on the path to the final destination, and then returns from each hop based on the computer results of the packet. Because the command shows the extent to which a packet is lost on any given router or link, it is easy to identify the router or link that may be causing the network problem.   Some options are available, as shown in the following table. The default metric is 30, and the default wait time before timing out is 3 seconds.   The default time is 250 milliseconds, and the number of queries per router along the path is 100. The following is a typical pathping report.   The statistics that are edited after the hop list indicate the packet loss situation on each individual router.   D:\>pathping-n MSW Tracing route to MSW [7.54.1.196] over a maximum of a 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 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 you run Pathping, you first look at the results of the route when you test the problem. This path is the same as the path shown by the tracert command. The pathping command then displays a busy message for the next 125 milliseconds (this time varies based on the hop count). During this time, Pathping collects information from all previously listed routers and links between them.   At the end of this period, it displays the test results. The rightmost two columns this node/link lost/sent=pct and Address contain the information 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 the This Node/link column), but the loss does not affect the forwarded path. The loss rate for link display (marked as | In the rightmost column) indicates that the missing packet is forwarded along the path. This loss indicates that the link is blocked. The loss rate shown to the router (shown by the IP address in the rightmost column) indicates that the CPUs of these routers may be overloaded. These blocked routers may also be a factor in the end-to-end problem, especially when the software router forwards the packets.

Windows Network Commands

Related Article

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.