# ethtool wont hold WOL settings

## neybis

So I have done some investigating of my own and found the issue to be X related (possibly due to it stopping/starting/restarting the network devices) but still need help. I have read that in order to get ethtool to work properly you must add it to local.start and/or local.stop (but preferably local.start as settings should hold in case of improper shutdown). I also read that if the network devices are stopped and brought back up that ethtool settings will not hold (although if i /etc/conf.d/eth0 stop then /etc/conf.d/eth0 start the settings do in fact seem to hold).

I have tried adding the command '/usr/sbin/ethtool -s eth0 wol bg' to /etc/conf.d/local.start, and /etc/conf.d/local.stop with no avail once X has started. However, all I must do to get the setting to hold is run one of any of these scripts once my session is up.

To elaborate, follow me along these steps:

1) login to my main account and 'sudo ethtool eth0'. Sure enough, I get 'Wake-on: bg' (as I added the appropriate command to local.start).

2) run 'startx'

3) open a terminal and 'sudo ethtool eth0'. The setting at this point has been lost (i.e. 'Wake-on: g').

4) run 'sudo /etc/init.d/local stop'

5) run 'sudo /etc/init.d/local start' and the ethtool wol command is executed properly (i.e. 'sudo ethtool eth0' now yields 'Wake-on: bg'...)

It does not matter what setting I try to set wol to (i.e. d for disabled or bg for broadcast and magic packet...immediately after X is started 'ethtool eth0' always yields 'Wake-on: g')

Can anyone help me out with this? Whats going on and why is X not playing nice with ethtool  :Razz: 

----------

## palettentreter

Do you use NetworkManager? It does all kinds of funny things to your network interfaces. If you want a clean solution that deals with bringing the interface up/down, you have to run your ethtool command from a udev rule. Look into /etc/udev/rules.d and read udev(7) to learn how to do that.

Edit: I see they've moved the default rules to /lib/udev/rules.d, so look there for some examples.

----------

