Connecting to wifi through command line (Lubuntu + DWM)

Hi everyone!

As you might have noticed already, I’m a big fun of DWM and for long time I had issues with wireless. Basically whenever I wanted to change to a different wireless network I had to logout from DWM, login to the Lubuntu’s default desktop manager (not even sure what it’s called) and from there switch to the new wifi. That was kind of annoying, having to close all my open applications just to set up the wifi.

I’ve tried a few times with iwconfig etc to get it working but I never managed to connect to another wifi through command line until today! How did I do that? I used nmcli tool! This seems to be the command line tool of the network manager. Here is the command I used to connect to the wifi network:

sudo nmcli dev wifi connect <wifinetworkname> password <wifipass>

That’s simple isn’t it? Enjoy!

Note: if you want to see what networks are found in range you can use the following simple command:

nmcli connection
Advertisements

One thought on “Connecting to wifi through command line (Lubuntu + DWM)

  1. I also like dwm, but never managed to connect by WiFi. Every guide I found in the net speaks of nm-applet and NetworkManager.

    The problem is I use KDE, there is NetworkManager, but no nm-applet (that’s gnome).

    I tryed the command you suggest and get “Error: Connection activation failed: (7) Secrets were required, but not provided” instead.

    Any ideas how to obtain and pass the secrest?

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s