Computer waking up immediately after going to sleep

Continuing the discussion from Every attempt to enter sleep results in a crash and freeze:

The issue was the USB network card having all Wake On LAN flags set, and my ISP router flooding broadcast ARP requests on the network (not the real MAC in the output here).

sudo tcpdump -i enp8s0f3u2 -n -e   'broadcast or multicast or arp or (udp and (port 9 or port
7))'
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on enp8s0f3u2, link-type EN10MB (Ethernet), snapshot length 262144 bytes
12:16:26.498102 9b:f2:7d:7b:30:df > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 400, p 0, et
hertype ARP (0x0806), Request who-has 192.168.27.98 tell 192.168.27.99, length 46
12:16:27.557168 9b:f2:7d:7b:30:df > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 400, p 0, et
hertype ARP (0x0806), Request who-has 192.168.27.98 tell 192.168.27.99, length 46
12:16:28.587139 9b:f2:7d:7b:30:df > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 64: vlan 400, p 0, et

If you’re using NetworkManager, wake-on lan can also be disabled with a conf file:

/etc/NetworkManager/conf.d/wake-on-lan.conf
[connection]
ethernet.wake-on-lan = ignore
wifi.wake-on-wlan = ignore

I noticed the flags with ethtools

sudo ethtool enp8s0f3u2 | grep Wake-on
        Supports Wake-on: pumbg
        Wake-on: pumbg

I tested with disabling WOL

sudo ethtool -s enp8s0f3u2 wol d

It worked so I created a service at /etc/systemd/system/disable-wol.service to disable WOL (keeping Magick Packet enabled with the g flag would have worked too but I prefer to disable it all with d)

[Unit]
Description=Disable Wake-on-LAN
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/ethtool -s enp8s0f3u2 wol d
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now disable-wol.service

It seems to have fixed that issue for now.