I have set my laptop having Ubuntu 16.04 to suspend when lid is closed. This is the behaviour I need.
In addition to that, I've also enabled wake-on-lan on the laptop, as I need to remotely access it sometimes.
Now, when I wake it up with WOL, it wakes up, I'm able to ssh, but it goes back to sleep soon after that. If I keep sending WOL packets, I can access it with interruptions, as it keeps suspending and waking up.
How do I fix this?