Under Windows common network commands

Some common network commands under Windows, used to analyze and troubleshoot network failures. Not for all the write down, but to leave the impression that, when network problems can think of these two tools.

surroundings:

  • CMD version: 10.0.17134.766
  • System: Windows 10 Home Edition (OS build 17134.766)

ping

ping is a tool for determining whether the IP layer of the two computers communication, by sending an ICMP echo packets, if the two computers are connected, the packet will be returned. Otherwise, ICMP error messages are returned.

Basic use ping the host name / domain / ip

ping xx-pc #主机名
ping 192.168.0.205 #ip
ping baidu.com #域名
复制代码

Size, number, number of hops, time

# 发送缓冲包大小,默认32,最大65527
ping /l 1000 10.0.99.221

# 发送次数,默认四次
ping /n 10 10.0.99.221
# 一直发送直到中断
ping /t 10.0.99.221

# 设置TTL值(可认为是允许中转路由数,即跳跃数),默认是IP协议默认的TTL值
ping /i 10 10.0.99.221

# 等待的时间,单位毫秒
ping /w 10 10.0.99.221
复制代码

Loose routing / strict routing from some of the former address of the destination address need to go through strict routing address is in strict accordance with the order, loose routing is only need to go through (you can go through a lot of other address that is between each address) address. Since IP packets own limitations, up to a specified address list is nine.

# 宽松选路
ping /j 10.12.0.1 10.29.3.1 10.1.44.1 10.0.99.221
# 严格选路
ping /k 10.12.0.1 10.29.3.1 10.1.44.1 10.0.99.221
复制代码

The next test is not successful, the corresponding system commands on mac, no such option, is it does not support the "(° ヘ °).

ipconfig

Used to display the current TCP / IP network configuration and refresh the DHCP and DNS settings.

display

# 显示所有网络适配器(包括虚拟机)的基本信息:
#     适配器名、IPv4、IPv6、子网掩码、默认网关
ipconfig
# 显示所有适配器的全部信息,基本信息加上:
#    物理地址、DHCP是否启用、自动配置是否启用、DNS 服务器
#    DHCPv6 IAID、 DHCPv6 客户端 DUID、TCPIP 上的 NetBIOS
ipconfig /all
# 显示 DNS 解析程序缓存的内容。
ipconfig /displaydns
复制代码

modify

# 清除 DNS 解析程序缓存
ipconfig /flushdns
# 更新指定适配器的 IPv4 地址,名称可用通配符
ipconfig /renew "Local*"
# 刷新所有 DHCP 租用并重新注册 DNS 名称
ipconfig /registerdns
复制代码

netstat

Display protocol statistics and current TCP / IP network connection

Connection Information

# 显示所有连接和监听,实时显示
netstat -a
# 每个连接或监听所涉及的执行程序
netstat -b
# 显示 proto 指定的协议的连接(TCP、UDP、TCPv6、UDPv6)
netstat -p proto      
复制代码

Routing Table

# 显示路由表,包括:IPv4、IPv6、默认路由、接口列表
netstat -r
复制代码

Statistics

# 显示每个协议统计(IP4、IP6的:IP、ICMP、TCP、UDP)信息
# 加上p参数可以指定协议
netstat -s
# 显示以太网统计信息
netstat -e
复制代码

route

Routing table related commands

# 显示路由表
route print
复制代码

Also manually add, modify, delete command, feeling less useful, use it every time to go check it, not introduced.

nslookup

Displays the DNS information

# 使用默认服务器的交互模式
nslookup            
# 使用 "server" (对应的DNS服务器)的交互模式
nslookup - server    
# 仅查找使用默认服务器的 "host"(域名)
nslookup host        
# 仅查找使用 "server" 的 "host"
nslookup host server
复制代码

tracert

Trace route information based on ICMP echo packets and UDP port error, equivalent to traceroute program.

  • -h maximum_hops The maximum number of hops search target.
  • -j host-listTogether with the host loose source route list (only for IPv4). As with ping, but the same can not be used for an unknown reason.
  • -w timeout Each reply wait timeout (in milliseconds).
# 基本使用
tracert www.baidu.com
# 设置跳转次数和时间
tracert -h 10 -w 5 www.baidu.com
# 设置宽松路径
tracert -j 10.1.16.113 www.baidu.com
复制代码

arp

Displays and modifies the Address Resolution Protocol (ARP) used "to the IP physical" address translation table (ARP cache).

# 添加arp缓存项
arp -s inet_addr eth_addr [if_addr]
# 删除arp缓存项
arp -d inet_addr [if_addr]
# 查看arp缓存项
arp -a [inet_addr] [-N if_addr] [-v]
复制代码
  • inet_addr: Internet address (IP address needs to be sent)
  • eth_addr: physical address
  • if_addr: Specifies the address of the interface (corresponding to the machine an IP address)
  • -N if_addr: Displays the arp cache if_addr
  • -v: Verbose mode shows all invalid entries and entries on the loopback interface will be displayed.

No public one-half programmer, computer-based learning focused, welcome attention :)

Guess you like

Origin blog.csdn.net/weixin_34342992/article/details/91364311
Recommended