5

The default output of the ifconfig command on GNU+LINUX displays only active and up network interfaces while the default output of the ip address command (which can be shortened as ip a ) shows all network interfaces including inactive and down interfaces.

What is the ip address command equivalent to show only active and up network interfaces like the default output of the ifconfig command?

0

2 Answers 2

8

ip address shows all IPv4 (inet), IPv6 (inet6), and link-level (like link/ether for ethernet interfaces) addresses by default, while ifconfig without -a only shows the interfaces that are up along with their addresses (also all of IPv4, IPv6 and some link-level ones, and with a different list of extra information).

You can also tell ip address (short for ip address show) to exclude interfaces that are not up by doing:

ip address show up

(or ip a s up for short).

You can limit to IPv4 addresses with -4 (and IPv6 with -6).

And add statistics like ifconfig does by default with the -s option.

So ip -s a s up would give you the same kind of information as ifconfig does. Remove the up for ifconfig -a.

See man ip address (man ip-address) for details.

3

The command is ip address show up which lists only running interfaces.

You must log in to answer this question.

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