View previous topic :: View next topic |
Author |
Message |
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1744
|
Posted: Fri Feb 19, 2021 11:58 am Post subject: Renaming network interfaces on the Raspberry Pi [solved] |
|
|
On my amd64 desktop machines, I have renamed all of the ethernet intefaces to net0 with a udev rule like this:
Code: |
ACTION=="add", KERNELS=="0000:00:20.0", SUBSYSTEM=="net", NAME="net0"
|
The identifier "0000:00:20.0" comes from /sys/devices/pci0000\:00/ (with lspci showing the correct device).
I would like to carry over this naming scheme on the Raspberry Pi. I searched for assigning a fixed name to a network interface, and found dozens of results, but they all assumed systemd, which I wont have.
Does anyone know a way to do this with a udev rule? Thank you in advance.
Last edited by curmudgeon on Sat Feb 20, 2021 2:30 pm; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54596 Location: 56N 3W
|
Posted: Fri Feb 19, 2021 12:24 pm Post subject: |
|
|
curmudgeon,
A long time ago udev used to name interfaces based on the MAC address.
That should still work.
A minor wrinkle on the Pi is that the MAC address is not fixed, so you may need no set the MAC address before you can set the interface name based on it. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1744
|
Posted: Sat Feb 20, 2021 2:32 pm Post subject: |
|
|
Found it (actually made a guess, and it worked):
Code: |
ACTION=="add", KERNELS=="fd580000.ethernet", SUBSYSTEM=="net", NAME="net0"
|
|
|
Back to top |
|
|
ShorTie Tux's lil' helper
Joined: 12 Feb 2006 Posts: 101
|
Posted: Tue Feb 23, 2021 11:17 am Post subject: |
|
|
I do believe there is a command line option for this.
Part of udev I think. |
|
Back to top |
|
|
|