17

I would like to understand what is meant by an network interface up? Because ip addr or ifconfig command shows an interface as up even when there is no IP associated with it.

for example on RHEL7 :

[root@IDCDVAM887 ~]# ifconfig ens256
ens256: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether 00:50:56:9e:19:5b  txqueuelen 1000  (Ethernet)
        RX packets 229406  bytes 59265584 (56.5 MiB)
        RX errors 0  dropped 229454  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

(or)

[root@IDCDVAM887 ~]# ip addr show ens256
5: ens256: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 00:50:56:9e:19:5b brd ff:ff:ff:ff:ff:ff

What is the real use of showing as UP when the interface doesn't have IP at all? I believe when there is no IP, there could be no communication on that? Then what is the use of it?

1
  • 1
    Ethernet frames can do more than just contain IP packets.
    – casey
    Commented Sep 1, 2014 at 12:10

4 Answers 4

20

The LOWER_UP is the state of the Ethernet link (or other link layer protocol). It's defined as Driver signals L1 up, which basically means the cable is fitted and it can see another device on the other end of the cable.

The UP means that it has been enabled. This can be controlled by you (or a script) using the ip link set <device> up of ifconfig <device> up command.

There are other protocols, such as IPX that use Ethernet, but will not have an IP address as they are not part of the Internet Protocol stack. So it is perfectly acceptable for the link to be UP but not have an IP address.

7
  • DHCP is actually built on top of UDP broadcast, which requires an IP layer (in fact, it can be routed). Another example of historically used alternative to IP was NetBIOS (before being ported to NetBIOS over IPX/SPX and then as NetBIOS over TCP/IP)
    – pqnet
    Commented Sep 1, 2014 at 11:59
  • [root@IDCDVAM887 ~]# ip addr show eno33557248 3: eno33557248: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:50:56:9e:68:86 brd ff:ff:ff:ff:ff:ff inet 10.54.2.7/32 scope global eno33557248:1 valid_lft forever preferred_lft forever In the above format there is a virtual interface 'eno33557248:1' with some IP. Why it has not shown UP as separately ? Is it enough to show only the original interface as UP ? Commented Sep 1, 2014 at 12:07
  • @pqnet - I was trying to expalin that the "no IP, no communication" part of the OP's question isn't true. Maybe it wasn't the best example then! I'll remove it as it'll only cause confusion. Commented Sep 1, 2014 at 12:08
  • That part now I understood thank you both..!!! Commented Sep 1, 2014 at 12:11
  • ip addr command out in RHEL7 for a interface that has configured multiple virtual interface or alias causing lot of confusion as how to find whether it is up or not Commented Sep 1, 2014 at 12:12
7

The UP status is the administrative state of the interface, i.e. whether the interface has been enabled. You can enable any interface using e.g.

ip l s eth0 up

If the cable is plugged in and a link is established, the interface will also get the operational state of RUNNING.

Many cards will inhibit outgoing carrier generation if the administrative state is not UP, and an interface that is not UP cannot be RUNNING either, so if I set

ip l s eth0 down

I'd expect my local interface to lose both UP and RUNNING, and the corresponding interface on the remote side would also no longer be RUNNING (but still UP, so if I enable my side again, I'd get a link).

That is just the Ethernet link though. On top of the link, various protocols can be bound, one of them being IPv4. By default, IPv4 is bound to all interfaces that support the protocol family.

When the protocol is bound, I can send and receive packets with any address assigned to the interface. If no address is assigned, this simply means that there is no valid address that can be used for outgoing packets (so sending a packet fails), nor any unicast address an incoming packet can be addressed to that the system would recognize as local (so only broadcast/multicast packets can be received).

This does not concern the link layer in the slightest, as it will only establish a link.

Certain programs, such as the DHCP client, have special permission to send arbitrarily formatted packets, filling in a fantasy source address or 0.0.0.0, and to receive arriving packets regardless of whether they are destined for the local machine. This is used during automatic IP address configuration, where the DHCP request is sent using a source address of 0.0.0.0, and the reply from the server is addressed to the broadcast address 255.255.255.255.

Thus, there is a valid use case where IP packets are exchanged even without an address bound to the interface.

In addition to IPv4, there is also IPv6, IPX, AppleTalk, etc., which can all share the same physical layer. As soon as the link is established, any of these higher-level protocols can use its own activation sequence to get into an operational state.

2
  • >> an interface that is not UP cannot be RUNNING either <<. I think this may not be applicable for solaris x86 machines where interface shows running even when status is not 'UP'. For example 1. Plumb a new virtual interface. root@IDCDVAM890:~# ifconfig net0:2 plumb 2. Check the interface status. RUNNING but no IP is assigned. root@IDCDVAM890:~# ifconfig net0:2 net0:2: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 0.0.0.0 netmask 0 Commented Jul 12, 2016 at 4:48
  • @SrikanthGanesan, you don't need an IP address to have the interface in UP or RUNNING state, in fact the interface needs to be UP and RUNNING for DHCP to work. It seems that Solaris inherits the RUNNING state of virtual interfaces from the parent, but keeps a separate UP state. That is somewhat irregular, it might be interesting to see whether the SNMP agent they ship corrects this in the external view. Commented Jul 12, 2016 at 9:44
5

An interface can be "up" even without any address or cable. The "up" status refers to whether the device is enabled or not by the operating system.

RUNNING or LOWER_UP refers instead to data link layer (also known as layer 2), it means that you can send and receive ethernet packets. IP is something built on top of it.

An example of configuration in which an interface is up but does not have an IP (and it shouldn't be assigned one) is when the interface is a bridge slave.

2
  • Isn't this what LOWER_UP means?
    – DrP3pp3r
    Commented Oct 27, 2020 at 17:03
  • 1
    @DrP3pp3r you are right, than should be LOWER_UP or RUNNING depending on which tool you use
    – pqnet
    Commented Oct 28, 2020 at 12:32
2

magically, if you specify -4 option or -oneline, then it will really show "running" interface as you imagined.

To make it easier to read, I used -brief option but it does not matter the conclusion.

see the result of up option, it still show a DOWN device.

ubuntu@ubuntu:~$ ip -brief address show up
lo               UNKNOWN        127.0.0.1/8 ::1/128
eno1             DOWN
enp130s0f0       UP             100.79.223.150/26 fe80::a9e:1ff:fed9:2864/64

see the result of -4 option, all with addresses, no DOWN devices.

ubuntu@ubuntu:~$ ip -4 -brief address show
lo               UNKNOWN        127.0.0.1/8
enp130s0f0       UP             100.79.223.150/26

see the result of -online option, all with addresses, no DOWN devices, but split addresses into IPv4 and IPv6.

ubuntu@ubuntu:~$ ip -oneline address show
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
1: lo    inet6 ::1/128 scope host \       valid_lft forever preferred_lft forever
4: enp130s0f0    inet 100.79.223.150/26 brd 100.79.223.191 scope global enp130s0f0\       valid_lft forever preferred_lft forever
4: enp130s0f0    inet6 fe80::a9e:1ff:fed9:2864/64 scope link \       valid_lft forever preferred_lft forever

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .