当前位置: 首页 > news >正文

服务器主机网络测试命令

适用场景:测试宿主机的出公网带宽流量

安装服务speedtest-cli

sudo yum install python-pip
pip install speedtest-cli  # 这里有可能会遇到网络不通,会连接github地址# 建议使用阿里云地址,下面是http,这里可以换成https
pip install -i http://mirrors.aliyun.com/pypi/web/simple  --trusted-host mirrors.aliyun.com speedtest-cli
Collecting speedtest-cli
Downloading http://mirrors.aliyun.com/pypi/web/packages/9f/39/65259b7054368b370d3183762484fa2c779ddc41633894d895f9d1720f45/speedtest_cli-2.1.3-py2.py3-none-any.whl
Installing collected packages: speedtest-cli
Successfully installed speedtest-cli-2.1.3   # 看到successfully 就说明安装成功了

运行speedtest测试网速

speedtest-cli --simple# 输出结果
Ping: 7.843 ms
Download: 748.19 Mbit/s
Upload: 426.23 Mbit/s

适用场景:测试两个宿主机之间的带宽流量

安装服务 iperf3

yum -y install iperf3  # 服务端和客户端安装

命令概述

# 服务端 操作命令启动  
]# iperf3 -s  # 输入成功后 宿主机会运行一个服务端程序,上面会启动一个5201端口号提供给客户端连接# 客户端 操作命令 启动 
]# iperf3 -c (10.50.10.202)# 这里输入的IP地址是服务端的IP地址,这里默认连接5201端口,如果服务端非5201 需要-p 指定端口号

示例命令

# 服务端和客户端安装 
yum -y install iperf3
# 服务端 操作命令启动  
]# iperf3 -s # 示例命令  服务端 10.10.78.5
[root@localhost admin]# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------# 客户端 操作命令 启动  
]# iperf3 -c (ip地址)# 验证命令
]# iperf3 -c 10.10.78.5
Connecting to host 10.10.78.5, port 5201
[  4] local 10.10.110.202 port 55518 connected to 10.10.78.5 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec   114 MBytes   958 Mbits/sec   57    107 KBytes       
[  4]   1.00-2.00   sec   111 MBytes   933 Mbits/sec   22    205 KBytes       
[  4]   2.00-3.00   sec   110 MBytes   923 Mbits/sec   22    163 KBytes       
[  4]   3.00-4.00   sec   111 MBytes   933 Mbits/sec   16    178 KBytes       
[  4]   4.00-5.00   sec   111 MBytes   933 Mbits/sec   20    151 KBytes       
[  4]   5.00-6.00   sec   111 MBytes   933 Mbits/sec   14    133 KBytes       
[  4]   6.00-7.00   sec   110 MBytes   923 Mbits/sec   12    339 KBytes       
[  4]   7.00-8.00   sec   111 MBytes   933 Mbits/sec   25    187 KBytes       
[  4]   8.00-9.00   sec   111 MBytes   933 Mbits/sec   16    182 KBytes       
[  4]   9.00-10.00  sec   111 MBytes   933 Mbits/sec   10    153 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  1.09 GBytes   934 Mbits/sec  214             sender
[  4]   0.00-10.00  sec  1.08 GBytes   931 Mbits/sec                  receiveriperf Done.


http://www.mrgr.cn/news/82386.html

相关文章:

  • 快速启动与休眠唤醒的区分
  • Linux 小火车
  • Lua语言的图形用户界面
  • 部署启动nacos报错No DataSource set 及master-db not found
  • Eamon.MeituanDotnetSDK 美团C# .Net SDK开源啦
  • 代码随想录算法训练营第三十四天-动态规划-63. 不同路径II
  • 双目的一些文章学习
  • 企业二要素如何用java实现
  • HarmonyOS-面试整理
  • vue,使用unplugin-auto-import避免反复import,按需自动引入
  • 解释下torch中的scatter_add_
  • ACL的注意事项
  • Kafka集群部署与安装
  • 爱死机第四季(秘密关卡)4KHDR国语字幕
  • Redis - 5 ( 18000 字 Redis 入门级教程 )
  • @Cacheable 注解爆红(不兼容的类型。实际为 java. lang. String‘,需要 ‘boolean‘)
  • 如何在notepad++里面,修改注释颜色
  • 2021年福建公务员考试申论试题(县级卷)
  • 4.Web安全——JavaScript基础
  • Unity2022接入Google广告与支付SDK、导出工程到Android Studio使用JDK17进行打包完整流程与过程中的相关错误及处理经验总结
  • BGP(Border Gateway Protocol)路由收集器
  • Python 数据可视化的完整指南
  • 拼多多手势验证码/某多多手势验证码
  • vscode,eslint的报错影响编译
  • 基于VSCode软件框架的RISC-V IDE MRS2正式上线发布
  • python: generate model and DAL using Oracle