diff --git a/knowledge base/tcpdump.md b/knowledge base/tcpdump.md index e033c0e..ffe2240 100644 --- a/knowledge base/tcpdump.md +++ b/knowledge base/tcpdump.md @@ -49,6 +49,9 @@ tcpdump -r 'path/to/capture.file' # Isolate TCP flags. tcpdump 'tcp[tcpflags] == tcp-fin' + +# Capture and show Wake-on-Lan magic packets. +sudo tcpdump -nXxei any ether proto 0x0842 or udp port 9 ``` ## Sources diff --git a/knowledge base/wake a host from lan.md b/knowledge base/wake a host from lan.md index 1f99b49..ec28fe8 100644 --- a/knowledge base/wake a host from lan.md +++ b/knowledge base/wake a host from lan.md @@ -12,6 +12,11 @@ The host needs to support wake-on-LAN and have it enabled. See [`wakeonlan`][wakeonlan] or [`wol`][wol]. +```sh +# Check the magic packet arrives on the target machine. +sudo tcpdump -nXxei any ether proto 0x0842 or udp port 9 +``` + ## Further readings - [`wakeonlan`][wakeonlan] diff --git a/knowledge base/wakeonlan.md b/knowledge base/wakeonlan.md index 13367a2..7babcbd 100644 --- a/knowledge base/wakeonlan.md +++ b/knowledge base/wakeonlan.md @@ -12,15 +12,15 @@ # Install `wakeonlan`. brew install 'wakeonlan' -# Send a WOL package to the host. +# Broadcast a WOL package. wakeonlan '11:22:33:44:55:66' -# Simulate. +# Simulate the broadcast. wakeonlan -n '11:22:33:44:55:66' -# Limit the magic package to a specific network or host. -# Use a network's *broadcast* address unless you have a static ARP table -# configured so the magic packet can actually reach the single host. +# Limit the magic package to specific networks or hosts. +# Use network *broadcast* addresses to ensure the magic packets can actually +# reach the target host; avoid this by having a static ARP table configured. wakeonlan -i '192.168.1.255' '11:22:33:44:55:66' wakeonlan -n '11:22:33:44:55:66' -i '192.168.100.3' ```