LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-09-2017, 03:35 AM   #1
victorwang
Member
 
Registered: Aug 2017
Posts: 30

Rep: Reputation: Disabled
How to wake on lan with ping ?


Hi All,

I'm using Ubuntu 16.04 for my OS system with freescale CPU i.MX6 sabresd.

Previously, I could wake on lan with `wakeonlan -i [IP Address] [MAC Address]`.

But now I'm trying to wake on lan with `ping`.

Here is a picture that shows the environment.

https://imgur.com/goTFcBe

How can I do that?

Is that possible to do it with `ping`?

Last edited by victorwang; 11-09-2017 at 03:48 AM. Reason: Let question more specific
 
Old 11-09-2017, 04:05 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,655
Blog Entries: 3

Rep: Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901
You got a lot of replies in the other thread on this topic. Wake-on-LAN only works within the same LAN. There is no way around that. You can, however, set up scripts to automate entering the LAN and launching the WOL utility. So to be able to wake up a machine inside one LAN from outside, you'll need to have special access to the router or have a low-power machine on the inside

If your router is runnning GNU/Linux, FreeBSD, NetBSD, or OpenBSD, you can connect to it with SSH and launch the relevant WOL utility.

If the router is too weak for that, you might consider loading it with Lede, OpenWRT, or DD-WRT. Here is an option for Lede that lets you wake a computer:If the router is unsuitable for either of those options, set up a Raspberry Pi or something similar with SSH access and the WOL appropriate utility. Set up key access and make an extra key that only triggers Wake-on-LAN for the target machine. You'd do that by prepending command="" to the public key in ~/.ssh/authorized_keys

Code:
command="/usr/bin/wakeonlan 01:02:03:04:05:06" ssh-rsa AAAAB3NzaC1yc2EAAAAD....
When that is in place, turn of password authentication for SSH for that machine and then enable port forwarding on the router from some external port on the router to port 22 on your always-awake machine.

Edit:

Lede, OpenWRT, or DD-WRT would have to be on Router B to turn on Machine 2 from Machine 1

... or else ...

Machine 3 must be always-on and accessible via SSH from Router B

Code:
Machine 1                                    Machine 2
   |              .-,( ),-.                      |
   |           .-(         )-.                   |
Router A ---- (    Internet   ) ---- Router B ---+
               '-(         ).-'                  |
                  '--.( ).'                      |
                                             Machine 3

Last edited by Turbocapitalist; 11-09-2017 at 04:12 AM.
 
1 members found this post helpful.
Old 11-09-2017, 09:03 PM   #3
victorwang
Member
 
Registered: Aug 2017
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
You got a lot of replies in the other thread on this topic. Wake-on-LAN only works within the same LAN. There is no way around that. You can, however, set up scripts to automate entering the LAN and launching the WOL utility. So to be able to wake up a machine inside one LAN from outside, you'll need to have special access to the router or have a low-power machine on the inside

If your router is runnning GNU/Linux, FreeBSD, NetBSD, or OpenBSD, you can connect to it with SSH and launch the relevant WOL utility.

If the router is too weak for that, you might consider loading it with Lede, OpenWRT, or DD-WRT. Here is an option for Lede that lets you wake a computer:If the router is unsuitable for either of those options, set up a Raspberry Pi or something similar with SSH access and the WOL appropriate utility. Set up key access and make an extra key that only triggers Wake-on-LAN for the target machine. You'd do that by prepending command="" to the public key in ~/.ssh/authorized_keys

Code:
command="/usr/bin/wakeonlan 01:02:03:04:05:06" ssh-rsa AAAAB3NzaC1yc2EAAAAD....
When that is in place, turn of password authentication for SSH for that machine and then enable port forwarding on the router from some external port on the router to port 22 on your always-awake machine.

Edit:

Lede, OpenWRT, or DD-WRT would have to be on Router B to turn on Machine 2 from Machine 1

... or else ...

Machine 3 must be always-on and accessible via SSH from Router B

Code:
Machine 1                                    Machine 2
   |              .-,( ),-.                      |
   |           .-(         )-.                   |
Router A ---- (    Internet   ) ---- Router B ---+
               '-(         ).-'                  |
                  '--.( ).'                      |
                                             Machine 3

Thank you for your reply.

It's make me know more specific now.

If I tried to send magic package over the WAN to Router B I need my machine 3 always wake to access into the Router B to get the package and wake Machine 2 by Machine 3.

Before that, I have to access into Router B to have the settings done.

And that depend on what Router B can possibly do.

Did I misunderstand anything ?

I'm not quite sure that Machine 2 is waked by Machine 3 or directly by Router B.
 
Old 11-09-2017, 10:48 PM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,655
Blog Entries: 3

Rep: Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901
Yes, though technically the magic packet is not going over the WAN, only over the LAN. It would come from either Router B or Machine 3 depending on your set up. If Router B has the capability to send a magic packet, then that is the best way since it is going to be always on anyway. Using a third machine would just be a work-around if the router can't handle it.
 
Old 11-09-2017, 11:36 PM   #5
victorwang
Member
 
Registered: Aug 2017
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
Yes, though technically the magic packet is not going over the WAN, only over the LAN. It would come from either Router B or Machine 3 depending on your set up. If Router B has the capability to send a magic packet, then that is the best way since it is going to be always on anyway. Using a third machine would just be a work-around if the router can't handle it.
One more question.

I've using this commend `ethtool eth0` and I saw that my computer only support wake on magic package like below.

Code:
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                100baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: external
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: g
        Link detected: yes
But When I man ethtool it says that can support not only magic package but also wake on arp 、wake on broadcast messages and so on.

Below is the man ethtool message that may support.

Code:
 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 specifying 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.
How come that my computer can only support "g"?

Is that the problem of my internet card on the board or I have to open any settings for my computer which is Ubuntu 16.04 OS system?
 
  


Reply

Tags
ping, remote, ubuntu 16.04, wakeonlan


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
Can I wake up a server in "standby" or "memory" mode using wake-on-lan? songweijia Linux - Server 2 03-03-2010 06:51 PM
Wake on Lan & Sleep on lan? ufmale Linux - Networking 1 06-25-2008 05:34 PM
wake on lan magic packet does not wake. albean Linux - Networking 1 06-30-2007 03:57 PM
LAN/ADSL Router ping working but DNS ping fails R N Ghosh Linux - Networking 1 01-13-2006 07:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration