Network management must read-common Web commands _ Networking Tutorials

Source: Internet
Author: User
Network management must read-common web commands
If you've ever played with a router, you know the funny command abbreviations in the router. For example, "sh int" means "show interface". Now Windows 2000 also has a tool like the interface, called Netsh.
We are under Windows 2000 cmd shell, enter Netsh to come out:netsh> prompt, enter int IP to display: 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 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 interactively.
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? We can find the answer. Convenient inconvenient ah? It turns out that there are some things that people like about Microsoft. Alas, very few of them!
windows Network Command line program
This section includes:
Use Ipconfig/all to view configuration
£ ipconfig/renew Refresh configuration with
Use Ipconfig to manage DNS and DHCP class IDs
Use Ping to test the connection
Use ARP to resolve hardware address problems
Use Nbtstat to solve NetBIOS name problems
Use Netstat to display connection statistics
Use tracert to track network connections
Use Pathping test router
Use Ipconfig/all to view configuration
When you discover and troubleshoot TCP/IP network problems, first check the TCP/IP configuration on the computer that is having problems. You can use the ipconfig command to obtain host configuration information, including IP addresses, subnet masks, and default gateways.
Attention
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 the TCP/IP configuration for each computer on your network, or to investigate TCP/IP network problems 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 use the DHCP server to dynamically configure TCP/IP and to resolve 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 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, 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.
£ ipconfig/renew Refresh configuration with
When resolving TCP/IP network problems, first check the TCP/IP configuration on the computer that is experiencing the problem. If your computer enables DHCP and uses a DHCP server to obtain configuration, start refreshing the lease using the Ipconfig/renew command.
When using ipconfig/renew, all network adapters on computers that use DHCP, except those that are manually configured, 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 current DHCP configuration of the host. For more information about DHCP and the lease process, see how clients obtain configuration.
Attention
For DHCP-enabled Windows 95 and Windows 98 customers, use the release and renew options for the winipcfg command, instead of the ipconfig/release and Ipconfig/renew commands, manually Releases or updates the client's IP configuration lease.
The ipconfig command can also be used to manage DNS and DHCP class IDs using ipconfig:
Displays or resets the DNS cache. For more information, see View or reset the client resolver cache using Ipconfig.
The registered DNS name is refreshed. For more information, see Updating DNS client registration using ipconfig.
Displays the DHCP class ID for the adapter. For more information, see Displaying DHCP class ID information on a client computer.
Set the DHCP class ID of the adapter. For more information, see Setting DHCP class ID information on a client computer.
Use Ping to test the connection
The ping command helps verify the connectivity of IP levels. When you discover and resolve a problem, you can use Ping to send an ICMP response request to the destination host name or IP address. Use Ping when you need to verify that your host can connect to TCP/IP network and network resources. You can also use Ping to isolate network hardware problems and incompatible configurations.
It is usually best to Ping the command to verify the existence 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 IP address of the target host 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 validation is added to the network correctly.
ping Ip_address_of_local_host
The IP address of the ping default gateway verifies that the default gateway is running and can communicate with local hosts on the local network.
ping Ip_address_of_default_gateway
ping the IP address of the remote host can be communicated through the router.
ping Ip_address_of_remote_host
The ping command resolves the computer name to an IP address with the name resolution of Windows sockets, so if you succeed with the address, but Ping it with a name, the problem is with address or name resolution, not network connectivity. For more information, see Resolving Hardware address problems with ARP.
If you are unable to successfully use Ping at any point, please confirm:
After you install and configure TCP/IP, restart your 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.
IP routing, and links between routers are available.
You can use the different options of the Ping command to specify the packet size to use, how many packets to send, whether to record the used route, the time to Live (TTL) value to use, and whether to set the "Do not Fragment" flag. Can you type ping-? View these options.
The following example shows how to send two Ping to an 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, the Ping waits 1,000 milliseconds (1 seconds) for each response to return before the "Request Timeout" is displayed. If a Ping-probed remote system passes through a long delayed link, such as a satellite link, the response may take longer to return. You can use the-w (wait) option to specify a longer timeout.
Resolving hardware address problems with ARP
Address Resolution Protocol (ARP) allows a host to find the media access control address of a host on the same physical network, if the IP address of the latter is given. To make ARP more efficient, each computer caches IP to media access control address mappings to eliminate duplicate ARP broadcast requests.
You can use the ARP command to view and modify ARP table entries on the local computer. ARP commands are useful for viewing ARP caching and resolving address resolution problems.
For more information, see View the Address Resolution Protocol (ARP) cache and add static ARP cache entries.
Use Nbtstat to solve NetBIOS name problems
NetBIOS (NetBT) on tcp/ip resolves the NetBIOS name to an IP address. TCP/IP provides many options for NetBIOS name resolution, including local cache search, WINS server queries, broadcasts, DNS server queries, and Lmhosts and host file searches.
nbtstat is a useful tool for solving NetBIOS name resolution problems. You can use the nbtstat command to delete or correct a preloaded project:
NBTSTAT-N displays the names that are registered locally on the system by programs such as the server or redirector.
NBTSTAT-C Displays the NetBIOS name cache, which contains the names of other computers to address mappings.
nbtstat-r clears the name cache and reloads it from the Lmhosts file.
NBTSTAT-RR releases the NetBIOS names registered on the WINS server, and then refreshes their registrations.
nbtstat-a name performs the NetBIOS adapter status command on the computer specified by name. The Adapter Status command
Returns the local NetBIOS name table for the computer and the media access control address of the adapter.
nbtstat-s lists the current NetBIOS sessions and their 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 current TCP/IP connections. The netstat-a command displays all connections, while NETSTAT-R displays the routing table and active connections. The NETSTAT-E command displays Ethernet statistics, and netstat-s displays statistics for each protocol. If you use Netstat-n, you cannot convert addresses and port numbers to names. Here is an example of Netstat's output:
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
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
Using tracert to track network connections
The tracert (trace route) is the routing trace utility that determines the path taken by IP datagram access targets. The Tracert command uses the IP lifetime (TTL) field and ICMP error messages to determine routes from one host to another host on the network.
tracert Working principle
By sending an Internet Control Message Protocol (ICMP) response packet to the target with a different IP time to Live (TTL) value, the Tracert diagnostics determine the route to the destination. Requires that each router on the path decrements 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.
tracert sends a response packet with a TTL of 1 and increments the TTL by 1 in each subsequent send process until the target response or TTL reaches its maximum value to determine the route. Route is determined by examining the "ICMP timed out" message sent back by the intermediary router. Some routers discard the TTL-expired packets without asking, which is not visible in the tracert utility.
The tracert command prints a list of the near-end router interfaces in the path that returns the ICMP timeout message in order. If you use the-D option, the Tracert utility does not query DNS on each IP address.
In the following example, the 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 192.168.0.1
3 Ms Mobile Ms 172.16.0.99
trace complete.
Solve problems with Tracert
You can use the TRACERT command to determine where the packet will stop 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 and can take several paths to the same point.
tracert Command line Options
The 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
Description of the option
-D specifies that the IP address is not resolved to the host name.
-h maximum_hops Specifies the metric to track the route to a host called Target_name.
-j host-list Specifies the list of router interfaces 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.

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.