You are not logged in.

#1 2015-02-07 10:45:46

Immobile
Member
Registered: 2015-02-07
Posts: 8

[Solved] udev ethernet device naming/matching issues

Hi all,

I am trying to create a udev rule for my ethernet device to disable Wake on LAN at boot. The device name I find in /sys/class/net and the device name 'ethtool' recognises is eno1. However, udev does not match my rule to eno1. I saw some messages in journalctl from 6 months ago about systemd-udevd renaming device "eth0" to "eno1" (I don't see them anymore), so I tried setting

 KERNEL=="eth0" 

in my rule instead. udev now manages to match the rule to my ethernet device. I would like to know:

a) if this is a bug of some sort - was I expected to refer to the device in the rule as 'eth0'? I presume there is still a udev rule somewhere that renames my device from eth0 to eno1 (which isn't logged in journalctl anymore), but my rule is named "99-disable_wol.rules", so it should be run after all the other network rules right?

b) I had

 RUN+="/usr/bin/ethtool -s %k wol d" 

in the rule earlier. Since the KERNEL parameter is now different from the device name ethtool expects (it expects eno1), am I expected to hardcode the rule as

 RUN+="usr/bin/ethtool -s eno1 wol d" 

instead?

Thanks!

Last edited by Immobile (2015-02-09 14:08:15)

Offline

#2 2015-02-07 11:55:07

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [Solved] udev ethernet device naming/matching issues

I had a problem with WOL enabled after boot last year and the solution I came to is detailed in the thread at https://bbs.archlinux.org/viewtopic.php?id=180496

Maybe that helps?


Mike C

Offline

#3 2015-02-08 10:45:10

Immobile
Member
Registered: 2015-02-07
Posts: 8

Re: [Solved] udev ethernet device naming/matching issues

I actually have sort of the opposite problem - my BIOS setup doesn't have any options to disable or enable WOL (I'm on an HP laptop). I'm having problems understanding what is going wrong with my udev rules - I'm fairly sure I'll be able to fix the problem myself once I can get back to my laptop - I only have to play around a few times with swapping eth0 and eno1 around, but I still don't understand why this is happening.

Offline

#4 2015-02-08 13:11:22

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [Solved] udev ethernet device naming/matching issues

I seem to remember that I tried what you did by replacing the "eth*" in

ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*", RUN+="/usr/bin/ethtool -s %k wol d"

with the name of my interface and that didn't work!  So even though my interface is named according to the new naming convention it was still necessary to put the KERNEL== parameter as "eth*"! It was not clear to me that changing the "*" helped either! However with the line as I quoted above my system does actually behave as I want it to.  I am not familiar with HP laptops but when I was looking into this issue it did seem that the BIOS settings for the default for whether WOL is off or on is buggy on a number of different laptops of various brands, even when there is no BIOS switch available to change the default!  Perhaps there is a posting somewhere that appeared since last year where the way this all works is explained in more detail, but I found it not very easy to get the information I needed to get my laptop to behave in a satisfactory way.

I don't know if this adds useful additional info: https://wiki.archlinux.org/index.php/Po … interfaces

I note from that link that you are supposed to have this rule apply before 80 and your rule was called  "99-disable_wol.rules" which might be the problem?  Renaming it  "70-disable_wol.rules" may help? However in my system in /usr/lib/udev/rules.d/ the file named in the wiki is not present! However getting the number prefix right may be important.

Last edited by mcloaked (2015-02-08 13:25:27)


Mike C

Offline

#5 2015-02-09 14:07:44

Immobile
Member
Registered: 2015-02-07
Posts: 8

Re: [Solved] udev ethernet device naming/matching issues

Thank you! That explains quite a bit. I did not see that line in the wiki when I last checked (quite a while ago). My rule is probably matched to eth0 after 80-net-name... but by the time udev runs the WOL command, the interface has probably been renamed to eno1, which is why the command fails. I will rename my rule to 70.

Offline

Board footer

Powered by FluxBB