LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-08-2017, 01:11 AM   #1
victorwang
LQ Newbie
 
Registered: Aug 2017
Posts: 10

Rep: Reputation: Disabled
How to wake on lan with IP address ?


Hi All,

I'm using Ubuntu 16.04 for my OS system.

I'm trying to wake up my computer(unit1) which also is ubuntu 16.04 system from public network area.

In the past, I could do it with MAC address in the local network area.

I'm using this commend to wake my computer up. `etherwake AA:BB:CC:HH:EE:FF`(xx:xx... means the MAC address of the unit 1)

After some googling, I realized that windows can do it with IP address.

So I'm wondering how can I do it on Ubuntu?

Is that possible to wake it with IP Address on ubuntu ?

Or need me to give more info?

Thanks in advanced!

Last edited by victorwang; 11-08-2017 at 01:13 AM. Reason: Make question more specific
 
Old 11-08-2017, 08:00 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,643

Rep: Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977
I would have thought waking by IP would be unreliable, certainly in a DHCP environment where the IP could be re-assigned to a different MAC in the event the host is asleep when the lease expires.

You could use a combination of ping and arp to retrieve the MAC for a given IP. That's probably what the Windows utility is doing.
 
Old 11-08-2017, 08:58 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,818

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
I assume you want to turn on your home computer from outside your local network. From my limited knowledge on the subject WOL is a layer 2 broadcast message which are generally not routed. However, with subnet directed broadcasts you can usually overcome the limitation. It depends on your home router and if it allows forwarding broadcast packets.

https://www.howtogeek.com/192642/how...-the-internet/
 
Old 11-08-2017, 11:53 AM   #4
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,228

Rep: Reputation: 249Reputation: 249Reputation: 249
See the example given in https://www.mkssoftware.com/docs/man1/etherwake.1.asp
 
Old 11-08-2017, 07:20 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,745

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
I have seen a few programs that could wake over wan and you have to set router usually to nat to specific computer.

Doing sweeps of wan I see wol all the time.
 
Old 11-08-2017, 10:49 PM   #6
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Ubuntu, Devuan, OpenBSD
Posts: 2,940
Blog Entries: 3

Rep: Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279
Quote:
Originally Posted by jefro View Post
I have seen a few programs that could wake over wan and you have to set router usually to nat to specific computer.
Since WOL only works over the LAN, I would just SSH to the router and fire up the program that triggers a magic packet. Because keys would be used for connecting to the router anyway, I'd make a special key just for the WOL call to the one host and have it run a forced command to do just that one thing. The "AUTHORIZED_KEYS FILE FORMAT" section in the manual page for sshd has the details, see command="..." there.
 
Old 11-08-2017, 11:21 PM   #7
victorwang
LQ Newbie
 
Registered: Aug 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
@JeremyBoden

For your example I tried.
But when my computer is in the sleeping mode I can't even ping it's IP Address.
Is the example here `arp -a [IP Address]` the IP Address is mean router's Address or the machine I want to wake up?
 
Old 11-08-2017, 11:21 PM   #8
victorwang
LQ Newbie
 
Registered: Aug 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
For your example I tried.
But when my computer is in the sleeping mode I can't even ping it's IP Address.
Is the example here `arp -a [IP Address]` the IP Address is mean router's Address or the machine I want to wake up?
 
Old 11-09-2017, 12:36 AM   #9
victorwang
LQ Newbie
 
Registered: Aug 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by victorwang View Post
@JeremyBoden

For your example I tried.
But when my computer is in the sleeping mode I can't even ping it's IP Address.
Is the example here `arp -a [IP Address]` the IP Address is mean router's Address or the machine I want to wake up?
Quote:
Originally Posted by JeremyBoden View Post
Now I can using this commend to wake my computer up. `wakeonlan -i [IP Address] [MAC Address]`

Before that, I have to send `arp -a [IP Address]` to my computer which I want to wake up.

Then I can using `wakeonlan` to do it.

Here I've got a question.

Is that possible to wake the machine which is locate at L.A. from my local machine which is locate at New York?
 
Old 11-09-2017, 12:39 AM   #10
victorwang
LQ Newbie
 
Registered: Aug 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
I would have thought waking by IP would be unreliable, certainly in a DHCP environment where the IP could be re-assigned to a different MAC in the event the host is asleep when the lease expires.

You could use a combination of ping and arp to retrieve the MAC for a given IP. That's probably what the Windows utility is doing.
I think what you mean is I have to send an arp to the machine which I want to wake up and using `wakeonlan` to wake it with it's IP Address and MAC Address right?
 
Old 11-09-2017, 05:09 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,818

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
Quote:
Is that possible to wake the machine which is locate at L.A. from my local machine which is locate at New York?
Maybe, depends on your router/firmware. The link I posted shows some methods you can try.
 
Old 11-09-2017, 03:05 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,745

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
WOL does work over the wan. Many programs can do it.

However you may have an issue with sleep state or how the lan works.

I'd make a static ip entry in the router and port forward it to wan. You'll need to have a static wan or ddns to have it followed.

Some examples. https://ubuntuforums.org/showthread.php?t=1570275


There should be a few windows programs.


If your router still has ssh able to accessed from wan and you don't mind all the security risks of all this then you can ssh usually to router then perform some tasks.

In any of this there is a high chance that wan scammers will get into your lan and wake your computer.
 
  


Reply

Tags
remote, server, ssh, 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
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
Can ssh into host on lan using WLAN address, but not through LAN address gurkakrieg Slackware 4 01-05-2010 07:19 AM
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
Wake-on-LAN dARkHunTEr Linux - Hardware 0 11-04-2003 04:17 PM

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

All times are GMT -5. The time now is 12:14 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration