ping:查看目标机器的网络是否可达
traceroute
mtr:如果ping通,说明网络可达,但是依然丢包或者服务无法方法,则可通过mtr命令查看在哪个环境出现的问题,mtr是traceroute的加强板,建议使用mtr,没有mtr命令,则可通过 yum install -y mtr 安装
nslookup:nslookup www.baidu.com,Server即为域名对应的ip
telnet:如果ip是可达的,但是服务仍有然有问题,则可以通过 telnet去查看服务端口状态
tcpdump:
tcpdump -i any -n port 80 # 抓取所有网卡(any)80端口数据包,并且以ip形式显示(-n)
tcpdump -i any -n host 10.0.0.1 # 抓取所有网卡的和10.0.0.1之间的数据包,并且以ip形式显示
tcpdump -i any -n host 10.0.0.1 and port 80# 抓取所有网卡的80端口和10.0.0.1之间的数据包,并且以ip形式显示
tcpdump -i any -n host 10.0.0.1 and port 80 -w /tmp/tcpdump.txt # 抓取所有网卡的80端口和10.0.0.1之间的数据包,并且以ip形式显示,捕获的结果保存到 /tmp/tcpdump.txt 文件中
netstat 查看服务监听端口状态是否正确
-n 显示ip地址
-t tcp协议
-p 显示端口对应的进程
-l tcp的监听状态(listen)
ss 与netstat类似,查看服务监听端口状态是否正确
-ntpl
⽹络故障排除命令
猜你喜欢
转载自www.cnblogs.com/wooluwalker/p/12638014.html
今日推荐
周排行