博文背景

想知道ip a命令的输出都是什么意思,过于简单的如mtu、mac地址和广播地址我就不解释了

具体操作

重要文档
https://baturin.org/docs/iproute2/
http://web.archive.org/web/20220807073512/http://www.policyrouting.org/iproute2.doc.html
https://lartc.org/howto/

详解开始

ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000link/ether 00:0c:29:34:c3:3b brd ff:ff:ff:ff:ff:ffaltname enp2s1inet 192.168.8.128/24 metric 100 brd 192.168.8.255 scope global dynamic ens33valid_lft 1025sec preferred_lft 1025secinet6 fe80::20c:29ff:fe34:c33b/64 scope linkvalid_lft forever preferred_lft forever

尖括号里面有up并且后面的state也有up那么为什么会有两个up呢?

请看https://superuser.com/questions/1463162/unknown-state-of-network-interface

这里提到网卡分为管理状态和运行状态

为了方便理解,我们断开虚拟机的网卡连接

查看网卡状态

会发现左边是up但是右边是down的状态

NO_CARRIER(大写)是一条从调制解调器发送到它所连接的设备(通常是计算机)的短信,表明调制解调器没有(或不再)连接到远程系统。

参考 https://en.wikipedia.org/wiki/NO_CARRIER

尖括号里面的东西叫网络设备的状态标识(net_device_flags)

参考 https://man7.org/linux/man-pages/man7/netdevice.7.html

BROADCAST:表示网卡有广播地址
MULTICAST:表示网卡可以发送多播包
UP:表示网卡处于启动的状态
LOWER_UP:网卡连接正常,就是网卡已经上电

参考 https://www.cnblogs.com/qgdtq/p/15350333.html

group指的是Link groups are similar to port ranges found in managed switches. You can add network interfaces to a numbered group and perform operations on all the interfaces from that group at once.Links not assigned to any group belong to group 0 (“default”).

参考 https://baturin.org/docs/iproute2/#ip-link-group

qdisc和qlen指的是Linux 操作系统中的流量控制器 TC (Traffic Control) 用于Linux内核的流量控制,它规定建立处理数据包的队列,并定义队列中的数据包被发送的方式,从而实现对流量的控制。qdisc(队列规则,queueing discipline)是 Linux 流量控制系统的核心。实际就是一个队列上面附加的排队规则,下文有时也直接称为队列。
qdisc其实就是一个调度器,每个网络接口都会有一个调度器,qdisc会根据调度器的规则重新排列数据包进入队列的顺序。qlen我暂且简单理解成队列的长度,可能有误,读者自行斟酌。
请看 https://blog.csdn.net/qq_44577070/article/details/123967699
参考 https://tldp.org/en/Traffic-Control-HOWTO/ar01s04.html

inet指的是Internet protocol family
参考 https://unix.stackexchange.com/questions/545462/what-does-inet-stand-for-in-the-ip-utility

link/loopback和link/ether指的应该就是网卡类型,具体没有找到权威解释

scope指的是

Scope | Description
global | valid everywhere
site | valid only within this site (IPv6)
link | valid only on this device
host | valid only inside this host (machine)

Scope is normally determined by the ip utility without explicit use on the command line. (…)

The scope of a route in Linux is an indicator of the distance to the destination network. The scope of an IP address is an indicator of how far from the local host the address is known, which, to some extent also tells you how far the owner of that address is from the local host (…).

Host: An address has a host scope when it is used only to communicate within the host itself. Outside the host this address is not known and can not be used. An Example is the loopback address, 127.0.0.1

Link: An address has a link scope when it is meaningful and can be used only within a LAN. An example is a subnet’s broadcast address.

Global: An address has global scope when it can be used anywhere. This is the default scope for most addresses. (…)

The main reason to use scopes seems to be that a host with multiple interfaces and addresses has to decide when to use which address. For communication with itself a loopback address (scope host) can be used. With communication elswhere, a different address has to be selected.

参考 https://serverfault.com/questions/63014/ip-address-scope-parameter

vaild_lft和preferred_lft指的是
Autoconfigured IPv6 global unicast addresses acquire their valid and preferred lifetime assignments from RAs. A valid lifetime is the time period during which an address is allowed to remain available and usable on an interface. A preferred lifetime is the length of time an address is intended for full use on an interface, and must be less than or equal to the address’s valid lifetime.
参考 https://techhub.hpe.com/eginfolib/networking/docs/switches/WB/16-01/5200-0135_wb_2920_ipv6/content/ch01s15.html

虽然针对ipv6的,但是有时候ipv4也会出现这玩意,有关ipv4我没找到详细资料但道理应该差不多。
根据 https://phoenixnap.com/blog/ipv4-vs-ipv6 显示对于ipv4这个概念并不适用。

Linux网卡状态查看相关推荐

  1. linux防火墙查看方法有,linux防火墙状态查看的方法实例

    linux防火墙状态查看的方法 1.基本操作 # 查看防火墙状态 service iptables status # 停止防火墙 service iptables stop # 启动防火墙 servi ...

  2. linux 防火墙查看出错,linux防火墙状态查看的方法实例

    linux防火墙状态查看的方法 1.基本操作 # 查看防火墙状态 service iptables status # 停止防火墙 service iptables stop # 启动防火墙 servi ...

  3. linux防火墙状态确认,linux防火墙状态查看的方法

    小编给大家整理了关于linux防火墙状态查看的方法实例的相关内容,需要的朋友们可以学习下. linux防火墙状态查看的方法 1.基本操作 # 查看防火墙状态 service iptables stat ...

  4. 查看uvp linux网卡状态,Centos下如何检测网卡状态

    由于ifconfig命令没法看到网卡的一些状态, 以下有5种方法查看网卡状态,是否连通网线 How to check physical Network Link Status on Linux (RH ...

  5. linux服务器状态查看命令,Linux服务器操作系统查看命令

    Linux服务器操作系统的性能分析我们可以通过命令来查看详细信息.下面由学习啦小编为大家整理了Linux服务器操作系统查看命令,希望对大家有帮助! Linux服务器操作系统查看命令 一 .linux服 ...

  6. linux防火墙状态查看/打开/关闭及端口/打开/关闭操作记录

    防火墙:大体分为主机防火墙和网络防火墙. 主机防火墙:针对于单个主机进行防护. 网络防火墙:往往处于网络入口或边缘,针对于网络入口进行防护,服务于防火墙背后的本地局域网. 网络防火墙和主机防火墙并不冲 ...

  7. Linux防火墙状态查看以及端口设置

    目录 查看防火墙状态 开放某个端口 删除某个端口 查看端口号 查看防火墙状态 // 查看防火墙状态 firewall-cmd --state// 查看防火墙服务 systemctl status fi ...

  8. linux网卡操作命令 ,查看Linux下网卡连接状态(up还是down)?

    调整网卡工作模式 mii-tool -v //查看网卡工作模式 mii-tool -F 100baseTx-FD eth0 //将eth0改为100M,全双工工作模式 mii-tool -r eth0 ...

  9. Linux系统状态查看命令2

    2019独角兽企业重金招聘Python工程师标准>>> 10月24日任务 10.6 监控io性能 10.7 free命令 10.8 ps命令 10.9 查看网络状态 10.10 li ...

  10. centos打开指定端口(443),Linux防火墙状态查看的方法

    1.防火墙基本操作 #查看防火墙是否开启(如果显示running,则防火墙为开启状态): firewall-cmd --state#关闭防火墙: systemctl stop firewalld.se ...

最新文章

  1. python第三方模块—psutil模块
  2. .NetCore获取Json和Xml格式的配置信息
  3. 大学计算机基础 课程的说课,大学计算机基础资料说课稿.ppt
  4. java后ping不是内部_ping不是内部或外部命令,也不是可运行的程序解决方案
  5. SpringMVC的数据响应-回写数据-返回对象或集合(应用)
  6. [react] 组件卸载前,加在DOM元素的监听事件和定时器要不要手动清除?为什么?
  7. foreach的 多种用法
  8. 如何看当前windows是utf8还是gbk_职场中的OKR如何“好好说话”
  9. WebStorm配置github
  10. 使用Adobe Acrobat提取PDF签章图片
  11. 6. memcache 机制的了解
  12. POJ2109-Power of Cryptography
  13. Person Re-identification by Local Maximal Occurrence Representation and Metric Learning(LOMO+XQDA)
  14. java读写word模板_Java操作Word模板插入列表
  15. 一文带你深入浅出C语言运算符、表达式和语句
  16. h5 vue利用canvas实现手机签名并且可旋转功能
  17. 连接到另外计算机要用户名,连接局域网电脑需要用户名密码
  18. html中表格边框好看的样式,table完美css样式 table表格边框样式
  19. clear 和evict
  20. Python利用PIL将png图像转jpg图像

热门文章

  1. 转载:关于Windows Boot Manager、Bootmgfw.efi、Bootx64.efi、bcdboot.exe 的详解..
  2. PLSQL 使用教程
  3. java基础-面向对象
  4. 反编译工具Depends---dll和exe反编译工具
  5. 数学魔鬼表达式——第一天
  6. 【输入法】五笔学习系列教程
  7. java socket.close_java – Socket.close()在Socket.connect()期间无效
  8. 500 G JAVA视频网盘分享(JEECG开源社区)
  9. php ssl证书安装,PHPWAMP如何开启SSL,Apache下如何安装ssl证书?配置ssl证书很简单...
  10. 服务器行业深度解析:服务器未来需求知多少