How can I find available network interfaces?
The simplest method I know to list all of your interfaces is
ifconfig -a
EDIT
If you're on a system where that has been made obsolete, you can use
ip link show
The kernel lists them by name in /sys
, both separately in (e.g.) the tree of PCI devices -- although finding them there if you don't know where they are to start with is not simple -- and together via symlinks in /sys/class/net
. E.g.:
> ls /sys/class/net
em1 lo wlp6so
Another example:
> ls /sys/class/net
lo p6s1 wlan0
If you are not sure which is which, you could just put them all up with either:
ifconfig [name] up
Or:
ip link set [name] up
And then look at the (fairly clear) clues listed by ifconfig
(with no arguments). The systemd source code linked from the Freedesktop.org document also refers to:
Two character prefixes based on the type of interface:
* en -- ethernet
* sl -- serial line IP (slip)
* wl -- wlan
* ww -- wwan
Although in one of the cases above (p6s1
) there is no prefix.
I always do cat /proc/net/dev
it's simple and easy to memorize