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

常用网络命令

一、常用网络命令

1、ping命令

ping www.baidu.com
ping -i 3 www.baidu.com :每3秒访问一次
ping -c 3 www.baidu.com : 一共发生3个数据包
ping -f  www.baidu.com :快速发送ICMP数据包,进行压力测试
ping -f -c 200 www.baidu.com :设定具体的发包数量,用于快速检测相应时间的数据
ping -s 200 www.baidu.com :设定每个ICMP数据包的大小

2、ip命令

[root@localhost yum.repos.d]# yum install -y net-tools
Package net-tools-2.0-0.25.20131004git.el7.x86_64 already installed and latest version
Nothing to do

1759071361340

ip addr:查看网卡及IP信息
ifconfig:同上ip neigh:ARP协议,查看相邻计算机
arp -an:同上ip link:查看网卡MAC地址等ip-s1ink:查看网卡的收发数据包大小,RX:收,TX:发
ifconfig -s:同上以太网卡可以绑定多个IP地址
ip addr add 192.168.112.225/24 dev ens 33:I临时为ens33网卡添加—个IP地址,systemctl restart network后消失
ifconfig ens 33 192.168.112.225 :临时修改IP地址ip addr del 192.168.112.225/24 dev ens 33:删除一个IP地址查看路由IP地址:
ip route或route或netstat-r或route-nip route add default via 192.168.112.1:为当前网络添加黑认路由(网关)
route add default gw 192.168.112.1:同上ip route del default via 192.168.112.1:删除路由地址
route del default gw 192.168.112.1ip link set ens 33 up:启动网卡
ifconfig ens 33 up:同上,down表示关闭ss-anl:查看当前系统中的端口占用情况
netstat -anlop:同上
[root@localhost yum.repos.d]# arp -an
? (192.168.102.2) at 00:50:56:f9:55:5b [ether] on ens33
? (192.168.102.254) at 00:50:56:fe:c5:ab [ether] on ens33
? (192.168.102.1) at 00:50:56:c0:00:08 [ether] on ens33
[root@localhost yum.repos.d]# ip neigh 
192.168.102.2 dev ens33 lladdr 00:50:56:f9:55:5b REACHABLE
192.168.102.254 dev ens33 lladdr 00:50:56:fe:c5:ab REACHABLE
192.168.102.1 dev ens33 lladdr 00:50:56:c0:00:08 REACHABLE
[root@localhost etc]# ifconfig -s
Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK    TX-ERR  TX-DRP TX-OVR  Flg
ens33     1500  1126985      0   0      0        220116      0      0      0   BMRU
lo        65536      107      0   0     0           107      0      0      0   LRU
virbr0    1500        0      0    0      0             0      0      0      0   BMU

1759072538341

3、traceroute命令

跟踪所有到达目的的路由,默认30个跃点

4、curl命令

curl 的用法指南 - 阮一峰的网络日志

[root@localhost etc]# curl http://www.baidu.com
<!DOCTYPE html>
<!--STATUS OK--><html> <head><meta http-equiv=content-type content=text/html;charset=utf-8><meta http-equiv=X-UA-Compatible content=IE=Edge><meta content=always name=referrer><link rel=stylesheet type=text/css href=http://s1.bdstatic.com/r/www/cache/bdorz/baidu.min.css><title>百度一下,你就知道</title></head> <body link=#0000cc> <div id=wrapper> <div id=head> <div class=head_wrapper> <div class=s_form> <div class=s_form_wrapper> <div id=lg> <img hidefocus=true src=//www.baidu.com/img/bd_logo1.png width=270 height=129> </div> <form id=form name=f action=//www.baidu.com/s class=fm> <input type=hidden name=bdorz_come value=1> <input type=hidden name=ie value=utf-8> <input type=hidden name=f value=8> <input type=hidden name=rsv_bp value=1> <input type=hidden name=rsv_idx value=1> <input type=hidden name=tn value=baidu><span class="bg s_ipt_wr"><input id=kw name=wd class=s_ipt value maxlength=255 autocomplete=off autofocus></span><span class="bg s_btn_wr"><input type=submit id=su value=百度一下 class="bg s_btn"></span> </form> </div> </div> <div id=u1> <a href=http://news.baidu.com name=tj_trnews class=mnav>新闻</a> <a href=http://www.hao123.com name=tj_trhao123 class=mnav>hao123</a> <a href=http://map.baidu.com name=tj_trmap class=mnav>地图</a> <a href=http://v.baidu.com name=tj_trvideo class=mnav>视频</a> <a href=http://tieba.baidu.com name=tj_trtieba class=mnav>贴吧</a> <noscript> <a href=http://www.baidu.com/bdorz/login.gif?login&amp;tpl=mn&amp;u=http%3A%2F%2Fwww.baidu.com%2f%3fbdorz_come%3d1 name=tj_login class=lb>登录</a> </noscript> <script>document.write('<a href="http://www.baidu.com/bdorz/login.gif?login&tpl=mn&u='+ encodeURIComponent(window.location.href+ (window.location.search === "" ? "?" : "&")+ "bdorz_come=1")+ '" name="tj_login" class="lb">登录</a>');</script> <a href=//www.baidu.com/more/ name=tj_briicon class=bri style="display: block;">更多产品</a> </div> </div> </div> <div id=ftCon> <div id=ftConw> <p id=lh> <a href=http://home.baidu.com>关于百度</a> <a href=http://ir.baidu.com>About Baidu</a> </p> <p id=cp>&copy;2017&nbsp;Baidu&nbsp;<a href=http://www.baidu.com/duty/>使用百度前必读</a>&nbsp; <a href=http://jianyi.baidu.com/ class=cp-feedback>意见反馈</a>&nbsp;京ICP证030173号&nbsp; <img src=//www.baidu.com/img/gs.gif> </p> </div> </div> </div> </body> </html>

5、wget命令

下载文件,与curl结合使用,不用浏览器也能使用网站。

http://www.dtcms.com/a/418330.html

相关文章:

  • 实验指导-基于阿里云函数计算的简单邮件发送服务 之数据库访问中间件
  • PPO算法
  • 网站建设公司方维wordpress 上传文件路径
  • gRPC0到1系列之【6】
  • 【Java系列课程·Java学前须知】第3课 JDK,JVM,JRE的区别和优缺
  • JVM栈溢出时如何dump栈信息?
  • 重庆奉节网站建设公司重庆沙坪坝地图全图
  • RK3588芯片与板卡全面解析:旗舰级AIoT与边缘计算的核心
  • 226.翻转二叉树(二叉树算法题)
  • #itertools.product
  • AcWing 1172:祖孙询问 ← 倍增法求LCA(DFS预处理)
  • C语言 分支结构(1)
  • 扭蛋机抽赏小程序:重构线上娱乐的“盲盒式”新体验
  • EtherNet/IP转EtherCAT网关在新能源制造中实现机器人与运动卡数据互通
  • Imatest-Wedge模块
  • 岳阳博物馆网站网站建设想法
  • Day03_STM32F103C8T6学习笔记6-9章(江科大)
  • 专业企业网站搭建服务docker创建wordpress
  • 各大网站的网址网站的功能性
  • ZYNQ平台摄像头性能深度对决:OV7725 vs OV5640全面速度测试与优化实战
  • Qt 界面优化 --- 绘图
  • MySQL Online DDL:高性能表结构变更指南
  • 操作系统:进程调度,创建和终止
  • Kafka09-速答-尚硅谷
  • Jenkins与GitLab-CI的技术对比分析
  • 2025 年 AI 智能体(Agent)发展全景:技术突破、场景落地与产业重构
  • 电子商务的网站建设名词解释网站设计的流程简答题
  • Spark源码中的线程池
  • Kafka06-进阶-尚硅谷
  • TDengine 时序函数 IRATE 用户手册