How to connect to a wireless network from the Ubuntu command line

At times i encountered with a weird problem in ubuntu am connected to wifi still am not able to ping i checked dns etc everything seems fine and wifi is connected in network manager but still no net connection then i tried connecting to the wifi network through terminal that worked and i got connection here is how i did it.

$ sudo iwlist eth1 scan

This scan lists every available access point.

Screenshot from 2014-03-14 22:31:44


Now we got the ESSID from the command now issue the below command

sudo iwconfig eth1 essid "BSNL_AP"

Now run dhclient to get an ip address

sudo dhclient eth1

Now try pinging your luck

Happy Hacking 🙂



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s