Network management common network command set

xiaoxiao2021-03-06  118

If you are playing a router, you know that the router is very fun command abbreviation.

For example, "Sh Int" means "show interface".

Now Windows 2000 has a similar interface tool called Netsh.

We entered Netsh under the cmd shell of Windows 2000

Just come out: Netsh> prompt,

Enter 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 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 introduction is one way to operate by interactive.

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 don't know the grammar, don't be tight!

At the prompt, enter? You can find the answer. Convenient and inconvenient?

It turns out that Microsoft's things are there, there are so some people who love. Unfortunately, it is very few!

Windows network command line program

This part includes:

View configuration using IPCONFIG / ALL

Refresh configuration using IPConfig / Renew

Manage DNS and DHCP Categories ID using IPConfig

Use PING test connection

Use ARP to resolve hardware address issues

Use nbtstat to solve the NetBIOS name problem

Display connection statistics using NetStat

Use Tracert Tracking Network Connections

Use the PATHPING test router

View configuration using IPCONFIG / ALL

When discovering and resolving TCP / IP network issues, check the TCP / IP configuration on a computer that appears. Host configuration information can be obtained using the ipconfig command, including IP addresses, subnet masks, and default gateways.

note

For Windows 95 and Windows 98 clients, use the WiniPCFG command instead of the ipconfig command. When using the IPConfig command with / all option, a detailed configuration report for all interfaces, including any configured serial port. Using IPConfig / ALL, you can redirect the command output to a file and paste the output into other documents. You can also use this output to confirm the TCP / IP configuration of each computer on the network, or further investigate TCP / IP network issues.

For example, if the IP address of the computer is repeated with the 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 the DHCP server and use the WINS and DNS server to resolve the name.

Windows 2000 IP Configuration

...........: Hybrid

IP routing enabled .....: No

Wins proxy enabled .....: No

Ethernet Adapter Local Area Connection:

Host name ................: Corp1.microsoft.com

.............: 10.1.0.200

Description.......................................

Physical address..................................

DHCP enabled .............

AutoConfiguration enabled .: YES

IP address.............: 192.168.0.112

Subnet mask.............: 255.255.0.0

192.168.0.1

DHCP Server............: 10.1.0.50

PRIMARY WINS Server.....: 10.1.0.101

Secondary Wins Server...: 10.1.0.102

Wednesday, September 02, 1998 10:32:13 AM

Lease expression........: Friday, September 18, 1998 10:32:13 AM

If the TCP / IP configuration is no problem, the next test can be connected to other hosts on the TCP / IP network.

Refresh configuration using IPConfig / Renew

To resolve the TCP / IP network problem, check the TCP / IP configuration on the computer that encounters a problem. If the computer enables DHCP and gets the configuration using the DHCP server, use the ipconfig / renew command to start refresh the lease.

When using IPConfig / Renew, all NICs on a computer (except those manual configuration adapters) are used to connect to DHCP servers, update existing configurations or get new configurations.

You can also immediately release the current DHCP configuration of the host using the ipconfig command with the / Release option. For more information on DHCP and rental processes, see How to get a configuration.

note

For Windows 95 and Windows 98 customers enabled by DHCP, use the release and renew options of the winiPCFG command, not the ipconfig / release and ipconfig / renew commands, manually release or update the customer's IP configuration lease. Manage DNS and DHCP Categories ID using IPConfig

You can also use the ipconfig command:

Display or reset the DNS cache.

For more information, see Use IPConfig to view or reset the customer resolution program.

Refresh the registered DNS name.

For more information, see Updating DNS Customer Registration with IPConfig.

Displays the DHCP Category ID of the adapter.

For more information, see Displaying the DHCP Category ID information on the client.

Set the DHCP category ID of the adapter.

For more information, see Setting the DHCP Category ID information on the client.

Use PING test connection

The ping command helps to verify the connectivity of the IP level. When discovering and resolving issues, you can send an ICMP response request to the target host name or IP address using ping. If you need to verify that the host can connect to the TCP / IP network and network resources, use ping. You can also use ping to isolate network hardware issues and incompatible configurations.

Usually, it is best to verify that the route between the local computer and the network host exists with the ping command, and the IP address of the network host to which you want to connect. The IP address of the PING target host does not respond, as follows:

PING ip_address

When using ping, you should perform the following steps:

Ping loopback address Verify that TCP / IP is installed on the local computer and whether the configuration is correct.

Ping 127.0.0.1

Ping local computer IP address verification is added correctly to the network.

PING ip_address_of_local_host

The IP address of the ping default gateway verifies whether the default gateway is running and whether it can communicate with the local host on the local network.

PING ip_address_of_default_gateway

The IP address verification of the PING remote host can communicate via the router.

PING ip_address_of_remote_host

The ping command parsing the computer name into an IP address with the name of the Windows socket style, so if the name is successfully, the problem is resolved on the address or name analysis, not the network connectivity. For more information, see Using ARP to resolve hardware address issues.

If you can't use ping in any point, please confirm:

Restart your computer after installing and configuring TCP / IP.

"Internet Protocol (TCP / IP) Properties dialog box" General "IP address on the local computer on the General tab is valid and correct.

Enable IP routing, and link between the router is available.

You can use the different options of the ping command to specify the packet size to use, how many data packets are to be sent, whether to record the route used, the living time (TTL) value to use, and whether the "no segment" flag is set. Can I type ping -? View these options.

The following example shows how to send two pings to IP addresses 172.16.48.10, each 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 time that PING waits for 1,000 milliseconds (1 second) will return each response before displaying "request timeout". If a long-term delayed link is passed through the remote system, such as a satellite link, the response may take longer to return. You can use the -w (wait) option to specify a longer time timeout.

Use ARP to resolve hardware address issues

"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's IP address is given. To make the ARP more efficient, each computer cache IP to the media access control address map eliminates the repeated ARP broadcast request.

You can use the ARP command to view and modify the ARP entry on the local computer. The ARP command is useful for viewing ARP caches and resolving address resolution issues.

For more information, see Viewing the Address Resolution Protocol (ARP) cache and add a static ARP cache item.

Use nbtstat to solve the NetBIOS name problem

NetBIOS (NetBT) on TCP / IP resolves the NetBIOS name into an IP address. TCP / IP provides a lot of options for NetBIOS name, including local cache search, WINS server query, broadcast, DNS server queries, and LMHOSTS and host file searches.

NBTSTAT is a useful tool to solve the NetBIOS name resolution problem. You can use the nbtstat command to delete or correct preloaded items:

NBTSTAT-N Displays the names local registered locally locally on the system, or the program, or a redirector.

NBTSTAT -C Displays the NetBIOS name cache, contains the name of the other computer to the address mapping.

NBTSTAT -R Clears the name cache and then reload from the LMHOSTS file.

NBTSTAT -RR releases the NetBIOS name registered on the WINS server and refreshes their registration.

NBTSTAT -A Name executes the NetBIOS adapter status command to the computer specified by the Name. The adapter status command will return to the local NetBIOS name table of the computer, as well as the media access control address of the adapter.

NBTSTAT -S lists 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

Display connection statistics using NetStat

You can use the NetStat command to display protocol statistics and current TCP / IP connections. The NetStat -a command will display all connections, and NetStat -r displays routing tables and active connections. The NetStat -E command will display the Ethernet statistics, and NetStat -s displays statistics for each protocol. If NetStat -n is used, the address and port number cannot be converted into a name. Below is an output example of NetStat: C: /> Netstat -e

Interface statistics

Received Sent

Bytes 3995837944 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 Establish

TCP CORP1: 1589 172.16.48.10:NBSession Established

TCP CORP1: 1606 172.16.105.245:Bsession Established

TCP CORP1: 1632 172.16.48.213:nbsession Established

TCP CORP1: 1659 172.16.48.169:BSession Established

TCP CORP1: 1714 172.16.48.203:NBSession Established

TCP CORP1: 1719 172.16.48.36:Bsession 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 request = 0

Reassembly surcessful = 0

Reassembly failures =

DataGrams SuccessFully Fragrams Success Fragmented = 0

DataGrams Failing Fragmentation = 0

Fragments create = 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 0

Address Masks 0 0

Address Mask Replies 0 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 Tracking Network Connections

Tracert is a routing trace utility to determine the path taken by IP datagram access. The tracert command uses the IP Living Time (TTL) field and ICMP error messages to determine the route from one host to other hosts on the network.

Tracert works

The Tracert Diagnostics determine the route taken by the target by sending the Internet Control Message Protocol (ICMP) "responding to the target. Each router on the request path will deliver at least the TTL on the packet before forwarding the packet. When the TTL on the packet is reduced to 0, the router should return the "ICMP timeout" message to the source system.

Tracert first sends a response packet for TTL 1, incrementing TTL at a subsequent delivery process, until the target response or TTL reaches the maximum value, thereby determining the route. Determine the route by checking the "ICMP timeout" message sent back from the intermediate router. Some routers are not inquired to discard the TTL expired packets directly, which can not see in the Tracert utility.

The tracert command prints out of the near-end router interface list in the path to the "ICMP Timeout" message. If you use the -d option, the Tracert utility is not queried to DNS on each IP address.

In the following example, the packet must be reached by two routers (10.0.0.1 and 192.168.0.1) to reach 172.16.0.99. The host's default gateway 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 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.

Solve problems with Tracert

You can use the tracert command to determine the stop position of the packet 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 the problem of router configuration, or 192.168.10.0 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 hops1 10.0.0.1 ReportSstination Net Unreachable.

TRACE COMPLETE.

The Tracert utility is very useful for solving large network problems. You can take several paths to the same point.

Tracert command line option

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 Specifies the number of hops to track the route of the host called target_name.

-j host-list Specifies a list of router interfaces in the Tracert utility packet.

-w Timeout Waiting TIMEOUT for the number of milliseconds specified each time.

Target_name The name or IP address of the target host.

For more information, see Tracking the path using the tracert command.

Use the PATHPING test router

The PATHPING command is a routing trace tool that combines the features of the ping and tracert commands and other information not provided by the two tools. The PATHPING command sends the packet to each router that reaches the path to the final target, and then returns from each hop based on a packet-based computer result. Since the command displays the extent to which the packet is lost on any given router or the link, it is easy to determine the router or link that may cause a network problem. Some options are available, as shown in the following table.

Option name function

-n hostnames does not resolve the address as a host name.

-H Maximum HOPS Search The maximum number of hop points for the target.

-g Host-List releases the source rout along the routing list.

-p Period Waiting for milliseconds between ping.

-q num_queries number of queries for each hop.

-w time-out is the number of milliseconds waiting for each time.

-T Layer 2 TAG connects the second layer priority tag (e.g., IEEE 802.1p) to the packet and sends it to each network device in the path. This helps identify network devices that do not correctly configure the second layer priority. -T switch is used to test service quality (QoS) connectivity.

-R RSVP IsBase CHE Checks whether each router in the determined path supports "Resource Retention Protocol (RSVP)", which allows the host to retain a certain amount of bandwidth for the data stream. -R switch is used to test service quality (QoS) connectivity.

The default hop number is 30, and the default waiting time before the timeout is 3 seconds. The default time is 250 milliseconds, and the number of times the query along the path is 100.

The following is a typical pathping report. The statistics edited after the hop list indicate the loss of packets 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.21813/ 100 = 13% |

2 22ms 16/100 = 16% 3/100 = 3% 192.68.52.10/ 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, first check the results of the route when testing the problem. This path is the same as the path displayed by the tracert command. Then PATHPING command is displayed on the next 125 millisecond (this time varies according to the hop count). During this time, PATHPING collects information between all the previous routers and their links. At the end of this period, it displays the test results.

The rightmost two-column this node / link lost / service = PCT and Address include the most useful information. 172.16.87.218 (Jum 1) and 192.68.52.1 (Jum 2) Lost 13% of the packets. All other links are working properly. The router in hops 2 and 4 is also lost to their packets (as shown in the this node / link bar), but the loss does not affect the forwarded path.

The loss rate (marked in the homemost bar is indicated) indicating the lost packet along the path. This loss indicates that the link is blocked. The loss rate displayed by the router (displayed through the IP address in the right one) indicates that the CPU of these routers may run overload. These blockage routers may also be a factor in end-to-end issues, especially when the software router forwards the packet.

转载请注明原文地址:https://www.9cbs.com/read-102896.html

New Post(0)