Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udev rule not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
s16
n00b
n00b


Joined: 07 Jan 2014
Posts: 1

PostPosted: Tue Jan 07, 2014 11:45 pm    Post subject: udev rule not working Reply with quote

Hi guys, I have a little problem with writing udev rules to rename network interface(s).

Some boring data:

Code:
genbox ~ # udevadm test-builtin net_id /sys/class/net/eth1/
calling: test-builtin
=== trie on-disk ===
tool version:          204
file size:         5601550 bytes
header size             80 bytes
strings            1255726 bytes
nodes              4345744 bytes
load module index
ID_NET_NAME_MAC=enx001e8c075a57
ID_OUI_FROM_DATABASE=ASUSTek COMPUTER INC.
ID_NET_NAME_PATH=enp3s4
unload module index


I created the file /etc/udev/rules.d/76-net-name-use-custom.rules as per the Gentoo Networking guide with the following content:

Code:
SUBSYSTEM=="net", ACTION=="add", ENV{ID_NET_NAME_PATH}=="enp3s4", NAME="foo"


This indeed gave me the interface foo on the next boot. So far so good. But sometimes I need to use a standalone GPU, and when I do the ID_NET_NAME_PATH moves up tp enp4s4 or something similar.

So I figured using ID_NET_NAME_PATH is not the way to go. I tried using ID_NET_NAME_MAC since it is available, like so:

Code:
SUBSYSTEM=="net", ACTION=="add", ENV{ID_NET_NAME_MAC}=="enx001e8c075a57", NAME="foo"


But the rule is simply ignored and I get eth1 instead. Any idea what could have gone wrong?
Back to top
View user's profile Send private message
Fitzcarraldo
Guru
Guru


Joined: 30 Aug 2008
Posts: 462
Location: United Kingdom

PostPosted: Wed Jan 08, 2014 10:33 pm    Post subject: Reply with quote

Haven't done it myself, but I remembered reading the following post which, if I understood correctly, explains how to do what you want (I think you're looking for his 'Option 2'?):

https://forums.gentoo.org/viewtopic-p-7282328.html#7282328
_________________
Fitzcarraldo's blog
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 2384

PostPosted: Wed Jan 08, 2014 10:56 pm    Post subject: Re: udev rule not working Reply with quote

s16 wrote:
But sometimes I need to use a standalone GPU, and when I do the ID_NET_NAME_PATH moves up tp enp4s4 or something similar.


Just to get a lick in, the "predictable, persistent net device names " are neither.
Not predictable because device enumeration will not be known until they are enumerated.
Not persistent, because changing anything about the plugged hardware can change the enumeration.

Actually, it's even less persistent than our old friends, eth0, eth1, etc, because those only changed when either a kernel code change changed the enumeration sequence (this happened to me once, probably 10 years ago.) or when you plug a new ethernet card in that gets enumerated before the existing one.

The only naming that could be predictable and persistent is based on the MAC. (The MAC is frequently printed somewhere on the package, for the "predictable" part of the claim.)
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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