Wednesday, January 9, 2019

Connect to WIFI by CLI (Problem faced during Ubuntu upgrade to 18.04)

While upgrading Ubuntu from 16.04 to 18.04;network connection become unstable and after that not able to connect to Network and UI still remains to install.In that situation to connect with

To solve this problem

Step 1

Firstly check your network interface is DISABLED or not.

# sudo lshw -c network
  *-network DISABLED               
       description: Wireless interface
       product: AR9462 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: wlp1s0
       version: 01
       serial: b0:c0:90:aa:8d:0f
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=4.15.0-43-generic firmware=N/A ip=10.64.129.164 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:16 memory:f1100000-f117ffff memory:f1180000-f118ffff
....
...

Step 2

If your network marked as disabled then enable it or go to step 3

# ifconfig <your wireless interface logical name in my case it is wlp1s0> up

After performing this step you can check weather DISABLED in front of network is removed or not

Step 3

If your wireless interface is up.Now run scan there

#iw dev <your wireless interface logical name in my case it is wlp1s0> scan ap-force

OR

#iwlist <your wireless interface logical name in my case it is wlp1s0> scan

.............
..............
                    IE: Unknown: DD050040961401
          Cell 10 - Address: 70:7D:B9:8D:1A:5F
                    Channel:56
                    Frequency:5.28 GHz (Channel 56)
                    Quality=34/70  Signal level=-76 dBm  
                    Encryption key:on
                    ESSID:"Guest"
                    Bit Rates:12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s; 48 Mb/s
                              54 Mb/s
                    Mode:Master
                    Extra:tsf=0000001627fcf806
................
..................

Step 4

Connect to one of the listed wifi
i)Firstly Needed to generate a basic configuration from CLI

#wpa_passphrase <WIFI network SSID in my case it is "Guest">  <password for the network> > /etc/wpa_supplicant/wpa_supplicant.conf

ii)Now connect with wifi

#wpa_supplicant -B -i interface -c /etc/wpa_supplicant.conf

Step 5

Start Network connection

#dhclient wlp1s0

No comments: