Windows network commands

Source: Internet
Author: User

First, Ping

The main test is the correctness of the TCP/IP protocol configuration and current network status.

The basic usage format for the ping command is: ping IP address/hostname/domain name [-T] [-a] [-N Count] [-l size]

- T: Ping the IP address/hostname/domain name continuously until the user is interrupted by CTRL + C.

-A : Displays the destination host network address in IP address format, the default option.

- N Count: specifies how many times to ping, specified by count, and the default value is 4.

- L Size: Specifies the length of data sent in the ping command, and the default value is 32 bytes.

Second, netstat

It mainly helps to understand the overall network situation and the current connection situation.

Basic use of command format:netstat [-n] [-a] [-e] [-r][-s]

- N: shows all valid connections that have been established.

- S: This option displays its statistics according to the respective protocols. If your application (such as a Web browser) is running slowly, or you cannot display data such as a Web page, then we can use this option to look at the information that is displayed. We need to look at the rows of the statistics, find the wrong keyword, and identify the problem.

- e: This option displays statistical data about Ethernet. The items it lists include the total number of bytes sent, the number of errors, the number of deletes, the number of datagrams, and the number of broadcasts. These statistics have both the number of datagrams sent and the number of datagrams received. (This option can be used to count some basic network traffic)

- R: This option displays information about the routing table and displays the currently valid connection in addition to showing valid routes.

-A : This option displays a list of all valid connection information, including established connections (established), and those that listen for connection requests (LISTENING).

Third, Ipconfig

The main idea is to understand the values set by the current TCP/IP protocol, such as IP address, subnet mask, default gateway, MAC address, and so on.

Basic method of Use : ipconfig [/all/release/renew]

ipconfig: when no parameter option is present, it displays the IP address, subnet mask, and default gateway value for each interface that has been configured.

/all: When you use the All option, you can display additional information (such as IP addresses, etc.) that it has configured and uses for DNS and WINS servers. and displays the physical address (MAC) built into the local network card. If the IP address is leased from a DHCP server, it displays the IP address of the DHCP server and the date the leased address is expected to expire.

/release &/renew : Here are two additional options that can only work on computers that lease their IP addresses to a DHCP server. If I enter Ipconfig/release, The leased IP address of all interfaces is then re-delivered to the DHCP server (return IP address). If you enter Ipconfig/renew, the local computer tries to contact the DHCP server. and rent an IP address. Note that in most cases the NIC will be re-assigned to the same IP address that was previously given.

Iv. Route

Used primarily to configure routing and to view current routing conditions.

Basic usage:route [Print] [add] [change] [delete]

Print : The main printing is the current routing situation.

Add : manually adding routes or routing with the following example:

?
route ADD 157.0.0.0 MASK 255.0.0.0  157.55.80.1 METRIC 3 IF 2  destination^ (目标地址)  ^mask      ^gateway   metric^    ^                                                   Interface^ (接口)

Change : only used to modify the gateway and/or metric. Examples are as follows:

?
route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2

Delete : deletes the route. Examples are as follows:

?
route DELETE 157.0.0.0

Wu, tracert (Trace router abbreviation, for Route trace command)

It is primarily used to display a set of IP routers that pass packets from the computer to the target location, and the time required for each hop (that is, the trace datagram routing path) to test for network connectivity issues.

基本用法: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout]                         [-R] [-S srcaddr] [-4] [-6] target_name(目标IP、URL或域名)选项:    -d                 不将地址解析成主机名.    -h maximum_hops    搜索目标的最大跃点数.    -j host-list       与主机列表一起的松散源路由(仅适用于 IPv4).    -w timeout         等待每个回复的超时时间(以毫秒为单位).    -R                 跟踪往返行程路径(仅适用于 IPv6).    -S srcaddr         要使用的源地址(仅适用于 IPv6).    -4                 强制使用 IPv4.    -6                 强制使用 IPv6.

Vi. ARP (Address Resolution, Protocol, is a TCP/IP protocol that acquires a physical address.)

Used primarily to view the current contents of the ARP cache on the local computer or another computer.

Basic usage:ARP [-a/g] [-S] [-d]

-A: Used to view all items in the cache, the-A and-G parameters have the same result.

-S: Manually enter a static ARP entry into the ARP cache.

-D: Deletes the contents of the ARP cache.

Results analysis

1,ipconfig displays the native IP address configuration.

2,ipconfig/all shows the details of the native IP address configuration, and so on.

The 3,ping instruction tests the connectivity of the network, sends 4 ICMP type 8 messages to each other, and the other responds with 4 ICMP-type messages to the native.

4,ping–t Send ICPM type 8 messages to each other, as long as the other side survived, will continue to send.

5,ARP–A Displays the contents of the native ARP cache, the corresponding relationship between the IP address of the opponent and the other MAC address.

6,arp–d Delete the ARP cache of this machine, and clear the correspondence between IP address and MAC address.

7,arp–s binding the corresponding relationship between the IP address in the ARP cache and the MAC address in the machine is a static relationship.

8,neststat–an shows the network connection of this machine.

9,nslookup is used to resolve the domain name of the directive, you can resolve the domain name of the corresponding IP address.

The abbreviation for the Tracert:trace route, which indicates route tracking.

DOS command finds a string in multiple files findstr/s/i "WndProc" * *

Under DOS, "WndProc" is the string to look for. Find the current directory Ixia *. * file. The batch file can be written in the following form:

@echo off For %%i in (c:\users\administrator\desktop\new\cyusb\*.*) do (type%%i |findstr "WndProc" >nul && echo%%~nxi) Pause

File content Comparison

Use the FC command to compare. The FC command is a common command under DOS and is also available in Windows. You save two copies of the Notepad file in the same folder, for example, D:\TXT, named 1.txt, 2.txt, and then enter CMD in the run to open a command prompt window and use the CD command to enter D:\TXT, and finally input Fc 1.txt 2. You can see the difference between the two when you enter the TXT.

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.