doc:appunti:linux:sa:if_rename
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
doc:appunti:linux:sa:if_rename [2007/05/17 16:22] – external edit 127.0.0.1 | doc:appunti:linux:sa:if_rename [2023/12/15 16:28] (current) – [With Debian 10 Buster] niccolo | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Renaming network interfaces ====== | ====== Renaming network interfaces ====== | ||
+ | |||
+ | ===== With Debian 10 Buster ===== | ||
+ | |||
+ | How to rename a network interface from e.g. **enx00e04c885302** to something more human like **lan0**? The preferred method is to create a file **/ | ||
+ | |||
+ | < | ||
+ | #/ | ||
+ | [Match] | ||
+ | MACAddress=00: | ||
+ | [Link] | ||
+ | Name=lan0 | ||
+ | </ | ||
+ | |||
+ | **WARNING**: | ||
+ | |||
+ | **WARNING**: | ||
+ | |||
+ | A workaround can be the following: tell the kernel to use the old '' | ||
+ | |||
+ | < | ||
+ | [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 59: | ||
- | ===== udev ===== | + | ==== udev ==== |
In a Debian Etch box, check the **''/ | In a Debian Etch box, check the **''/ | ||
Line 24: | Line 75: | ||
</ | </ | ||
- | ===== ifrename | + | ==== ifrename ==== |
You configure this userspace program writing the configuration file'' | You configure this userspace program writing the configuration file'' | ||
Line 38: | Line 89: | ||
The good thing of this program is that you can select intefaces by the name of the kernel module, by MAC address, by bus position and other methods. But beware that the standard Debian startup of '' | The good thing of this program is that you can select intefaces by the name of the kernel module, by MAC address, by bus position and other methods. But beware that the standard Debian startup of '' | ||
+ | |||
+ | ===== Debian 8 Jessie ===== | ||
+ | |||
+ | The udev cache file is named now **''/ | ||
+ | |||
+ | To force the creation of that file just execute the command: | ||
+ | |||
+ | < | ||
+ | udevadm trigger --action=add | ||
+ | </ | ||
+ | |||
+ | ===== Debian 9 predictable network interface names ===== | ||
+ | |||
+ | Esempio: **enp3s0f1** | ||
+ | |||
+ | * **en** Ethernet network card | ||
+ | * **p3** PCI bus #3 | ||
+ | * **s0** Slot #0 | ||
+ | * **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.1179411722.txt.gz · Last modified: 2015/11/20 16:19 (external edit)