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 revision | ||
| doc:appunti:linux:sa:if_rename [2023/12/15 10:23] – niccolo | doc:appunti:linux:sa:if_rename [2024/06/21 17:54] (current) – [Beware of initramfs image] niccolo | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== With Debian 10 Buster ===== | ===== With Debian 10 Buster ===== | ||
| - | According some sources, there is at least two methods | + | How to rename a network interface |
| - | + | ||
| - | **WARNING**: | + | |
| - | + | ||
| - | < | + | |
| - | rename enx00e04c885302=lan0 | + | |
| - | </ | + | |
| - | + | ||
| - | Another methos should be to create a file **/ | + | |
| < | < | ||
| Line 21: | Line 13: | ||
| </ | </ | ||
| - | The systemd method has a problem if you need to create a **VLAN**. When the system creates e.g. the **lan.602**, its MAC address matches the systemd snippet, so systemd tries to assign to it the name **lan** but the name already | + | **WARNING**: You cannot use this method to safely assign |
| - | 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: | + | **WARNING**: |
| + | |||
| + | A workaround can be the following: tell the kernel to use the old '' | ||
| < | < | ||
| Line 32: | Line 26: | ||
| Name=lan0 | Name=lan0 | ||
| </ | </ | ||
| + | |||
| + | ==== Beware of initramfs image ==== | ||
| + | |||
| + | :!: If you have some files in **/ | ||
| + | |||
| + | These files are considered by '' | ||
| + | |||
| + | So it is always advisable to **update the initramfs** whenever you update the content of **/ | ||
| + | |||
| + | < | ||
| + | update-initramfs -k all -u | ||
| + | </ | ||
| + | |||
| + | === How to unpack the iniramfs image to inspect its content === | ||
| + | |||
| + | In **Debian 12** the iniramfs image may be composed by two appended cpio archives. The first containing the Intel microcode in //ASCII cpio archive// format, and the second containing the actual initramfs as a //Zstandard compressed cpio archive//. To extract both, do the following: | ||
| + | |||
| + | Extract **the microcode part** (take note of the number of blocks printed on stderr): | ||
| + | |||
| + | < | ||
| + | cat / | ||
| + | 14080 blocks | ||
| + | </ | ||
| + | |||
| + | Make a copy of **the initramfs part** stripping the microcode and decompress it: | ||
| + | |||
| + | < | ||
| + | dd if=/ | ||
| + | unzstd initramfs.img.zst --stdout | cpio --extract --make-directories | ||
| + | </ | ||
| ==== NetworkManager interfering with rename ==== | ==== NetworkManager interfering with rename ==== | ||
| Line 126: | Line 150: | ||
| </ | </ | ||
| - | **ATTENZIONE**: | + | :!: **ATTENZIONE**: |
| + | |||
| + | :!: **ATTENZIONE**: | ||
| ===== Debian 9 Network Interface Naming ===== | ===== Debian 9 Network Interface Naming ===== | ||
doc/appunti/linux/sa/if_rename.1702632208.txt.gz · Last modified: by niccolo
