ip链接和ip addr输出含义


15

我正在寻找一个解释,这些命令ip link和输出ip addr在Linux机器上的确切含义是什么。

# ip link
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
link/ether 00:a1:ba:51:4c:11 brd ff:ff:ff:ff:ff:ff
4: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
link/ether 00:a1:ba:51:4c:12 brd ff:ff:ff:ff:ff:ff

LOWER_UPNO-CARRIER和其他标志到底是什么?我在http://download.vikis.lt/doc/iproute-doc-2.6.32/ip-cref.ps上找到了参考,但是它不包含完整的信息,并且手册页不够详细。


看起来swlx01.hs-esslingen.de关闭,因此无法访问链接的参考:-(
Attila Csipak

1
断开的链接已更新。但是,答案中引用的手册页是更好的信息来源。
Zaboj Campula

Answers:


19

这些是接口的标志。它们记录在netdevice(7)手册页中。以下是相关部分(按字母顺序重新排列):

IFF_ALLMULTI      Receive all multicast packets.
IFF_AUTOMEDIA     Auto media selection active.
IFF_BROADCAST     Valid broadcast address set.
IFF_DEBUG         Internal debugging flag.
IFF_DORMANT       Driver signals dormant (since Linux 2.6.17)
IFF_DYNAMIC       The addresses are lost when the interface goes down.
IFF_ECHO          Echo sent packets (since Linux 2.6.25)
IFF_LOOPBACK      Interface is a loopback interface.
IFF_LOWER_UP      Driver signals L1 up (since Linux 2.6.17)
IFF_MASTER        Master of a load balancing bundle.
IFF_MULTICAST     Supports multicast
IFF_NOARP         No arp protocol, L2 destination address not set.
IFF_NOTRAILERS    Avoid use of trailers.
IFF_POINTOPOINT   Interface is a point-to-point link.
IFF_PORTSEL       Is able to select media type via ifmap.
IFF_PROMISC       Interface is in promiscuous mode. 
IFF_RUNNING       Resources allocated.
IFF_SLAVE         Slave of a load balancing bundle.
IFF_UP            Interface is running.

因此,这LOWER_UP意味着在物理级别存在信号(即,网络接口中插入了活动的信号)。NO-CARRIER恰恰相反:在物理级别上未检测到信号。


2
有趣的是如何NO-CARRIER中介绍netdevice(7)...
彼得五Mørch

3
这是因为这NO-CARRIER不是您可以获取或设置的实际标志。它定义为的组合IFF_UP and not IFF_RUNNING
xhienne
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.