Windows 2000 network operation commands

Source: Internet
Author: User
Practical Windows2000 network tutorial for System Engineers

1. Quick configuration of Windows 2000 interfaces:
Look at a tool called netsh.
In the cmd shell of Windows 2000, enter netsh
Come out: netsh> prompt,
Enter an int ip address:
Interface ip>
Enter dump to view 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 how to use the interactive mode.
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!

An example is as follows: do you often do engineering? Do I need to change the NIC configuration frequently? Use a graphical interface
Three mouse clicks are required. IP addresses, masks, gateways, and even DNS are often required due to lan policies?
It's easy to forget these things again and again, so you must get bored. Use netsh to implement various LAN
Change the configuration file once!
Steps:
1) generate the configuration template:
Use the command described above: netsh interface ip dump> NIC_LAN1.txt
The output is described above.
2) edit the txt file and modify the IP addresses you want to configure,
3) Use
Netsh exec FILE_PATH \ FILE_NAME.txt
Wait a moment, OK!
How is it? Dazzle!

2. 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. Yes
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 ipconfi.
G command.
When you use the ipconfig command with the/all option, detailed configuration reports for all interfaces are provided, including any
The configured serial port. You can use ipconfig/all to redirect command output to a file and
Paste the output to other documents. You can also use this output to confirm the TCP/IP configuration of each computer on the network, or
To further investigate TCP/IP network problems.

For example, if the IP address configured by the computer is the same as the existing IP address, the subnet mask is displayed as 0.0.0
. 0.

The following example shows the ipconfig/all command output. The computer is configured to use the DHCP server for dynamic configuration.
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
Enable DHCP and use the DHCP server for configuration. Use the ipconfig/Renew command to refresh the rent.
About.

When ipconfig/Renew is used, all NICs on the computer that uses DHCP (except those manually configured
Connect to the DHCP server whenever possible, 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. Yes
For more information about DHCP and lease, see how clients obtain configurations.

Note:

For Windows 95 and Windows 98 that enable DHCP, use the rel command of winipcfg
Configure and renew options, instead of the ipconfig/release and ipconfig/Renew commands, manually
Release or update the customer's IP Address Configuration lease.
Use ipconfig to manage DNS and DHCP category IDS
You can also use the ipconfig command:

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 solving the problem, you can ping the Target Master
The machine name or IP address sends an ICMP Response Request. You need to verify whether the host can connect to the TCP/IP network and network.
Use ping for 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 whether the route between the local computer and the network host exists and to connect
The IP address of the connected network host. 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.
Message.
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 a Windows Socket style name to resolve the computer name to an IP address.
The IP address is successfully used, but the Ping by name fails. The problem lies in the address or name resolution, rather than network connection.
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.
IP address of the local computer on the "General" tab of the "Internet Protocol (TCP/IP) properties" dialog box
Valid and correct.
Enable 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,
Indicates whether to record used routes, TTL values, and whether to set the "Do Not segment" flag. Yes
Enter 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 timeout" is displayed, Ping requests wait for 1,000 milliseconds (1 second) for each
Response. If the remote system tested by Ping goes through a long delay link, such as a satellite link,
The response may take a longer time to return. You can use the-w (wait) option to specify the duration of the overhead.
.

Use Arp to solve hardware address problems
The Address Resolution Protocol (ARP) allows hosts to find the Media Access Control addresses of hosts on the same physical network,
If the IP address of the latter is provided. To make ARP more effective, each computer caches IP addresses to media access control.
Address ing eliminates repeated ARP broadcast requests.

You can use arp commands to view and modify ARP table items on the local computer. Arp command for viewing ARP slowdown
It is useful for saving 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 is NetBI
OS name resolution provides many options, including local cache search, WINS Server query, broadcast, DNS Server
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 the 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. Adapter status
The command returns 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. Netstat-a command
All connections are displayed, while netstat-r displays the route table and active connections. The netstat-e command will display
Ethernet statistics, while netstat-s displays statistics for each protocol. If netstat is used
-N, 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 routes used to access IP Datagram
Path. The Tracert command uses the ip ttl field and the ICMP error message to determine from a host
Routes of other hosts on the network.

How Tracert works
Send "Internet Control Message Protocol (ICMP)" back to the target by sending TTL values of different IP addresses
The Tracert diagnostic program determines the route adopted by the target based on the data packets. Each vro on the path must be
At least 1 of the TTL on the data packet is reduced before the data packet is forwarded. When the TTL on the data packet is reduced to 0, the router
The "ICMP timeout" message should be sent back to the source system.

Tracert first sends response data packets whose TTL is 1, and increases TTL by 1 in each subsequent sending process,
Wait until the target response or TTL reaches the maximum value to determine the route. By checking the "ICM" sent back by the Intermediate Router
The P has timed out. Some routers directly discard the data packets whose TTL expires without asking.
Not found in 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 the 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
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 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 is 19
Route 10.99 host does not have a valid path. This may be caused by vro configuration or 192.168.10.
0 network does not exist (incorrect 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.

For more information, see trace paths using the tracert command.

Use pathping to test the vro
The pathping command is a routing tracking tool that combines the ping and tracert commands with
Together with other information not provided. The pathping Command sends data packets to
Each vro in the path of the final target is returned from each hop point based on the computer result of the data packet. Because
Command to show the extent to which data packets are lost on any given vro or link, so it is easy to determine the possibility
The router or link that causes network problems. Some options are available, as shown in the following table.

Option name Function
-N Hostnames does not resolve the address to the host name.
-H Maximum hops: the Maximum number of hops for a search target.
-G Host-list: Release the source route along the route list.
-P Period: the number of milliseconds that a ping can wait.
-Q Num_queries: the number of queries per hop.
-W Time-out indicates the number of milliseconds each reply takes.
-T Layer 2 tag connects the Layer 2nd priority mark (for example, for IEEE 802.1 p) to the packet and
Send it to each network device in the path. This helps identify networks with layer-3 priorities not correctly configured
Device. The-T switch is used to test QoS connectivity.
-R rsvp test Che check to determine whether each vro in the path supports "resource retention Protocol (RSVP )"
This protocol allows the host to retain a certain amount of bandwidth for data streams. -R switches are used to test QoS connections.
Connectivity.

The default number of hops is 30, and the default waiting time before timeout is 3 seconds. The default time is 250 milliseconds, and
The number of queries per vro along the path is 100.

The following is a typical pathping report. The statistical information edited after the hop list indicates that
Packet loss.

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 Address
0 172.16.87.35
0/100 = 0% |
1 41 ms 0/100 = 0% 0/100 = 0% 172.16.87.218
13/100 = 13% |
2 22 ms 16/100 = 16% 3/100 = 3% 192.68.52.1
0/100 = 0% |
3 24 ms 13/100 = 13% 0/100 = 0% 192.68.80.1
0/100 = 0% |
4 21 ms 14/100 = 14% 1/100 = 1% 10.54.247.14
0/100 = 0% |
5 24 ms 13/100 = 13% 0/100 = 0% 10.54.1.196

Trace complete.

When you run pathping, first view the routing results when testing the problem. This path corresponds to the tracert command
The displayed path is the same. Then the pathping command displays the busy message for the next 125 milliseconds (this time is based on
Point count changes ). During this period, pathping ranges from all the routers listed earlier to the links between them.
Collect information. At the end of this period, it displays the test results.

The rightmost two columns of This Node/Link Lost/Sent = Pct and Address are the most useful. 172
. 13% of data packets are lost in 16.87.218 (hops 1) and 192.68.52.1 (hops 2. All other chains
The connection works normally. Routers in hops 2 and 4 also lose packets destined for them (such as This Node
/Link column), but the loss does not affect the forwarding path.

The loss rate displayed on the Link (marked as | in the rightmost column) indicates that the lost data packets are forwarded along the path. The
If the link is lost, the link is blocked. The loss rate displayed on the vro (displayed by the IP address in the rightmost sidebar) indicates
The CPU of these routers may be overloaded. These congested vrouters may also cause end-to-end problems.
, Especially when the software router forwards data packets.

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.