↓ Skip to main content
  1. Posts/

Wake on LAN Part 2 Linux

·
Rubén Infante Docio
Author
Rubén Infante Docio
Software engineer
Wake on LAN - This article is part of a series.
Part 2: This Article

In the previous entry how to configure the BIOS, the router and we got the data we will need throughout the process.

Now we will see how to perform the configuration of the operating system itself, in this case Linux.

Configure Operating System
#

  1. Configure the Operating System
    1. First we will install ethtool and configure the network interface so that the card is left on standby once the PC is turned off.

      sudo apt-get install ethtool
      sudo ethtool -s eth0 wol g
    2. Then we check that it has indeed been activated correctly by entering the command

      sudo ethtool eth0

      By getting something like

      Settings for eth0:
              Supported ports: [ TP ]
              Supported link modes:   10baseT/Half 10baseT/Full
                                      100baseT/Half 100baseT/Full
                                      1000baseT/Half 1000baseT/Full
              Supported pause frame use: No
              Supports auto-negotiation: Yes
              Advertised link modes:  10baseT/Half 10baseT/Full
                                      100baseT/Half 100baseT/Full
                                      1000baseT/Half 1000baseT/Full
              Advertised pause frame use: Symmetric
              Advertised auto-negotiation: Yes
              Speed: 100Mb/s
              Duplex: Full
              Port: Twisted Pair
              PHYAD: 1
              Transceiver: internal
              Auto-negotiation: on
              MDI-X: Unknown
             Supports Wake-on: g
              Wake-on: g
              Current message level: 0x000000ff (255)
                                     drv probe link timer ifdown ifup rx_err tx_err
              Link detected: yes

      We see in these two lines that it is activated

      Supports Wake-on: g
              Wake-on: g

Persistence:
#

  1. We open a terminal

  2. Using the following commands we download a script, grant it the necessary permissions and make it run on every boot.

    sudo wget rubeninfante.com/ARCHIVOSMIOS/wol.sh
    //Lo movemos a la carpeta de ejecución de scripts iniciales
    sudo mv wol.sh /etc/init.d
    //Le otorgamos los permisos
    sudo chmod 755 /etc/init.d/wol.sh
    //Le asignamos la propiedad
    //Podemos saber nuestro usuario utilizando el comando 'who'
    sudo chown TU_USUARIO:TU_USUARIO /etc/init.d/wol.sh
    // lo iniciamos como servicio a varios niveles gui command etc
    sudo update-rc.d wol.sh defaults
  3. We restart and check as explained above if it has been done correctly.

Wake on LAN - This article is part of a series.
Part 2: This Article

Related