I have recently updated the os from version 16.04 to 18.04 LTS. But I can not connect the pc to mobile Hotspot. The wifi is turned on but in the visible networks section no available network is shown. How can I resolve this, please help.
2 Answers
Using nmcli
utility(recommended):
We will use the command-line version of Network Manager, nmcli
.
Scan for available WiFi networks:
nmcli d wifi list
where d
stands for devices.
Connect to your access point, for example, my_wifi
:
nmcli d wifi connect my_wifi password <password>
where <password>
is the password for the connection.
Using ifconfig
:
Check the wireless network device of your card. It usually starts with w like wlan0
, but if you're unsure you can just run iwconfig
. It will report "no wireless extensions" for non-wireless devices and will display some data for any wireless devices.
Now bring up your wireless card as a root user:
sudo ifconfig wlan0 up
Enter your access point name and password using iwconfig
:
iwconfig wlan0 essid <my_wifi> key s:<password>
where is the name of your hotspot name and is its password.
This method works for WEP encrypted connections. For WPA/WPA2 encryptions see this.

- 119
First let's test, that your connection is working by doing the following from the terminal
ping -c4 8.8.8.8
If that succeeded, you're pinging Google's nameserver's and your connection is fine. You're probably having a misconfigured resolv.conf file which includes the nameserver ip address (nameservers will translate names ie. google.com to ip-addresses).
If you're able to ping, we need to fix your misconfigured resolv.conf file
sudo rm -f /etc/resolv.conf
<p>sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf</p>
Restart networking or reboot
sudo service networking restart

- 31
-
-
Hey I just ran those commands and then the internet just stopped working.. Although wifi is connected.. How do I revert this to previous state?! – suhani Jan 11 '20 at 15:19
sudo ifconfig wlan0 down
to shut down and againsudo ifconfig wlan0 up
to restart your wifi. Then try again usingnmcli
. Here wlan0 can be different in your device, useiwconfig
to check. – sks-15 Jan 08 '20 at 18:01