doc:appunti:linux:sa:if_rename
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:linux:sa:if_rename [2017/01/25 10:24] – [Debian 8 Jessie] niccolo | doc:appunti:linux:sa:if_rename [2023/07/27 16:03] – [Debian 9 predictable network interface names] niccolo | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Renaming network interfaces ====== | ====== Renaming network interfaces ====== | ||
+ | |||
+ | ===== With Debian 10 Buster ===== | ||
+ | |||
+ | According some sources, there is at least two methods to rename a network interface e.g. from **enx00e04c885302** to something more human like **lan0** or the plain old **eth0**. | ||
+ | |||
+ | The simplest method should be to add a line into **/ | ||
+ | |||
+ | < | ||
+ | rename enx00e04c885302=lan0 | ||
+ | </ | ||
+ | |||
+ | Another methos should be to create a file **/ | ||
+ | |||
+ | < | ||
+ | #/ | ||
+ | [Match] | ||
+ | MACAddress=00: | ||
+ | [Link] | ||
+ | Name=lan0 | ||
+ | </ | ||
+ | |||
+ | The systemd method has a problem if you need to create a **VLAN**. When the system creates e.g. the **lan.602**, | ||
+ | |||
+ | A workaround can be the following: tell the kernel to use the old eth0 schema (passing the **net.ifnames=0** option), then instruct systemd to act only on **%%eth*%%** network interfaces: | ||
+ | |||
+ | < | ||
+ | [Match] | ||
+ | MACAddress=00: | ||
+ | OriginalName=eth* | ||
+ | [Link] | ||
+ | Name=lan0 | ||
+ | </ | ||
+ | |||
+ | ==== NetworkManager interfering with rename ==== | ||
+ | |||
+ | Both methods seen above seem to work, unfortunately on my XFCE environment, | ||
+ | |||
+ | < | ||
+ | NetworkManager[581]: | ||
+ | | ||
+ | </ | ||
+ | |||
+ | If you want to **manage the interface using NetworkManager** from the user session, be sure that the interface is not referred by **/ | ||
+ | |||
+ | ==== Use the old naming schema (eth0, ...) ==== | ||
+ | |||
+ | If you want to use the old naming schema (eth0, eth1, ...) enable the kernel override option in **/ | ||
+ | |||
+ | < | ||
+ | GRUB_CMDLINE_LINUX=" | ||
+ | </ | ||
+ | |||
+ | Followed by **update-grub** and **reboot**. | ||
+ | |||
+ | Beware that by using that schema the card's assigned name depends upon the time when the kernel discover the interfaces, in some cases you may find the names swapped after a reboot, even if the Ethernet cards are fixed built-in. | ||
+ | |||
+ | ===== How it worked in the old days of Debian 4 Etch ===== | ||
In a modern Linux system, network interface drivers are compiled as modules. Generally there is a subsytem that provides loading kernel modules automatically. Debian GNU/Linux Etch uses '' | In a modern Linux system, network interface drivers are compiled as modules. Generally there is a subsytem that provides loading kernel modules automatically. Debian GNU/Linux Etch uses '' | ||
Line 8: | Line 65: | ||
- | ===== udev ===== | + | ==== udev ==== |
In a Debian Etch box, check the **''/ | In a Debian Etch box, check the **''/ | ||
Line 24: | Line 81: | ||
</ | </ | ||
- | ===== ifrename | + | ==== ifrename ==== |
You configure this userspace program writing the configuration file'' | You configure this userspace program writing the configuration file'' | ||
Line 57: | Line 114: | ||
* **s0** Slot #0 | * **s0** Slot #0 | ||
* **f1** Function #1 (eg. a dual porta LAN has two // | * **f1** Function #1 (eg. a dual porta LAN has two // | ||
+ | |||
+ | Per disabilitare questa funzione, chiamata **[[https:// | ||
+ | |||
+ | Se è installato la //helper utility// di udev chiamata **biosdevname**, | ||
+ | |||
+ | Avendo attivato l' | ||
+ | |||
+ | < | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | </ | ||
+ | |||
+ | **ATTENZIONE**: | ||
+ | |||
+ | ===== Debian 9 Network Interface Naming ===== | ||
+ | |||
+ | * **[[http:// | ||
+ | * **[[https:// | ||
+ |
doc/appunti/linux/sa/if_rename.txt · Last modified: 2024/06/21 17:54 by niccolo