Today i was playing with network interfaces on a embedded system and i have to rename some enp2s* interface to the conventional eth1 or similar.
Yes, i could have used the net.ifnames=0 options in /etc/default/grub, but, in that way, the naming will not be deterministic.
So i discovered the easiest way to rename a network interface:
Editing the file
/etc/network/interfaces and adding the line:
That’s all! Now reboot your system or just restart the networking service.
The one more thing about this scenario is that this method could coexist with NetworkManager too!
P.S. If you have NetworkManager running, you may need to stop it before restarting the networking service. Or, i repeat, just reboot your system 🙂