Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Renaming network interfaces on the Raspberry Pi [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1744

PostPosted: Fri Feb 19, 2021 11:58 am    Post subject: Renaming network interfaces on the Raspberry Pi [solved] Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54586
Location: 56N 3W

PostPosted: Fri Feb 19, 2021 12:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1744

PostPosted: Sat Feb 20, 2021 2:32 pm    Post subject: Reply with quote

Found it (actually made a guess, and it worked):

Code:

ACTION=="add", KERNELS=="fd580000.ethernet", SUBSYSTEM=="net", NAME="net0"
Back to top
View user's profile Send private message
ShorTie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2006
Posts: 101

PostPosted: Tue Feb 23, 2021 11:17 am    Post subject: Reply with quote

I do believe there is a command line option for this.
Part of udev I think.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum