Source: https://forum.proxmox.com/threads/persistent-wake-on-lan-option.46057/

apt-get update && apt-get install ethtool
nano /etc/systemd/system/wol.service
[Unit]
Description=Wake-on-LAN for <interface id>
Requires=network.target
After=network.target
[Service]
ExecStart=/usr/sbin/ethtool -s <interface id> wol g
ExecStop=/usr/sbin/ethtool -s <interface id> wol g
[Install]
WantedBy=multi-user.target
systemctl start wol.service
systemctl enable wol.service
systemctl is-enabled wol.service
systemctl daemon-reload

In order to wake up a distant machine:

# apt install etherwake