As mentioned here since Ubutnu 15.10 there are some different naming schemes for network interfaces supported:
- Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1)
- Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1)
- Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0)
- Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
- Classic, unpredictable kernel-native ethX naming (example: eth0) - depreciated
I am writing a script that takes interface name with grep:
if_name=$(ls /sys/class/net | grep "en")
and then changes it to eth. I've tested script on a few machines and it was fine, but is there a chance that interface name now can start from another letters and my command above won't work? And if so, are there any better alternatives?