Occasionally, my Wi-Fi connection does no longer work for various reasons. Disabling and re-enabling Wi-Fi through the graphical interface of the network indicator does not resolve the problems in these cases.
How can I completely restart my Wi-Fi connection from the command-line without having to restart my machine (which fixes these problems)?
Best Answer
nmcli
is very useful command-line utility for interacting with Network Manager. Use this command in Ubuntu 16.04 LTSFor versions prior to 15.10 ( i.e. before transition to
systemd
) the command would be slightly different:Good thing about it - this doesn't require root powers.
Restarting network manager itself is a good idea as well.
For 16.04 LTS:
and for 14.04 LTS:
And if we really wanted to, we could even automate it with a script that will restart your wifi.