Wake on lan on linux mint

Wake on lan on linux mint

Доброго времени суток!
Собственно проблема в том что на linux mint 19.1 всё работало нормально, но после обновления на 19.3 перестало работать. Даже через веб морду на роуторе.

sam@sam-B250M-D2V:~$ inxi -Fxz System: Host: sam-B250M-D2V Kernel: 5.3.0-53-generic x86_64 bits: 64 compiler: gcc v: 7.5.0 Desktop: Cinnamon 4.4.8 Distro: Linux Mint 19.3 Tricia base: Ubuntu 18.04 bionic Machine: Type: Desktop System: Gigabyte product: B250M-D2V v: N/A serial: Mobo: Gigabyte model: B250M-D2V-CF v: x.x serial: UEFI [Legacy]: American Megatrends v: F6 date: 07/06/2017 CPU: Topology: Dual Core model: Intel Core i3-7300 bits: 64 type: MT MCP arch: Kaby Lake rev: 9 L2 cache: 4096 KiB flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 31999 Speed: 800 MHz min/max: 800/4000 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 Graphics: Device-1: Intel HD Graphics 630 vendor: Gigabyte driver: i915 v: kernel bus ID: 00:02.0 Display: x11 server: X.Org 1.19.6 driver: modesetting unloaded: fbdev,vesa resolution: 1920x1080~60Hz OpenGL: renderer: Mesa DRI Intel HD Graphics 630 (Kaby Lake GT2) v: 4.5 Mesa 19.2.8 direct render: Yes Audio: Device-1: Intel 200 Series PCH HD Audio vendor: Gigabyte driver: snd_hda_intel v: kernel bus ID: 00:1f.3 Sound Server: ALSA v: k5.3.0-53-generic Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: r8169 v: kernel port: e000 bus ID: 02:00.0 IF: enp2s0 state: up speed: 100 Mbps duplex: full mac: Drives: Local Storage: total: 1.82 TiB used: 1.11 TiB (60.9%) ID-1: /dev/sda vendor: Western Digital model: WD1005FBYZ-01YCBB2 size: 931.51 GiB ID-2: /dev/sdb type: USB model: Mass Storage Device size: 931.51 GiB Partition: ID-1: / size: 48.97 GiB used: 24.04 GiB (49.1%) fs: ext4 dev: /dev/sda3 ID-2: /home size: 339.16 GiB used: 153.22 GiB (45.2%) fs: ext4 dev: /dev/sda4 Sensors: System Temperatures: cpu: 37.0 C mobo: N/A Fan Speeds (RPM): N/A Info: Processes: 227 Uptime: 27m Memory: 7.67 GiB used: 1.59 GiB (20.7%) Init: systemd runlevel: 5 Compilers: gcc: 7.5.0 Shell: bash v: 4.4.20 inxi: 3.0.32 
sudo echo "up /sbin/ethtool -s $(echo $(ifconfig | head -n1 | sed 's/:.*//g')) wol g;" >> /etc/network/interfaces 

и крестика нет и запускается через роутер.
Ждем 20ку с её новыми косяками

Читайте также:  Linux удаленное изменение файла

Всем спасибо за участие! и главное за быстрый отклик

Источник

How to enable Wake On LAN (WOL) on ASRock motherboard in Linux Mint

Wake on LAN (WOL) is a technology which allows to boot a computer from the network interface. A «magic packet» is sent from another machine in the same network (broadcast range) and is received by the connected network card (NIC). Even if the computer is powered down, the NIC is still able to receive network packets — if enabled in the BIOS/UEFI.

This article shows how to enable Wake on LAN on a ASRock motherboard. More precisely on a ASRock B550M Pro4, but the same procedure should apply to most ASRock motherboards.

Enable Wake on LAN in UEFI BIOS

First boot into the motherboards BIOS/UEFI Setup. This can be done by pressing F2 or DEL during early boot phase.

Press F2 or DEL to enter UEFI Setup

Once in UEFI, select «Advanced«, then open the «ACPI Configuration«:

Advanced settings in ASRock UEFI

The Wake on LAN relevant setting is called «PCIE Devices Power On«, which may sound confusing but that’s actually the setting responsible to enable WoL:

Enable Wake on LAN in ASRock UEFI

Once you’ve set «PCIE Devices Power On» to enabled, save the settings and exit UEFI.

Enable Wake on LAN in Linux

But that’s not enough (yet) to accept Wake on LAN magic packets. The network card also needs to be told that it should listen to magic packets. In Linux this can be achieved with the ethtool command.

The full output of ethtool run against the network interface (here enp3s0) shows the card’s capabilities:

Читайте также:  Edit registry windows from linux

ckadm@mintp ~ $ sudo 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
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pumbg
Wake-on: d
Link detected: yes

To see the Wake on LAN specific settings, use:

ckadm@mintp ~ $ sudo ethtool enp3s0 | grep Wake
Supports Wake-on: pumbg
Wake-on: d

This shows what kind of Wake-on options this card supports: «pumbg». However right now the current setting (Wake-on) is set to d (disabled).

To enable Wake-on on this card, set the option to «g» (Wake on MagicPacket):

ckadm@mintp ~ $ sudo ethtool -s enp3s0 wol g

Verify that the setting was saved:

ckadm@mintp ~ $ sudo ethtool enp3s0 | grep Wake
Supports Wake-on: pumbg
Wake-on: g

Now run the command ip a and note down the physical (MAC) address of the card:

ckadm@mintp ~ $ ip a | grep ether
link/ether 70:85:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

Send a Wake on LAN magic packet

Any other computer (or even mobile phone) in the same network can now send such a magic packet to wake up and start up the computer.

From another Linux machine you can use the wakeonlan command by using the MAC address noted down before:

Читайте также:  Как проверить версию linux mint

ck@anothermachine ~ $ sudo apt-get install wakeonlan
ckadm@mintp ~ $ wakeonlan 70:85:xx:xx:xx:xx

Voilà, your machine should now boot up. At least mine did.

You can of course also use a graphical tool or an app to send a WOL magic packet. Personally I am using the WolOn app on Android when connected to the same network as my Linux machine:

WolOn Android app to send wake on lan magic packet in same network

NIC config is reset after boot

Note that the Wake-On setting is most likely reset after a reboot. You could add the ethtool command above into /etc/rc.local to execute this command during start time. Note that in newer versions rc.local is by default disabled. See /etc/rc.local does not exist anymore, does it still work? for more information.

Another way is to add this into the network configuration, e.g. /etc/network/interfaces as «up» command. But Linux Mint uses /etc/NetworkManager by default.

The easiest way is to search for «Network» in the Linux Mint search, then select «Advanced Network Configuration«.

Network options in Linux Mint

Then select and edit your primary network connection using the physical network card, probably named (by default) «Wired connection 1»:

Configure network adapter in Linux Mint

Disable the «Default» option and instead select the «Magic» option.

This will create or modify the config file under /etc/NetworkManager. Or you can skip the configuration in the GUI and manually add the wake-on-lan setting into the relevant Network Manager config file in the [ethernet] section:

ck@mintp ~ $ sudo cat /etc/NetworkManager/system-connections/Wired\ connection\ 1.nmconnection
[connection]
id=Wired connection 1
uuid=bf56942c-7006-3ae9-815f-aa399255d043
type=ethernet
autoconnect-priority=-999
interface-name=enp3s0
permissions=
timestamp=1651036665

[ethernet]

mac-address-blacklist=
wake-on-lan=64

The value «64» represents the MagicPacket configuration.

The next time, «Wired Connection 1» is (re-) connected, the Wake-on option will be set on the network interface.

Источник

Оцените статью
Adblock
detector