Linux – Listen for wakeonlan request

linuxwake-on-lan

I would like to know how to listen for wakeonlan paquets on a running system.
I know that my question if a little bit useless, because if a system is running, there is no need to wake up it!

Best Answer

  • With nc you can listen on an udp port. The magic packet usually is sent to port 9 via broadcast. So, the command would be:

    nc -ul 9
    

    Depending on the nc implementation, you may also need to provide the -p flag:

    nc -ul -p 9
    

    To test it use the wakeonlan command...

    wakeonlan <your-mac>
    

    ...and see in the nc terminal the output.