Re: Wake on LAN in the enterprise

Owen DeLong <owen@delong.com> writes:
WoL works just fine over routed networks; the magic packet format doesn't preclude it. I send WoL over routed networks several times a day. The only gotcha is that you need some kind of arrangement for either directed broadcast, or hardcode ndp/arp entries. Perl code snippet below: my $wolhost = "wolhost.example.com"; my $wolhost_mac = "de:ad:be:ef:ca:fe"; my $mac = $wolhost_mac; $mac =~ s/[: ]//g; # Use socat to build a wakeonlan packet inside a udp6 datagram. my $packed_bcast = pack("H12", "f" x 12); my $packed_mac = pack("H12", $mac); my $dgram = $packed_bcast . ( $packed_mac x 16); # 9 is the discard port. For whatever reason, the wrong thing # happens when the port is referenced by name, despite having the # name in /etc/services. open(SOCAT, "|-", (qw(socat -u STDIN), "UDP6-DATAGRAM:$wolhost:9")) || die "popen: $!"; print SOCAT $dgram || die "print: $!"; close(SOCAT);
participants (1)
-
Daniel Hagerty