Renaming network interfaces in Arch Linux

I recently performed a migration of one of my laptops from Debian a Arch Linux and when configuring things related to network interfaces I found that the new startup standard for systemd I had made a change to the device names that I used to see on those interfaces.

Starting with the usual process I put in a terminal (which by the way uses rxvt unicode with zsh as the default console) «IP addr»Obtaining the following:

Names of the Interfaces starting the renaming process

In this case we will configure the name of the network interface corresponding to the common cable with an RJ45 connector that we have at home to access the Internet. The first thing we see is that it takes by name enp0s4. This differs greatly from eth0 how much we have seen. What we will do is change the name of said interface to one that is more comfortable so to speak and that is easier for us to type in the console.

As a previous step we will type cat /sys/class/net/enp0s4/addres in the terminal to find out the MAC of the device. This will return a number of the type 000: 00: 00: 00: 00: 0 or simply copy the name of the MAC address that comes out with the command ip addr in the previous step. We must write it down because we will need it later.

After this we create an entry in the directory /etc/udev/rules.d/ in this way:

Directory name

A simple text file named 10-network-rules that will serve as a processor before the udev standard. It is noteworthy that we put sudo because we need access to a file that requires that permission to act.

Once open we type in it:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:90:f5:6e:83:57" NAME="internet"

staying this way in my case:

press the key combination CNTR + o to save the changes and CNTR + x to exit the editor (in this case I use nano but you can use whatever you want). Next, we restart the computer so that the changes take effect, obtaining after the reboot the following:

how are the interfaces after the modification

As you will see if we pay attention to the name of the interfaces, the one we have renamed appears with a manageable name that we can easily type.

I hope you find it useful and I invite you to comment and ask questions in the event of any concerns.

From now on I will be posting things like this ... greetings.


Add as preferred source in Google