adferrand/docker-backuppc

ether-wake usage

Closed this issue · 3 comments

Not specifically an issue, but just asking: How can one use the ether-wake command from this container without directing networking to host? I'd like to set up BackupPC to wake hosts after hours, but normally I cannot send the wol packets to the host's network.

I think there is no other easy way than attaching your Docker directly to the host network stack, as you said.

Because by default, Dockers will run in a separated network stack whose packets will be dispatched through NAT rules that the Docker daemon has set up at start.

So we are talking about a layer 3 handling, so the TCP or UDP protocol. However, wol packets are Ethernet packets sent to the MAC address of the target: this is the layer 2, on which NAT is useless.

It may be possible to set up layer 2 indirections between two network stacks, but I am dubious about the possibility, and would be really complex anyway.

As an alternative, you could create a script (bash, python or so on) lying on your host, and your Docker could launch it through SSH to the host. As the Docker embed an SSH client for the RSYNC backups, and you have certainly set up a backup of your own host through SSH, I think it is your best bet.

Thanks, that is a good idea!