Connecting to wifi network through command line
Clash Royale CLAN TAG#URR8PPP
up vote
65
down vote
favorite
I am trying to connect to my WEP network just using the command-line (Linux).
I run:
sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits'
Then I try to obtain an IP with
sudo dhclient -v wlan0
or
sudo dhclient wlan0
without success (tried to ping google.com).
I know that the keyword is right, and I also tried with the ASCII key using 's:key', and again, the same result.
I get the message below when running dhclient:
Listening on LPF/wlan0/44:...
Sending on LPF/wlan0/44:...
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
I have no problem connecting with WICD or the standard Ubuntu tool.
command-line networking wifi
add a comment |Â
up vote
65
down vote
favorite
I am trying to connect to my WEP network just using the command-line (Linux).
I run:
sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits'
Then I try to obtain an IP with
sudo dhclient -v wlan0
or
sudo dhclient wlan0
without success (tried to ping google.com).
I know that the keyword is right, and I also tried with the ASCII key using 's:key', and again, the same result.
I get the message below when running dhclient:
Listening on LPF/wlan0/44:...
Sending on LPF/wlan0/44:...
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
I have no problem connecting with WICD or the standard Ubuntu tool.
command-line networking wifi
3
Side note - don't use WEP, use WPA2
â icyrock.com
Sep 29 '13 at 2:12
Can you please post the results ofiwconfig
without any parameters too. What version of Linux are you using?
â Danijel-James W
Sep 29 '13 at 4:20
2
The OP might use WEP for his own reason. It is considered shallow in perspective of security, but some people just still prefer it.
â Danijel-James W
Sep 29 '13 at 4:41
@DanijelJ There is no practical difference anymore between WEP and no encryption. In 2010, it was already possible to crack WEP in 3 seconds on a 1.7GHz Pentium M processor. If security is important, use WPA2. If it's not, don't encrypt. But WEP? That's just silly.
â Wouter Verhelst
Jun 26 '15 at 15:13
The merits of using WEP and WPA, WPA2, RAID, etc. are beside the point. Although from memory it was significantly easier to connect clients to a WEP network. If you want to be thorough or definitive, include instructions for as many as possible.
â tjt263
Sep 25 '16 at 9:32
add a comment |Â
up vote
65
down vote
favorite
up vote
65
down vote
favorite
I am trying to connect to my WEP network just using the command-line (Linux).
I run:
sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits'
Then I try to obtain an IP with
sudo dhclient -v wlan0
or
sudo dhclient wlan0
without success (tried to ping google.com).
I know that the keyword is right, and I also tried with the ASCII key using 's:key', and again, the same result.
I get the message below when running dhclient:
Listening on LPF/wlan0/44:...
Sending on LPF/wlan0/44:...
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
I have no problem connecting with WICD or the standard Ubuntu tool.
command-line networking wifi
I am trying to connect to my WEP network just using the command-line (Linux).
I run:
sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits'
Then I try to obtain an IP with
sudo dhclient -v wlan0
or
sudo dhclient wlan0
without success (tried to ping google.com).
I know that the keyword is right, and I also tried with the ASCII key using 's:key', and again, the same result.
I get the message below when running dhclient:
Listening on LPF/wlan0/44:...
Sending on LPF/wlan0/44:...
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
I have no problem connecting with WICD or the standard Ubuntu tool.
command-line networking wifi
command-line networking wifi
edited Sep 29 '13 at 2:58
PersianGulf
6,71543358
6,71543358
asked Sep 29 '13 at 1:06
Jayson Condor
326143
326143
3
Side note - don't use WEP, use WPA2
â icyrock.com
Sep 29 '13 at 2:12
Can you please post the results ofiwconfig
without any parameters too. What version of Linux are you using?
â Danijel-James W
Sep 29 '13 at 4:20
2
The OP might use WEP for his own reason. It is considered shallow in perspective of security, but some people just still prefer it.
â Danijel-James W
Sep 29 '13 at 4:41
@DanijelJ There is no practical difference anymore between WEP and no encryption. In 2010, it was already possible to crack WEP in 3 seconds on a 1.7GHz Pentium M processor. If security is important, use WPA2. If it's not, don't encrypt. But WEP? That's just silly.
â Wouter Verhelst
Jun 26 '15 at 15:13
The merits of using WEP and WPA, WPA2, RAID, etc. are beside the point. Although from memory it was significantly easier to connect clients to a WEP network. If you want to be thorough or definitive, include instructions for as many as possible.
â tjt263
Sep 25 '16 at 9:32
add a comment |Â
3
Side note - don't use WEP, use WPA2
â icyrock.com
Sep 29 '13 at 2:12
Can you please post the results ofiwconfig
without any parameters too. What version of Linux are you using?
â Danijel-James W
Sep 29 '13 at 4:20
2
The OP might use WEP for his own reason. It is considered shallow in perspective of security, but some people just still prefer it.
â Danijel-James W
Sep 29 '13 at 4:41
@DanijelJ There is no practical difference anymore between WEP and no encryption. In 2010, it was already possible to crack WEP in 3 seconds on a 1.7GHz Pentium M processor. If security is important, use WPA2. If it's not, don't encrypt. But WEP? That's just silly.
â Wouter Verhelst
Jun 26 '15 at 15:13
The merits of using WEP and WPA, WPA2, RAID, etc. are beside the point. Although from memory it was significantly easier to connect clients to a WEP network. If you want to be thorough or definitive, include instructions for as many as possible.
â tjt263
Sep 25 '16 at 9:32
3
3
Side note - don't use WEP, use WPA2
â icyrock.com
Sep 29 '13 at 2:12
Side note - don't use WEP, use WPA2
â icyrock.com
Sep 29 '13 at 2:12
Can you please post the results of
iwconfig
without any parameters too. What version of Linux are you using?â Danijel-James W
Sep 29 '13 at 4:20
Can you please post the results of
iwconfig
without any parameters too. What version of Linux are you using?â Danijel-James W
Sep 29 '13 at 4:20
2
2
The OP might use WEP for his own reason. It is considered shallow in perspective of security, but some people just still prefer it.
â Danijel-James W
Sep 29 '13 at 4:41
The OP might use WEP for his own reason. It is considered shallow in perspective of security, but some people just still prefer it.
â Danijel-James W
Sep 29 '13 at 4:41
@DanijelJ There is no practical difference anymore between WEP and no encryption. In 2010, it was already possible to crack WEP in 3 seconds on a 1.7GHz Pentium M processor. If security is important, use WPA2. If it's not, don't encrypt. But WEP? That's just silly.
â Wouter Verhelst
Jun 26 '15 at 15:13
@DanijelJ There is no practical difference anymore between WEP and no encryption. In 2010, it was already possible to crack WEP in 3 seconds on a 1.7GHz Pentium M processor. If security is important, use WPA2. If it's not, don't encrypt. But WEP? That's just silly.
â Wouter Verhelst
Jun 26 '15 at 15:13
The merits of using WEP and WPA, WPA2, RAID, etc. are beside the point. Although from memory it was significantly easier to connect clients to a WEP network. If you want to be thorough or definitive, include instructions for as many as possible.
â tjt263
Sep 25 '16 at 9:32
The merits of using WEP and WPA, WPA2, RAID, etc. are beside the point. Although from memory it was significantly easier to connect clients to a WEP network. If you want to be thorough or definitive, include instructions for as many as possible.
â tjt263
Sep 25 '16 at 9:32
add a comment |Â
8 Answers
8
active
oldest
votes
up vote
73
down vote
Option 1
Just edit /etc/network/interfaces
and write:
auto wlan0
iface wlan0 inet dhcp
wpa-ssid ssid
wpa-psk password
After that write and close file and use command:
sudo dhclient wlan0
Replace ssid and password with your respective WiFi SSID and password.
Option 2
Provided you replace your Wireless network card, Wi-Fi Network name, and Wi-FI Password this should also work.
I am using:
- Wireless network card is wlan0
- Wireless network is "Wifi2Home"
- Wireless network key is ASCII code ABCDE12345
First, get your WiFi card up and running:
sudo ifconfig wlan0 up
Now scan for a list of WiFi networks in range:
sudo iwlist wlan0 scan
This will show you a list of wireless networks, pick yours from the list:
sudo iwconfig wlan0 essid Wifi2Home key s:ABCDE12345
To obtain the IP address, now request it with the Dynamic Host Client:
sudo dhclient wlan0
You should then be connected to the WiFi network. The first option is better, because it will be able to run as a cron
job to start up the wifi whenever you need it going. If you need to turn off your WiFi for whatever reason, just type:
sudo ifconfig wlan0 down
FYI
I have also seen people using alternative commands. I use Debian, Solaris and OSX, so I'm not 100% sure if they are the same on Ubuntu. But here they are:
sudo ifup wlan0
is the same as sudo ifconfig wlan0 up
sudo ifdown wlan0
is the same as sudo ifconfig wlan down
1
The last two commands aren't the same. «ifconfig ⦠up» just activates an interface, wheres «ifup ⦻ besides activating also setups IP addresses and some other options.
â Hi-Angel
Oct 19 '14 at 8:09
11
I like version 2 very much! Only I get: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument. And this is the command I used (just like you suggested): sudo iwconfig wlan0 essid mywifiname key s:THEPASSWORD. Can you help?
â nourdine
Nov 28 '14 at 23:35
1
@Danijel: Thanks! Do both methods work for both WPA2 with shared passphrase. Do they not work for WPA2 with username and password?
â Tim
May 4 '15 at 22:54
@nourdine this worked for me: superuser.com/a/295972/253766
â smac89
Jul 23 at 3:22
add a comment |Â
up vote
33
down vote
There is Danijel J's two options are good, but there is also a 3rd option if you have this working via the 'standard Ubuntu tool' using nmcli
, which should already be installed at /usr/bin/nmcli
.
First, run
nmcli c
This will list your connections, with the first column being the SSID, and the second column being the UUID of the connection.
Copy the UUID of the SSID you want to connect to so you can paste it into the next command.
Next, run
nmcli c up uuid <paste uuid here>
and this will, using the same stuff as the 'standard Ubuntu tool' connect to your wifi!
add a comment |Â
up vote
22
down vote
If you have nmcli
installed, I think this is the simplest solution.
For a new connection:
nmcli dev wifi connect <mySSID> password <myPassword>
Or if a connection was already set up:
nmcli con up <mySSID>
(or if that does not work, try nmcli con up id <mySSID>
)
this does not work, the wifi option does not even have a "connect" command
â redbeam_
Jan 13 '17 at 22:21
@redbeam_ Seems like thewifi connect
option was added in version 0.9.6. See this answer.
â DLight
Jan 14 '17 at 11:03
On Ubuntu 14.04, this command should be:nmcli con up id <mySSID>
.
â Chad
May 17 '17 at 2:19
@Chad Thanks, I edited my answer.
â DLight
May 18 '17 at 10:57
got some issue with antergos installer on xiaomi book air and this allowed me to connect using wifi. Thanks !
â Francesco
Jan 14 at 10:43
add a comment |Â
up vote
6
down vote
Install wpa_supplicant
and you have a nice software for all of your Wireless needs.
You can then use wpa_cli
command to access and set your network interactively.
there is also a number of 3rd party software available acting as a GTK+ or QT GUI for wpa_supplicant if you want to go gui at anytime.
Also you could set the connection configuration in /etc/wpa_supplicant.conf
or /etc/wpa_supplicant/wpa_supplicant.conf
depend on you linux OS.
for more information on interactive command type h
inside wpa_cli
.
add a comment |Â
up vote
5
down vote
Use nmtui
if you are just looking to connect.
You'll be prompted to activate a connection, with the list of SSIDs and you can just enter your password.
1
Wonderful. This is the best solution i ever see.
â Luciano Andress Martini
Sep 5 at 18:21
add a comment |Â
up vote
1
down vote
Fixed issue.
Laptop with no WiFi switch. No bios always on or disable switch etc.
Keyboard had FN + F2 which wouldn't recognize
I attempted to bring up the interface got the
Not permitted due to RF-KILL blah blah
Installed rfkill
Sudo apt-get install rfkill
Did rfkill list , like othersmentioned and I saw in otherforums
The saw a soft block on the wriless cards
Did
Rfkill unblock (index #) of device
once that was done my WiFi led turned on.
Then did the "ip Link set dev xx up" or the "ifconfig xxx up" and the ifup or w.e to get the interface to be up not just the hardware for ip address and boom. Wifi
May want to edit etc/xxx/xxx/interface file to dhcp or statis it and onboot yes or auto . El/deb devices do the config of the interfaces differently ![enter image description
http://i66.tinypic.com/104s37t.jpg
This answer helped me to reactivate my Asus eee 901 with malfunctioning keyboard controller as simple server. I managed to activate wi-fi and connect my netbook to WPA network. Thanks a lot.
â Marecky
Jun 29 '17 at 21:39
No problem. Glad I could help.
â ssvegeta96
Jun 30 '17 at 16:36
add a comment |Â
up vote
0
down vote
Besides from above answers, you can also use wifi-menu
on Arch Linux. It will show a CLI-Based GUI and you can choose a WiFi from WiFi list that is shown. wifi-menu
depends on dialog
though. You must have it installed first.
add a comment |Â
up vote
0
down vote
I know that this was asked 3 years ago. I am answering just in case someone else runs into this situation as I've just did.
The thing is that everything is correct until the dhclient part, where it gets stuck at "DHCPDISCOVER on wlan0..." forever.
Solution:
Go to your network manager (Wicd, Network Manager, whatever) and unmark the "Enable Networking" option. It seems that it interferes with the dhclient's normal functioning.
And dhclient worked like a charm.
add a comment |Â
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
73
down vote
Option 1
Just edit /etc/network/interfaces
and write:
auto wlan0
iface wlan0 inet dhcp
wpa-ssid ssid
wpa-psk password
After that write and close file and use command:
sudo dhclient wlan0
Replace ssid and password with your respective WiFi SSID and password.
Option 2
Provided you replace your Wireless network card, Wi-Fi Network name, and Wi-FI Password this should also work.
I am using:
- Wireless network card is wlan0
- Wireless network is "Wifi2Home"
- Wireless network key is ASCII code ABCDE12345
First, get your WiFi card up and running:
sudo ifconfig wlan0 up
Now scan for a list of WiFi networks in range:
sudo iwlist wlan0 scan
This will show you a list of wireless networks, pick yours from the list:
sudo iwconfig wlan0 essid Wifi2Home key s:ABCDE12345
To obtain the IP address, now request it with the Dynamic Host Client:
sudo dhclient wlan0
You should then be connected to the WiFi network. The first option is better, because it will be able to run as a cron
job to start up the wifi whenever you need it going. If you need to turn off your WiFi for whatever reason, just type:
sudo ifconfig wlan0 down
FYI
I have also seen people using alternative commands. I use Debian, Solaris and OSX, so I'm not 100% sure if they are the same on Ubuntu. But here they are:
sudo ifup wlan0
is the same as sudo ifconfig wlan0 up
sudo ifdown wlan0
is the same as sudo ifconfig wlan down
1
The last two commands aren't the same. «ifconfig ⦠up» just activates an interface, wheres «ifup ⦻ besides activating also setups IP addresses and some other options.
â Hi-Angel
Oct 19 '14 at 8:09
11
I like version 2 very much! Only I get: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument. And this is the command I used (just like you suggested): sudo iwconfig wlan0 essid mywifiname key s:THEPASSWORD. Can you help?
â nourdine
Nov 28 '14 at 23:35
1
@Danijel: Thanks! Do both methods work for both WPA2 with shared passphrase. Do they not work for WPA2 with username and password?
â Tim
May 4 '15 at 22:54
@nourdine this worked for me: superuser.com/a/295972/253766
â smac89
Jul 23 at 3:22
add a comment |Â
up vote
73
down vote
Option 1
Just edit /etc/network/interfaces
and write:
auto wlan0
iface wlan0 inet dhcp
wpa-ssid ssid
wpa-psk password
After that write and close file and use command:
sudo dhclient wlan0
Replace ssid and password with your respective WiFi SSID and password.
Option 2
Provided you replace your Wireless network card, Wi-Fi Network name, and Wi-FI Password this should also work.
I am using:
- Wireless network card is wlan0
- Wireless network is "Wifi2Home"
- Wireless network key is ASCII code ABCDE12345
First, get your WiFi card up and running:
sudo ifconfig wlan0 up
Now scan for a list of WiFi networks in range:
sudo iwlist wlan0 scan
This will show you a list of wireless networks, pick yours from the list:
sudo iwconfig wlan0 essid Wifi2Home key s:ABCDE12345
To obtain the IP address, now request it with the Dynamic Host Client:
sudo dhclient wlan0
You should then be connected to the WiFi network. The first option is better, because it will be able to run as a cron
job to start up the wifi whenever you need it going. If you need to turn off your WiFi for whatever reason, just type:
sudo ifconfig wlan0 down
FYI
I have also seen people using alternative commands. I use Debian, Solaris and OSX, so I'm not 100% sure if they are the same on Ubuntu. But here they are:
sudo ifup wlan0
is the same as sudo ifconfig wlan0 up
sudo ifdown wlan0
is the same as sudo ifconfig wlan down
1
The last two commands aren't the same. «ifconfig ⦠up» just activates an interface, wheres «ifup ⦻ besides activating also setups IP addresses and some other options.
â Hi-Angel
Oct 19 '14 at 8:09
11
I like version 2 very much! Only I get: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument. And this is the command I used (just like you suggested): sudo iwconfig wlan0 essid mywifiname key s:THEPASSWORD. Can you help?
â nourdine
Nov 28 '14 at 23:35
1
@Danijel: Thanks! Do both methods work for both WPA2 with shared passphrase. Do they not work for WPA2 with username and password?
â Tim
May 4 '15 at 22:54
@nourdine this worked for me: superuser.com/a/295972/253766
â smac89
Jul 23 at 3:22
add a comment |Â
up vote
73
down vote
up vote
73
down vote
Option 1
Just edit /etc/network/interfaces
and write:
auto wlan0
iface wlan0 inet dhcp
wpa-ssid ssid
wpa-psk password
After that write and close file and use command:
sudo dhclient wlan0
Replace ssid and password with your respective WiFi SSID and password.
Option 2
Provided you replace your Wireless network card, Wi-Fi Network name, and Wi-FI Password this should also work.
I am using:
- Wireless network card is wlan0
- Wireless network is "Wifi2Home"
- Wireless network key is ASCII code ABCDE12345
First, get your WiFi card up and running:
sudo ifconfig wlan0 up
Now scan for a list of WiFi networks in range:
sudo iwlist wlan0 scan
This will show you a list of wireless networks, pick yours from the list:
sudo iwconfig wlan0 essid Wifi2Home key s:ABCDE12345
To obtain the IP address, now request it with the Dynamic Host Client:
sudo dhclient wlan0
You should then be connected to the WiFi network. The first option is better, because it will be able to run as a cron
job to start up the wifi whenever you need it going. If you need to turn off your WiFi for whatever reason, just type:
sudo ifconfig wlan0 down
FYI
I have also seen people using alternative commands. I use Debian, Solaris and OSX, so I'm not 100% sure if they are the same on Ubuntu. But here they are:
sudo ifup wlan0
is the same as sudo ifconfig wlan0 up
sudo ifdown wlan0
is the same as sudo ifconfig wlan down
Option 1
Just edit /etc/network/interfaces
and write:
auto wlan0
iface wlan0 inet dhcp
wpa-ssid ssid
wpa-psk password
After that write and close file and use command:
sudo dhclient wlan0
Replace ssid and password with your respective WiFi SSID and password.
Option 2
Provided you replace your Wireless network card, Wi-Fi Network name, and Wi-FI Password this should also work.
I am using:
- Wireless network card is wlan0
- Wireless network is "Wifi2Home"
- Wireless network key is ASCII code ABCDE12345
First, get your WiFi card up and running:
sudo ifconfig wlan0 up
Now scan for a list of WiFi networks in range:
sudo iwlist wlan0 scan
This will show you a list of wireless networks, pick yours from the list:
sudo iwconfig wlan0 essid Wifi2Home key s:ABCDE12345
To obtain the IP address, now request it with the Dynamic Host Client:
sudo dhclient wlan0
You should then be connected to the WiFi network. The first option is better, because it will be able to run as a cron
job to start up the wifi whenever you need it going. If you need to turn off your WiFi for whatever reason, just type:
sudo ifconfig wlan0 down
FYI
I have also seen people using alternative commands. I use Debian, Solaris and OSX, so I'm not 100% sure if they are the same on Ubuntu. But here they are:
sudo ifup wlan0
is the same as sudo ifconfig wlan0 up
sudo ifdown wlan0
is the same as sudo ifconfig wlan down
edited Apr 2 '17 at 3:30
answered Sep 29 '13 at 4:40
Danijel-James W
99721116
99721116
1
The last two commands aren't the same. «ifconfig ⦠up» just activates an interface, wheres «ifup ⦻ besides activating also setups IP addresses and some other options.
â Hi-Angel
Oct 19 '14 at 8:09
11
I like version 2 very much! Only I get: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument. And this is the command I used (just like you suggested): sudo iwconfig wlan0 essid mywifiname key s:THEPASSWORD. Can you help?
â nourdine
Nov 28 '14 at 23:35
1
@Danijel: Thanks! Do both methods work for both WPA2 with shared passphrase. Do they not work for WPA2 with username and password?
â Tim
May 4 '15 at 22:54
@nourdine this worked for me: superuser.com/a/295972/253766
â smac89
Jul 23 at 3:22
add a comment |Â
1
The last two commands aren't the same. «ifconfig ⦠up» just activates an interface, wheres «ifup ⦻ besides activating also setups IP addresses and some other options.
â Hi-Angel
Oct 19 '14 at 8:09
11
I like version 2 very much! Only I get: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument. And this is the command I used (just like you suggested): sudo iwconfig wlan0 essid mywifiname key s:THEPASSWORD. Can you help?
â nourdine
Nov 28 '14 at 23:35
1
@Danijel: Thanks! Do both methods work for both WPA2 with shared passphrase. Do they not work for WPA2 with username and password?
â Tim
May 4 '15 at 22:54
@nourdine this worked for me: superuser.com/a/295972/253766
â smac89
Jul 23 at 3:22
1
1
The last two commands aren't the same. «ifconfig ⦠up» just activates an interface, wheres «ifup ⦻ besides activating also setups IP addresses and some other options.
â Hi-Angel
Oct 19 '14 at 8:09
The last two commands aren't the same. «ifconfig ⦠up» just activates an interface, wheres «ifup ⦻ besides activating also setups IP addresses and some other options.
â Hi-Angel
Oct 19 '14 at 8:09
11
11
I like version 2 very much! Only I get: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument. And this is the command I used (just like you suggested): sudo iwconfig wlan0 essid mywifiname key s:THEPASSWORD. Can you help?
â nourdine
Nov 28 '14 at 23:35
I like version 2 very much! Only I get: Error for wireless request "Set Encode" (8B2A) : SET failed on device wlan0 ; Invalid argument. And this is the command I used (just like you suggested): sudo iwconfig wlan0 essid mywifiname key s:THEPASSWORD. Can you help?
â nourdine
Nov 28 '14 at 23:35
1
1
@Danijel: Thanks! Do both methods work for both WPA2 with shared passphrase. Do they not work for WPA2 with username and password?
â Tim
May 4 '15 at 22:54
@Danijel: Thanks! Do both methods work for both WPA2 with shared passphrase. Do they not work for WPA2 with username and password?
â Tim
May 4 '15 at 22:54
@nourdine this worked for me: superuser.com/a/295972/253766
â smac89
Jul 23 at 3:22
@nourdine this worked for me: superuser.com/a/295972/253766
â smac89
Jul 23 at 3:22
add a comment |Â
up vote
33
down vote
There is Danijel J's two options are good, but there is also a 3rd option if you have this working via the 'standard Ubuntu tool' using nmcli
, which should already be installed at /usr/bin/nmcli
.
First, run
nmcli c
This will list your connections, with the first column being the SSID, and the second column being the UUID of the connection.
Copy the UUID of the SSID you want to connect to so you can paste it into the next command.
Next, run
nmcli c up uuid <paste uuid here>
and this will, using the same stuff as the 'standard Ubuntu tool' connect to your wifi!
add a comment |Â
up vote
33
down vote
There is Danijel J's two options are good, but there is also a 3rd option if you have this working via the 'standard Ubuntu tool' using nmcli
, which should already be installed at /usr/bin/nmcli
.
First, run
nmcli c
This will list your connections, with the first column being the SSID, and the second column being the UUID of the connection.
Copy the UUID of the SSID you want to connect to so you can paste it into the next command.
Next, run
nmcli c up uuid <paste uuid here>
and this will, using the same stuff as the 'standard Ubuntu tool' connect to your wifi!
add a comment |Â
up vote
33
down vote
up vote
33
down vote
There is Danijel J's two options are good, but there is also a 3rd option if you have this working via the 'standard Ubuntu tool' using nmcli
, which should already be installed at /usr/bin/nmcli
.
First, run
nmcli c
This will list your connections, with the first column being the SSID, and the second column being the UUID of the connection.
Copy the UUID of the SSID you want to connect to so you can paste it into the next command.
Next, run
nmcli c up uuid <paste uuid here>
and this will, using the same stuff as the 'standard Ubuntu tool' connect to your wifi!
There is Danijel J's two options are good, but there is also a 3rd option if you have this working via the 'standard Ubuntu tool' using nmcli
, which should already be installed at /usr/bin/nmcli
.
First, run
nmcli c
This will list your connections, with the first column being the SSID, and the second column being the UUID of the connection.
Copy the UUID of the SSID you want to connect to so you can paste it into the next command.
Next, run
nmcli c up uuid <paste uuid here>
and this will, using the same stuff as the 'standard Ubuntu tool' connect to your wifi!
answered Oct 2 '14 at 0:00
samson
42142
42142
add a comment |Â
add a comment |Â
up vote
22
down vote
If you have nmcli
installed, I think this is the simplest solution.
For a new connection:
nmcli dev wifi connect <mySSID> password <myPassword>
Or if a connection was already set up:
nmcli con up <mySSID>
(or if that does not work, try nmcli con up id <mySSID>
)
this does not work, the wifi option does not even have a "connect" command
â redbeam_
Jan 13 '17 at 22:21
@redbeam_ Seems like thewifi connect
option was added in version 0.9.6. See this answer.
â DLight
Jan 14 '17 at 11:03
On Ubuntu 14.04, this command should be:nmcli con up id <mySSID>
.
â Chad
May 17 '17 at 2:19
@Chad Thanks, I edited my answer.
â DLight
May 18 '17 at 10:57
got some issue with antergos installer on xiaomi book air and this allowed me to connect using wifi. Thanks !
â Francesco
Jan 14 at 10:43
add a comment |Â
up vote
22
down vote
If you have nmcli
installed, I think this is the simplest solution.
For a new connection:
nmcli dev wifi connect <mySSID> password <myPassword>
Or if a connection was already set up:
nmcli con up <mySSID>
(or if that does not work, try nmcli con up id <mySSID>
)
this does not work, the wifi option does not even have a "connect" command
â redbeam_
Jan 13 '17 at 22:21
@redbeam_ Seems like thewifi connect
option was added in version 0.9.6. See this answer.
â DLight
Jan 14 '17 at 11:03
On Ubuntu 14.04, this command should be:nmcli con up id <mySSID>
.
â Chad
May 17 '17 at 2:19
@Chad Thanks, I edited my answer.
â DLight
May 18 '17 at 10:57
got some issue with antergos installer on xiaomi book air and this allowed me to connect using wifi. Thanks !
â Francesco
Jan 14 at 10:43
add a comment |Â
up vote
22
down vote
up vote
22
down vote
If you have nmcli
installed, I think this is the simplest solution.
For a new connection:
nmcli dev wifi connect <mySSID> password <myPassword>
Or if a connection was already set up:
nmcli con up <mySSID>
(or if that does not work, try nmcli con up id <mySSID>
)
If you have nmcli
installed, I think this is the simplest solution.
For a new connection:
nmcli dev wifi connect <mySSID> password <myPassword>
Or if a connection was already set up:
nmcli con up <mySSID>
(or if that does not work, try nmcli con up id <mySSID>
)
edited May 18 '17 at 10:56
answered Dec 3 '16 at 11:41
DLight
32126
32126
this does not work, the wifi option does not even have a "connect" command
â redbeam_
Jan 13 '17 at 22:21
@redbeam_ Seems like thewifi connect
option was added in version 0.9.6. See this answer.
â DLight
Jan 14 '17 at 11:03
On Ubuntu 14.04, this command should be:nmcli con up id <mySSID>
.
â Chad
May 17 '17 at 2:19
@Chad Thanks, I edited my answer.
â DLight
May 18 '17 at 10:57
got some issue with antergos installer on xiaomi book air and this allowed me to connect using wifi. Thanks !
â Francesco
Jan 14 at 10:43
add a comment |Â
this does not work, the wifi option does not even have a "connect" command
â redbeam_
Jan 13 '17 at 22:21
@redbeam_ Seems like thewifi connect
option was added in version 0.9.6. See this answer.
â DLight
Jan 14 '17 at 11:03
On Ubuntu 14.04, this command should be:nmcli con up id <mySSID>
.
â Chad
May 17 '17 at 2:19
@Chad Thanks, I edited my answer.
â DLight
May 18 '17 at 10:57
got some issue with antergos installer on xiaomi book air and this allowed me to connect using wifi. Thanks !
â Francesco
Jan 14 at 10:43
this does not work, the wifi option does not even have a "connect" command
â redbeam_
Jan 13 '17 at 22:21
this does not work, the wifi option does not even have a "connect" command
â redbeam_
Jan 13 '17 at 22:21
@redbeam_ Seems like the
wifi connect
option was added in version 0.9.6. See this answer.â DLight
Jan 14 '17 at 11:03
@redbeam_ Seems like the
wifi connect
option was added in version 0.9.6. See this answer.â DLight
Jan 14 '17 at 11:03
On Ubuntu 14.04, this command should be:
nmcli con up id <mySSID>
.â Chad
May 17 '17 at 2:19
On Ubuntu 14.04, this command should be:
nmcli con up id <mySSID>
.â Chad
May 17 '17 at 2:19
@Chad Thanks, I edited my answer.
â DLight
May 18 '17 at 10:57
@Chad Thanks, I edited my answer.
â DLight
May 18 '17 at 10:57
got some issue with antergos installer on xiaomi book air and this allowed me to connect using wifi. Thanks !
â Francesco
Jan 14 at 10:43
got some issue with antergos installer on xiaomi book air and this allowed me to connect using wifi. Thanks !
â Francesco
Jan 14 at 10:43
add a comment |Â
up vote
6
down vote
Install wpa_supplicant
and you have a nice software for all of your Wireless needs.
You can then use wpa_cli
command to access and set your network interactively.
there is also a number of 3rd party software available acting as a GTK+ or QT GUI for wpa_supplicant if you want to go gui at anytime.
Also you could set the connection configuration in /etc/wpa_supplicant.conf
or /etc/wpa_supplicant/wpa_supplicant.conf
depend on you linux OS.
for more information on interactive command type h
inside wpa_cli
.
add a comment |Â
up vote
6
down vote
Install wpa_supplicant
and you have a nice software for all of your Wireless needs.
You can then use wpa_cli
command to access and set your network interactively.
there is also a number of 3rd party software available acting as a GTK+ or QT GUI for wpa_supplicant if you want to go gui at anytime.
Also you could set the connection configuration in /etc/wpa_supplicant.conf
or /etc/wpa_supplicant/wpa_supplicant.conf
depend on you linux OS.
for more information on interactive command type h
inside wpa_cli
.
add a comment |Â
up vote
6
down vote
up vote
6
down vote
Install wpa_supplicant
and you have a nice software for all of your Wireless needs.
You can then use wpa_cli
command to access and set your network interactively.
there is also a number of 3rd party software available acting as a GTK+ or QT GUI for wpa_supplicant if you want to go gui at anytime.
Also you could set the connection configuration in /etc/wpa_supplicant.conf
or /etc/wpa_supplicant/wpa_supplicant.conf
depend on you linux OS.
for more information on interactive command type h
inside wpa_cli
.
Install wpa_supplicant
and you have a nice software for all of your Wireless needs.
You can then use wpa_cli
command to access and set your network interactively.
there is also a number of 3rd party software available acting as a GTK+ or QT GUI for wpa_supplicant if you want to go gui at anytime.
Also you could set the connection configuration in /etc/wpa_supplicant.conf
or /etc/wpa_supplicant/wpa_supplicant.conf
depend on you linux OS.
for more information on interactive command type h
inside wpa_cli
.
answered Oct 1 '14 at 22:44
r004
1,44652044
1,44652044
add a comment |Â
add a comment |Â
up vote
5
down vote
Use nmtui
if you are just looking to connect.
You'll be prompted to activate a connection, with the list of SSIDs and you can just enter your password.
1
Wonderful. This is the best solution i ever see.
â Luciano Andress Martini
Sep 5 at 18:21
add a comment |Â
up vote
5
down vote
Use nmtui
if you are just looking to connect.
You'll be prompted to activate a connection, with the list of SSIDs and you can just enter your password.
1
Wonderful. This is the best solution i ever see.
â Luciano Andress Martini
Sep 5 at 18:21
add a comment |Â
up vote
5
down vote
up vote
5
down vote
Use nmtui
if you are just looking to connect.
You'll be prompted to activate a connection, with the list of SSIDs and you can just enter your password.
Use nmtui
if you are just looking to connect.
You'll be prompted to activate a connection, with the list of SSIDs and you can just enter your password.
edited 16 mins ago
Sridhar Ratnakumar
270110
270110
answered Sep 25 '16 at 6:56
MrE
20638
20638
1
Wonderful. This is the best solution i ever see.
â Luciano Andress Martini
Sep 5 at 18:21
add a comment |Â
1
Wonderful. This is the best solution i ever see.
â Luciano Andress Martini
Sep 5 at 18:21
1
1
Wonderful. This is the best solution i ever see.
â Luciano Andress Martini
Sep 5 at 18:21
Wonderful. This is the best solution i ever see.
â Luciano Andress Martini
Sep 5 at 18:21
add a comment |Â
up vote
1
down vote
Fixed issue.
Laptop with no WiFi switch. No bios always on or disable switch etc.
Keyboard had FN + F2 which wouldn't recognize
I attempted to bring up the interface got the
Not permitted due to RF-KILL blah blah
Installed rfkill
Sudo apt-get install rfkill
Did rfkill list , like othersmentioned and I saw in otherforums
The saw a soft block on the wriless cards
Did
Rfkill unblock (index #) of device
once that was done my WiFi led turned on.
Then did the "ip Link set dev xx up" or the "ifconfig xxx up" and the ifup or w.e to get the interface to be up not just the hardware for ip address and boom. Wifi
May want to edit etc/xxx/xxx/interface file to dhcp or statis it and onboot yes or auto . El/deb devices do the config of the interfaces differently ![enter image description
http://i66.tinypic.com/104s37t.jpg
This answer helped me to reactivate my Asus eee 901 with malfunctioning keyboard controller as simple server. I managed to activate wi-fi and connect my netbook to WPA network. Thanks a lot.
â Marecky
Jun 29 '17 at 21:39
No problem. Glad I could help.
â ssvegeta96
Jun 30 '17 at 16:36
add a comment |Â
up vote
1
down vote
Fixed issue.
Laptop with no WiFi switch. No bios always on or disable switch etc.
Keyboard had FN + F2 which wouldn't recognize
I attempted to bring up the interface got the
Not permitted due to RF-KILL blah blah
Installed rfkill
Sudo apt-get install rfkill
Did rfkill list , like othersmentioned and I saw in otherforums
The saw a soft block on the wriless cards
Did
Rfkill unblock (index #) of device
once that was done my WiFi led turned on.
Then did the "ip Link set dev xx up" or the "ifconfig xxx up" and the ifup or w.e to get the interface to be up not just the hardware for ip address and boom. Wifi
May want to edit etc/xxx/xxx/interface file to dhcp or statis it and onboot yes or auto . El/deb devices do the config of the interfaces differently ![enter image description
http://i66.tinypic.com/104s37t.jpg
This answer helped me to reactivate my Asus eee 901 with malfunctioning keyboard controller as simple server. I managed to activate wi-fi and connect my netbook to WPA network. Thanks a lot.
â Marecky
Jun 29 '17 at 21:39
No problem. Glad I could help.
â ssvegeta96
Jun 30 '17 at 16:36
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Fixed issue.
Laptop with no WiFi switch. No bios always on or disable switch etc.
Keyboard had FN + F2 which wouldn't recognize
I attempted to bring up the interface got the
Not permitted due to RF-KILL blah blah
Installed rfkill
Sudo apt-get install rfkill
Did rfkill list , like othersmentioned and I saw in otherforums
The saw a soft block on the wriless cards
Did
Rfkill unblock (index #) of device
once that was done my WiFi led turned on.
Then did the "ip Link set dev xx up" or the "ifconfig xxx up" and the ifup or w.e to get the interface to be up not just the hardware for ip address and boom. Wifi
May want to edit etc/xxx/xxx/interface file to dhcp or statis it and onboot yes or auto . El/deb devices do the config of the interfaces differently ![enter image description
http://i66.tinypic.com/104s37t.jpg
Fixed issue.
Laptop with no WiFi switch. No bios always on or disable switch etc.
Keyboard had FN + F2 which wouldn't recognize
I attempted to bring up the interface got the
Not permitted due to RF-KILL blah blah
Installed rfkill
Sudo apt-get install rfkill
Did rfkill list , like othersmentioned and I saw in otherforums
The saw a soft block on the wriless cards
Did
Rfkill unblock (index #) of device
once that was done my WiFi led turned on.
Then did the "ip Link set dev xx up" or the "ifconfig xxx up" and the ifup or w.e to get the interface to be up not just the hardware for ip address and boom. Wifi
May want to edit etc/xxx/xxx/interface file to dhcp or statis it and onboot yes or auto . El/deb devices do the config of the interfaces differently ![enter image description
http://i66.tinypic.com/104s37t.jpg
edited Oct 24 '16 at 1:49
answered Oct 24 '16 at 1:42
ssvegeta96
577
577
This answer helped me to reactivate my Asus eee 901 with malfunctioning keyboard controller as simple server. I managed to activate wi-fi and connect my netbook to WPA network. Thanks a lot.
â Marecky
Jun 29 '17 at 21:39
No problem. Glad I could help.
â ssvegeta96
Jun 30 '17 at 16:36
add a comment |Â
This answer helped me to reactivate my Asus eee 901 with malfunctioning keyboard controller as simple server. I managed to activate wi-fi and connect my netbook to WPA network. Thanks a lot.
â Marecky
Jun 29 '17 at 21:39
No problem. Glad I could help.
â ssvegeta96
Jun 30 '17 at 16:36
This answer helped me to reactivate my Asus eee 901 with malfunctioning keyboard controller as simple server. I managed to activate wi-fi and connect my netbook to WPA network. Thanks a lot.
â Marecky
Jun 29 '17 at 21:39
This answer helped me to reactivate my Asus eee 901 with malfunctioning keyboard controller as simple server. I managed to activate wi-fi and connect my netbook to WPA network. Thanks a lot.
â Marecky
Jun 29 '17 at 21:39
No problem. Glad I could help.
â ssvegeta96
Jun 30 '17 at 16:36
No problem. Glad I could help.
â ssvegeta96
Jun 30 '17 at 16:36
add a comment |Â
up vote
0
down vote
Besides from above answers, you can also use wifi-menu
on Arch Linux. It will show a CLI-Based GUI and you can choose a WiFi from WiFi list that is shown. wifi-menu
depends on dialog
though. You must have it installed first.
add a comment |Â
up vote
0
down vote
Besides from above answers, you can also use wifi-menu
on Arch Linux. It will show a CLI-Based GUI and you can choose a WiFi from WiFi list that is shown. wifi-menu
depends on dialog
though. You must have it installed first.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Besides from above answers, you can also use wifi-menu
on Arch Linux. It will show a CLI-Based GUI and you can choose a WiFi from WiFi list that is shown. wifi-menu
depends on dialog
though. You must have it installed first.
Besides from above answers, you can also use wifi-menu
on Arch Linux. It will show a CLI-Based GUI and you can choose a WiFi from WiFi list that is shown. wifi-menu
depends on dialog
though. You must have it installed first.
answered May 24 '15 at 15:23
Reza Hajianpour
11
11
add a comment |Â
add a comment |Â
up vote
0
down vote
I know that this was asked 3 years ago. I am answering just in case someone else runs into this situation as I've just did.
The thing is that everything is correct until the dhclient part, where it gets stuck at "DHCPDISCOVER on wlan0..." forever.
Solution:
Go to your network manager (Wicd, Network Manager, whatever) and unmark the "Enable Networking" option. It seems that it interferes with the dhclient's normal functioning.
And dhclient worked like a charm.
add a comment |Â
up vote
0
down vote
I know that this was asked 3 years ago. I am answering just in case someone else runs into this situation as I've just did.
The thing is that everything is correct until the dhclient part, where it gets stuck at "DHCPDISCOVER on wlan0..." forever.
Solution:
Go to your network manager (Wicd, Network Manager, whatever) and unmark the "Enable Networking" option. It seems that it interferes with the dhclient's normal functioning.
And dhclient worked like a charm.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I know that this was asked 3 years ago. I am answering just in case someone else runs into this situation as I've just did.
The thing is that everything is correct until the dhclient part, where it gets stuck at "DHCPDISCOVER on wlan0..." forever.
Solution:
Go to your network manager (Wicd, Network Manager, whatever) and unmark the "Enable Networking" option. It seems that it interferes with the dhclient's normal functioning.
And dhclient worked like a charm.
I know that this was asked 3 years ago. I am answering just in case someone else runs into this situation as I've just did.
The thing is that everything is correct until the dhclient part, where it gets stuck at "DHCPDISCOVER on wlan0..." forever.
Solution:
Go to your network manager (Wicd, Network Manager, whatever) and unmark the "Enable Networking" option. It seems that it interferes with the dhclient's normal functioning.
And dhclient worked like a charm.
answered Oct 17 '16 at 14:38
Gabriel Otero Pérez
1
1
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f92799%2fconnecting-to-wifi-network-through-command-line%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
Side note - don't use WEP, use WPA2
â icyrock.com
Sep 29 '13 at 2:12
Can you please post the results of
iwconfig
without any parameters too. What version of Linux are you using?â Danijel-James W
Sep 29 '13 at 4:20
2
The OP might use WEP for his own reason. It is considered shallow in perspective of security, but some people just still prefer it.
â Danijel-James W
Sep 29 '13 at 4:41
@DanijelJ There is no practical difference anymore between WEP and no encryption. In 2010, it was already possible to crack WEP in 3 seconds on a 1.7GHz Pentium M processor. If security is important, use WPA2. If it's not, don't encrypt. But WEP? That's just silly.
â Wouter Verhelst
Jun 26 '15 at 15:13
The merits of using WEP and WPA, WPA2, RAID, etc. are beside the point. Although from memory it was significantly easier to connect clients to a WEP network. If you want to be thorough or definitive, include instructions for as many as possible.
â tjt263
Sep 25 '16 at 9:32