Beginning in Systemd v197, network interfaces assigned by systemd/udev are "predicatble";
Names are now based on;
- Index numbers for on-board devices (eno1)
- PCI-ehotplug slot index numbers (ens1)
- Physical/geographical location of hardware connector (enp2s0)
- MAC address (enx78e7d1ea46da)
- Classic, unpredictable kernel-native naming (eth0)
Links;
- Predicatable Network Interface names
- udev-builtin-net_id.c @ freedesktop.org
- udev-builtin-net_id.c @ github.com/systemd
Two character prefixes based on the type of interface:
* en -- ethernet
* sl -- serial line IP (slip)
* wl -- wlan
* ww -- wwan
SO Answer: Find available network interfaces
ls /sys/class/net | grep -E "^e(m|n(o|p|s)|th)[0-9]|wl(an|p)"
find /sys/class/net ! -type d | xargs --max-args=1 realpath | awk -F\/ '/pci/{print $NF}'
ip r | grep " src "|cut -d " " -f 3,12 | xargs
ip addr show | awk '/inet.*brd/{print $NF}'
ip -o link show up | awk -F': ' '{print $2}'
ip -o -4 addr show
ip -o link ls up
lshw -class network
em1
eno1
enp0s31f6
enp0s29u1u2
enp2s0
enp2s0f1
enp5s0
enp7s0
ens1
enx78e7d1ea46da
eth0
p7p1
wlan0
wlp0s12f0
wlp3s0
wlp3s0b1
wlp19s0
wwp0s29u1u4i6