Skip to content

danroc/wol-relay

Repository files navigation

Wake-on-LAN Relay

Relay Wake-on-LAN (WOL) packets between multiple networks or interfaces. This is useful for environments where devices are on separate subnets and need to be woken up remotely.

Features

  • Listens for WOL packets on specified interfaces
  • Relays valid WOL packets to all other monitored networks
  • Prevents packet loops and duplicate broadcasts
  • Lightweight and easy to deploy (single binary or Docker image)
  • Accepts both interface names and CIDR notation for target networks

Usage

Docker Compose

Add the following service to your compose.yaml to relay WOL packets between the eno1 and eno2 network interfaces:

services:
  wol-relay:
    image: ghcr.io/danroc/wol-relay:latest
    container_name: wol-relay
    network_mode: host
    command: eno1 eno2
    security_opt:
      - no-new-privileges:true
    restart: unless-stopped

Note: network_mode: host is required for the container to access host network interfaces and broadcast packets.

Standalone

You can also run the relay directly on your host:

# Build the binary
go build

# Run the relay
sudo ./wol-relay eno1 eno2

Replace eno1 and eno2 with the names of your network interfaces.

CIDR Targets

You can also specify networks directly using CIDR notation, including /32 for unicast relay to individual hosts:

# Relay between interface eno1 and a remote subnet
sudo ./wol-relay eno1 10.0.0.0/24

# Unicast relay to a specific host
sudo ./wol-relay eno1 192.168.2.5/32

# Mixed interfaces and CIDRs
sudo ./wol-relay eno1 eno2 10.0.0.0/24 172.16.0.10/32

Requirements

  • Go 1.24+ (for building from source)
  • Sufficient privileges to access network interfaces and send broadcast packets

Development

  • Run tests:

    go test ./...
  • Build Docker image:

    docker build -t wol-relay .

Packages

 
 
 

Contributors