When attempting to wake a remote machine (ubuntu server) from my laptop using powerwake host01.cluster
I get a message back saying:
INFO: Trying to wake host: [host01.cluster]
INFO: Sending magic packet to: [xxxxxxxxxxxx]
Unfortunately, xxxxxxxxxxxx
is an incorrect MAC address, and hence no remote waking up of the remote machine occurs.
When I try using the IP address (powerwake 192.168.1.101
) it also sends the magic packet to the wrong MAC address.
I have the following line in /etc/hosts/
192.168.1.101 host01.cluster host01
However, I can ssh
into the machine using both ssh host01
, and ssh host01.cluster
. I'm assuming /etc/hosts
, which I have set up for static addresses (on my laptop) is being used here for resolution.
When reading through man powerwake
it provides a hierarchy of which caches it searches to resolve names:
/var/cache/powerwake/ethers
/etc/ethers
arp -n
)On my laptop (uname -r
-> 4.2.0-35-generic
), bullet list item 1 is empty, 2 doesn't exist, and the incorrect MAC address doesn't even exist in the arp -n
table either.
If I run sudo arp-scan -l
on my laptop the incorrect MAC address doesn't show up there either.
Running sudo find /var/cache/ -type f -exec grep -il "host01" {} \;
turns up no results either.
Where else could a MAC address be cached buy ubuntu/powerwake
?
I would like to be able to purge the incorrect MAC address so that I can use powerwake
to wake up this particular machine remotely.
sudo ethtool eth0
run on the remote shows that WOL is enabled.
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off (auto)
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
I went digging through /usr/bin/powerwake
(just a python script) and I found a reference to "%s/.cache/ethers"
, so I looked in my home directory ,and sure enough, this file was present (cat ~/.cache/ethers
) that wasn't part of man powerwake
.
This file held the incorrect reference for the IP address -> MAC address mapping that was causing the issue.
Anyway, I deleted the file ~/.cache/ethers
, then "warmed" this cache file again.
First I checked my arp
table, as I had since cleared it, to see what was in there. None of the remotes I wanted to contact were listed, so I performed a simple ping -c 2 192.168.1.XXX
on each machine I wished to wake (the remote machines need to be on and able to be pinged). This loaded them into the arp table (confirmed by arp -n
).
I then ran:
powerwake 192.168.1.XXX
for each machinepowerwake hostXX
for each machine again~/.cache/ethers
file to be loaded with each entry that matches my /etc/hosts
file on my laptopcat ~/.cache/ethers
to confirm the file exists and has been populated with the correct IP Addr -> MAC mappingこの記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加