original: https://gist.github.com/sghael/6cba5c75a36ed271fa959c35e516e516
-
Check for Active Connections:
- Use
nmclito list active connections and identify the correct connection name:nmcli connection show
- Use
-
Edit the Connection Profile via nmcli:
-
If you cannot find the
.nmconnectionfile directly in/etc/NetworkManager/system-connections/, you can usenmclito modify the connection settings:sudo nmcli connection modify "your-connection-name" 802-3-ethernet.wake-on-lan magic -
Replace
"your-connection-name"with the actual name of your connection as listed by thenmcli connection showcommand.
-
-
Apply Changes:
- After modifying the connection, restart NetworkManager to apply the changes:
sudo systemctl restart NetworkManager
- After modifying the connection, restart NetworkManager to apply the changes:
-
Verify the Setting:
-
Confirm that the changes have been applied by checking the connection settings:
nmcli connection show "your-connection-name" | grep 802-3-ethernet.wake-on-lan
-
You should see the setting
802-3-ethernet.wake-on-lan: magicif it has been applied successfully.
-
By using nmcli, you can manage network connections directly through the command line without needing to manually edit configuration files. This approach ensures that your settings are correctly applied even if the configuration files are not easily accessible or do not exist as expected.