Network Administrator read-common network commands

Source: Internet
Author: User

Network Administrator read-common network commands
If you have played a vro, you will know the abbreviations of the interesting commands in the vro. For example, "sh int" means "show interface ". Now Windows 2000 has a tool similar to the interface called netsh.
In the cmd shell of Windows 2000, enter netsh and then: netsh> prompt. enter int ip to display: interface ip> and 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 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 describes a method of interactive operations.
Run the following command:
"Netsh interface ip add address" Local Area Connection "10.0.0.2
255.0.0.0"
To add IP addresses. It doesn't matter if you don't know the syntax! At the prompt, enter? You can find the answer. Convenience and inconvenience? In the past, Microsoft also had some things that people liked. Unfortunately, there are very few!
Windows command line program
This part includes:
Use ipconfig/all to view configurations
Use ipconfig/renew to refresh the configuration
Use ipconfig to manage DNS and DHCP category IDS
Use Ping to test the connection
Use Arp to solve hardware address problems
Use nbtstat to solve NetBIOS name problems
Use netstat to display connection statistics
Use tracert to track Network Connections
Use pathping to test the vro
Use ipconfig/all to view configurations
When detecting and solving 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 the 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 you use the ipconfig command with the/all option, a detailed configuration report of all interfaces is provided, including any configured serial ports. You can use ipconfig/all to redirect command output to a file and paste the output to other documents. You can also use the output to confirm the TCP/IP configuration of each computer on the network, or further investigate TCP/IP network problems.
For example, if the IP address configured on the computer is the same as the existing IP address, the subnet mask is 0.0.0.0.
The following example shows the ipconfig/all command output. The computer is configured to use the DHCP server to dynamically Configure TCP/IP and use WINS and DNS server to resolve the name.
Windows 2000 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 Address ......: 192.168.0.112
Subnet Mask ......: 255.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,199 8 10:32:13 AM
Lease Expires ......: Friday, September 18,199 8 10:32:13 AM
If the TCP/IP configuration is correct, perform the next step to connect to other hosts on the TCP/IP network.
Use ipconfig/renew to refresh the configuration
To solve a TCP/IP network problem, first check the TCP/IP configuration on the computer where the problem occurs. If the computer enables DHCP and uses the DHCP server for configuration, use the ipconfig/renew command to refresh the lease.
When ipconfig/renew is used, all NICs (except those manually configured adapters) on the computer using DHCP are connected to the DHCP server whenever possible to update existing configurations or obtain new configurations.
You can also use the ipconfig command with the/release option to immediately release the current DHCP configuration of the host. For more information about DHCP and lease, see how clients get configurations.
Note:
For Windows 95 and Windows 98 that enable DHCP, use the release and renew options of the winipcfg command instead of the ipconfig/release and ipconfig/renew commands, manually release or update the customer's IP Address Configuration lease.
You can also use the ipconfig command to manage DNS and DHCP class IDS by using ipconfig:
Displays or resets the DNS cache. For more information, see use ipconfig to view or reset the client resolution program cache.
Refresh the registered DNS name. For more information, see use ipconfig to update DNS customer registration.
Displays the DHCP category ID of the adapter. For more information, see show DHCP category ID information on the client.
Set the DHCP category ID of the adapter. For more information, see set DHCP category ID on the client.
Use Ping to test the connection
The Ping Command helps verify IP connectivity. When detecting and resolving the problem, you can use Ping to send an ICMP response request to the target host name or IP address. When you need to verify whether the host can connect to the TCP/IP network and network resources, use Ping. You can also use Ping to isolate network hardware problems and incompatible configurations.
Generally, it is best to use the Ping command to verify whether the route between the local computer and the network host exists and the IP address of the network host to be connected. Ping the IP address of the target host to check whether the host responds as follows:
Ping IP_address
Perform the following steps when using Ping:
Ping the 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 to verify that the IP address is correctly added to the network.
Ping IP_address_of_local_host
Ping the IP address of the default gateway to verify whether the gateway is running and whether it can communicate with the local host on the local network.
Ping IP_address_of_default_gateway
Ping the IP address of the remote host to verify whether the router can communicate.
Ping IP_address_of_remote_host
The Ping command uses Windows Socket style name resolution to resolve the computer name to an IP address. Therefore, if the address is successfully used but the Ping command fails, the problem lies in address or name resolution, instead of network connectivity issues. For more information, see use Arp to solve hardware address problems.
If you cannot successfully use Ping at any point, make sure that:
After installing and configuring TCP/IP, restart the computer.
The IP address of the local computer on the "General" tab of the "Internet Protocol (TCP/IP) properties" dialog box is valid and correct.
Use IP routing, and the links between routers are available.
You can use different options of the Ping command to specify the size of the data packet to be used, the number of data packets to be sent, whether to record the used route, and the TTL) value and whether to set the "Do Not segment" flag. You can type ping -? View these options.
The following example shows how to send two Ping requests 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 <10 ms TTL = 32
Reply from 172.16.48.10: bytes = 1450 time <10 ms TTL = 32
Ping statistics for 157.59.8.1:
Packets: Sent = 2, stored ED = 2, Lost = 0 (0% loss ),
Approximate roundtrip times in milli-seconds:
Minimum = 0 ms, Maximum = 10 ms, Average = 2 ms
By default, before "request time-out" is displayed, Ping waits for 1,000 milliseconds (1 second) for each response to return. If the remote system tested by Ping goes through a long-delayed link, such as a satellite link, the response may take a longer time to return. You can use the-w (wait) option to specify a longer timeout period.
Use Arp to solve hardware address problems
The 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 effective, each computer caches IP addresses to the Media Access Control Address ing to eliminate repeated ARP broadcast requests.
You can use arp commands to view and modify ARP table items on the local computer. Arp commands are useful for viewing ARP caches and solving address resolution problems.
For more information, see view the Address Resolution Protocol (ARP) cache and add static ARP cache items.
Use nbtstat to solve NetBIOS name problems
The NetBIOS (NetBT) on TCP/IP resolves 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 for resolving NetBIOS name resolution issues. You can use the nbtstat command to delete or correct a pre-loaded project:
Nbtstat-n displays the names registered locally on the system by programs such as the server or redirection.
Nbtstat-c displays the NetBIOS name cache, including the name-to-address ing of other computers.
Nbtstat-R clears the name cache and then reloads it from The Lmhosts file.
Nbtstat-RR releases the NetBIOS names registered on the WINS server, and refresh their registration.
Nbtstat-a name executes the NetBIOS adapter STATUS Command on the computer specified by name. The adapter STATUS Command will
Return the local NetBIOS name table of the computer and 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> 6 MB 5 MB
CORP1 <00> Connected Out CORPPRINT <20> kilobytes KB
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 the Protocol statistics and the current TCP/IP connection. The netstat-a command displays all connections, while the netstat-r command displays the route table and active connections. The netstat-e command displays Ethernet statistics, while netstat-s displays statistics for each protocol. If netstat-n is used, the address and port number cannot be converted to the name. The following is an output 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-
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
Inclued Header Errors = 738854
Received Address Errors = 23150
Required rams Forwarded = 0
Unknown Protocols committed ED = 0
Inclued 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 =
Required rams Successfully Fragmented = 0
Required rams 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
Required rams Received = 4157136
No Ports = 351928
Receive Errors = 2
Required rams Sent = 13809
Use tracert to track Network Connections
Tracert is a routing tracking utility used to determine the path adopted by the IP datagram access target. The Tracert command uses the ip ttl field and the ICMP error message to determine the route from one host to other hosts on the network.
How Tracert works
By sending "Internet Control Message Protocol (ICMP)" response packets with different TTL values to the target, the Tracert diagnostic program determines the route adopted by the target. Each vro on the path must at least decrease the TTL of the data packet by 1 before forwarding the data packet. When the TTL value on the data packet is reduced to 0, the router should send the "ICMP timeout" message back to the source system.
Tracert sends a response packet whose TTL is 1, and increases TTL by 1 in each subsequent sending process until the target response or TTL reaches the maximum value to determine the route. Check the ICMP timeout message sent back by the Intermediate router to determine the route. Some routers directly discard TTL expired data packets without asking, which is not seen in the Tracert utility.
The Tracert command prints out the list of nearby router interfaces in the path that returns the "ICMP timeout" message in sequence. If the-d option is used, the Tracert utility does not query DNS on each IP address.
In the following example, data packets must pass through two routers (10.0.0.1 and 192.168.0.1) to reach host 172.16.0.99. The default gateway of the host is 10.0.0.1, And the IP address of the router on the 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 30 hops
1 2 s 3 s 2 s 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 position of a data packet on the network. In the following example, the default gateway determines that there is no valid path for the host 192.168.10.99. This may be due to a vro configuration problem, 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 30 hops
1 10.0.0.1 reportsestination net unreachable.
Trace complete.
The Tracert utility is very useful for solving large network problems. In this case, several paths can be taken to reach the same 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: do not resolve the IP address 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 the list of router interfaces in the path used by the Tracert utility package.
-W timeout: the number of milliseconds specified for each reply.
The target host name or IP address of target_name.

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.