wake on lan – wol – ubutnu

https://help.ubuntu.com/community/WakeOnLan

apt install ethtool

ethtool eth


root@home:/home# ethtool enp3s0
Settings for enp3s0:
	Supported ports: [ TP	 MII ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: Unknown!
	Duplex: Unknown! (255)
	Auto-negotiation: on
	master-slave cfg: preferred slave
	master-slave status: unknown
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: external
	MDI-X: Unknown
	Supports Wake-on: pumbg
	Wake-on: g
	Link detected: no
wol p|u|m|b|a|g|s|d...
                  Sets Wake-on-LAN options.  Not  all  devices  support  this.
                  The argument to this option is a string of characters speci‐
                  fying which options to enable.

                  p   Wake on PHY activity
                  u   Wake on unicast messages
                  m   Wake on multicast messages
                  b   Wake on broadcast messages
                  a   Wake on ARP
                  g   Wake on MagicPacket™
                  s   Enable SecureOn™ password for MagicPacket™
                  d   Disable (wake on  nothing).   This  option
                      clears all previous options.

wake command

apt install etherwake
etherwake MAC-ADDRESS

Disable USB power in ubuntu

  • find list of usb
lsusb

ls /sys/bus/usb/devices
  • disable USB on startup
echo disabled | sudo tee /sys/bus/usb/devices/usb2/power/wakeup
  • Remove power from port
echo suspend | sudo tee /sys/bus/usb/devices/usb2/power/level
  • add power to port again
echo auto | sudo tee /sys/bus/usb/devices/usb2/power/level

https://askubuntu.com/questions/1338682/is-it-possible-to-disable-usb-port-with-known-physical-location

Let me recap for Linux >= 2.6.38: The file power/level is deprecated now; use power/control instead. (power/wakeup is ok.)

https://stackoverflow.com/questions/4702216/controlling-a-usb-power-supply-on-off-with-linux

apt install powertop
powertop