博文背景

想知道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. 数据科学工具 Jupyter Notebook 教程(一)
  2. Tomcat server.xml配置文件介绍
  3. 环境监控告警系统之TIM即时消息推送部署
  4. 一个三行两列右列固定左列自适应宽度的CSS
  5. rhel5.5下安装awstats实现网站流量监控
  6. 训练效率低?GPU利用率上不去?快来看看别人家的tricks吧~
  7. java如何实现e的次方_Java开发如何更改MySQL数据库datadir目录之MySQL数据库索引实现...
  8. 利用BitLocker和VHD实现共享文件加密
  9. 解决IntelliJ IDEA在笔记本屏幕中部分界面显示不全被遮挡的问题
  10. 如何将Groovy中的文件读入字符串?
  11. three.js模板
  12. android 标题名字,说说 Android 的 Material Design 设计(五)——可折叠式标题栏
  13. ucinet计算聚类系数大于1怎么办_ucinet软件解释对照
  14. 矩阵特征值的求解例子
  15. 安装docker环境报错:Could not resolve host
  16. 互联网黑暗森林法则:想活?别喘气儿!
  17. UVA - 10041 Vito's Family
  18. 面试积累-MySQL-MySQL中varchar与char的区别以及varchar(50)中的50代表的涵义?
  19. 开博尔android播放器,双核ANDROID网络播放器-开博尔C9-开箱 + 评测
  20. 【面试题】大数据方向

热门文章

  1. Unable to start LiveReload server
  2. 如何快速学习SAP系统软件?
  3. Spring框架与J2EE框架
  4. 火山PC模拟鼠标操作
  5. Ubuntu以及CentOS7修改ssh端口号详细步骤
  6. Java实现首字母转大写、小写StringUtils.capitalize
  7. H5小游戏框架总结推荐
  8. 怎样更改计算机ip,怎么快速修改电脑ip地址
  9. 智能计算之蚁群算法(ACO)介绍
  10. 明解C语言(第3版)入门篇-【部分】第五章练习题解(练习5-9至5-12)