8

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?

  • 4
    This is normal, if you have no containers running on that network. It will change when you start a container. Also ifconfig is 10 years obsolete, often displays wrong information, and should not be used anymore. – Michael Hampton May 20 at 19:21
  • @MichaelHampton Please don't answer the questions in the comment section. You can read about your commenting privileges here. Note that this information is also presented to you when you try to write a comment: Avoid answering questions in comments. Please be mindful that as a diamond moderator you set an example to other users. – pipe May 21 at 8:03
  • 2
    @pipe This comment does not suffice as an answer, which is why it is a comment. If you have further concerns, feel free to post on meta. – Michael Hampton May 21 at 8:19
18

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.