13

I am looking at the state of an interface on a Linux system. When I use the ifconfig command it shows that the link is UP.

master $ ifconfig docker0
docker0   Link encap:Ethernet  HWaddr 02:42:b9:25:be:2d
          inet addr:172.18.0.1  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

However, when I run the ip link command , it is down.

master $ ip link show docker0
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
    link/ether 02:42:b9:25:be:2d brd ff:ff:ff:ff:ff:ff

Can someone please explain?

1 Answers1

21

In the ifconfig UP flag means the administrative status, not link status. If you have 'link up', then RUNNING flag is present in the ifconfig output. Anyway, ifconfig is deprecated, use the ip tool.

In the ip tool link status is shown by flags LOWER_UP and NO-CARRIER.