我正在寻找命令的输出到底是什么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_UP
、NO-CARRIER
和其他标志到底是什么?我在以下位置找到了参考http://download.vikis.lt/doc/iproute-doc-2.6.32/ip-cref.ps但它不包含完整的信息,手册页也不够详细。
答案1
这些是接口的标志。它们记录在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
,正好相反:在物理层面没有检测到信号。