I faced an issue with my Ubuntu boxes where the WiFi doesn't come back on when the machine wakes up.
After trying a few suggestions on stackoverflow, I finally found a command that works.
sudo service network-manager restart
And to automate it to work on wake. We follow the steps here
https://askubuntu.com/questions/741620/what-are-the-possible-commands-to-reset-a-wifi-connection