17

According to this link

nmcli dev wifi con a52c60f5-c1af-4d39-8dc8-728bd770bffc password 12345678 name dlink_home

should establish the connection, but it outputs the following error when I try to connect:

Error: 'dev wifi' command 'con' is not valid.

So, how I can connect to wireless internet/network using network-manager or nmcli in command-line mode?

PS. The OS I am running is RHEL6 Server

easl
  • 2,008

2 Answers2

15

Using an 18-month old openSUSE with nmcli -v 0.8.2, I did the following:

nmcli dev wifi

That gave me a list, in which I could spot my own wireless hub. The key columns are SSID and BSSID.

I then used Start Menu-->Control Center-->Network Connections-->Wireless. I had one connection there called "Wireless connection 1". Selecting it, Edit...-->Wireless: fill in SSID and BSSID verbatim from the nmcli command above. Then on Wireless Security page, I entered my hub's password. The "Security" selection was based again on the nmcli output above. OK, Save...

Then (I did this as root; may not be necessary):

nmcli con up id 'Wireless connection 1'

Note the "id" is NOT the SSID or BSSID; instead this is the "nickname" on your computer for this network.

As stated above, /etc/NetworkManager/system-connections holds files of which "Wireless connection 1' is one (in my case).

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
8

The capability to define a new connection on the command line with nmcli dev wifi con … was added in NetworkManager 0.9.6. (If you're using Ubuntu, that means release 12.10 or higher.) In earlier versions, new connections can only be defined through the GUI or by editing configuration files manually (in /etc/NetworkManager/system-connections or under ~/.gconf). You can activate an existing connection with nmcli con up.

If you have no GUI to define connections, you can try wicd instead of NetworkManager.