20211128 - Server went through an OS upgrade, sorry for the downtime.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
howtos:misc:wireless_with_wpa_cli [2015/03/15 22:06 (UTC)]
slackwood created a page about wpa_cli config
howtos:misc:wireless_with_wpa_cli [2018/10/22 14:34 (UTC)] (current)
naglfar
Line 5: Line 5:
 This article is for folks who are choosing not to use NetworkManager for their wireless.\\ If you are running FluxBox or some other lightweight window manager, you may find it useful to configure wireless in the manner described below.\\ If you are interested in having wireless internet without having to run X at all, this article may also be of interest. This article is for folks who are choosing not to use NetworkManager for their wireless.\\ If you are running FluxBox or some other lightweight window manager, you may find it useful to configure wireless in the manner described below.\\ If you are interested in having wireless internet without having to run X at all, this article may also be of interest.
  
-  * Make sure that NetworkManager is turned off.+  * Make sure that NetworkManager is turned off.\\ Open your favorite terminal emulator, and make yourself root.\\ Then try this command in bash:<code bash> 
 +chmod 644 /etc/rc.d/rc.networkmanager 
 +</code>
  
-  * Open you favorite terminal emulator, and make yourself rootThen try this command in bash:+  * rc.wireless should also be turned off.\\ Run these commands:<code bash> 
 +chmod 644 /etc/rc.d/rc.wireless 
 +chmod 600 /etc/rc.d/rc.wireless.conf 
 +</code>
  
-  chmod 644 /etc/rc.d/rc.networkmanager+  * You might want to restart your machine at this point\\ (Before doing so, you should ideally have another machine like a laptop or a tablet available so you can keep reading this documentation.)
  
-rc.wireless should also be turned off. Try running these commands:+  * After booting, log back in as a regular user and make yourself root again.
  
-  chmod 644 /etc/rc.d/rc.wireless +  * Check to ensure that wpa_supplicant is not currently running:<code bash> 
-  chmod 600 /etc/rc.d/rc.wireless.conf +ps aux | grep wpa 
- +</code>
-You might want to restart your machine at this point, but before doing so, \\ +
-you should ideally have another machine like a laptop or a tablet available so you can keep reading this documentation or other sources online while troubleshooting. +
- +
-After booting, log back in as a regular user and make yourself root again. +
- +
-Next, you need to ensure that wpa_supplicant is not currently running. Try this command+
- +
-  ps aux | grep wpa+
  
 You may get back something like: You may get back something like:
- +<code> 
-root      1337  0.0  0.0  28268  1468 ?        Ss   14:23   0:00 wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf\\+root      1337  0.0  0.0  28268  1468 ?        Ss   14:23   0:00 wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf
 root      4146  0.0  0.0   7136   968 pts/1    S+   16:53   0:00 grep wpa root      4146  0.0  0.0   7136   968 pts/1    S+   16:53   0:00 grep wpa
 +</code>
  
-This means you need to kill the wpa_supplicant process. Try this:+  * In this case the process id or pid for wpa_supplicant is 1337.\\  
 +  * This means you need to terminate the wpa_supplicant process:<code bash> 
 +wpa_cli terminate 
 +</code>
  
-  kill (process id number) +  * Edit wpa_supplicant.conf with your text editor. The command with vim is:<code bash> 
- +vim /etc/wpa_supplicant.conf 
-In this case the process id or pid for wpa_supplicant is 1337. +</code>
-So you would do: +
- +
-  kill 1337 +
- +
-Next, you will be editing wpa_supplicant.conf with your text editor. The command with vim is: +
- +
-  vim /etc/wpa_supplicant.conf+
  
 It needs to look like: It needs to look like:
- +<code> 
-  ctrl_interface=/var/run/wpa_supplicant +ctrl_interface=/var/run/wpa_supplicant 
-  update_config=1+update_config=1 
 +</code>
  
 Change it to that, removing all other lines and save it. Change it to that, removing all other lines and save it.
  
-Now you start wpa_supplicant from the command line. Try+  * Start wpa_supplicant from the command line:<code bash> 
-  wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf+wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf 
 +</code>
  
 This will work for most people. There are other driver options like nl80211, but I have not had good luck with them. This will work for most people. There are other driver options like nl80211, but I have not had good luck with them.
Line 57: Line 53:
 wpa_supplicant should start up successfully. If you get a message about an RFKILL error you can probably ignore it. wpa_supplicant should start up successfully. If you get a message about an RFKILL error you can probably ignore it.
  
-Next run wpa_cli from the command line: +  * Run wpa_cli from the command line:<code bash> 
-  wpa_cli+wpa_cli 
 +</code>
  
 It should start up and report that wpa_supplicant is running. It should start up and report that wpa_supplicant is running.
  
-Now you are going to go through a series of wpa_cli commands in order to configure your wireless setup+  * Now configure your wireless setup, waiting a little between each command:<code bash> 
-Wait a little between each command:+scan 
 +scan_results 
 +</code>
  
-  scan +scan should return OK and scan_results should list your wireless router after a short wait.
-  scan_results+
  
-scan should return OK and scan_results should list your wireless router after a short wait. If all is well, then continue. +  * If all is well, then continue.<code bash> 
- +add_network 
-  add_network +set_network 0 ssid "Your_Wireless_SSID_Here" 
-  set_network 0 ssid "Your_Wireless_SSID_Here" +set_network psk "Your_Password_Here" 
-  set_network psk "Your_Password_Here"+</code>
  
 add_network should return 0. If it returns some other number you may want to run "remove_network" on the numbers below the returned value and start over. add_network should return 0. If it returns some other number you may want to run "remove_network" on the numbers below the returned value and start over.
Line 78: Line 76:
 If you only have one wireless network, it really should be network zero. If you only have one wireless network, it really should be network zero.
  
-store your new setup to the wpa_suppilcant.conf file: +  * store your new setup to the wpa_suppilcant.conf file:<code bash> 
-  save_config+save_config 
 +</code>
  
 The last command should save your config and return OK. If it says FAIL you may have a driver issue or have mistyped something in your wpa_supplicant startup command.\\ The last command should save your config and return OK. If it says FAIL you may have a driver issue or have mistyped something in your wpa_supplicant startup command.\\
-You can now quit wpa_cli by typing "quit" and hitting enter. Finally, you should remove the update_config line from wpa_supplicant.conf\\ +You can now quit wpa_cli by typing "quit" and hitting enter. 
-Open the file with your text editor:+
  
-  vim /etc/wpa_supplicant.conf+  * Remove the update_config line from wpa_supplicant.conf:<code bash> 
 +vim /etc/wpa_supplicant.conf 
 +</code>
  
 Just remove "update_config=1" from the file.\\ Just remove "update_config=1" from the file.\\
 Your SSID and the password should now be written into the config file. Your SSID and the password should now be written into the config file.
  
-The last step is to run dhcpcd. Run this command+  * Run dhcpcd:<code bash> 
-  dhcpcd wlan0 +dhcpcd wlan0 
- +</code>
-That should get you online. Now you if you want to automate this so it happens automatically each time your system boots up,\\ +
-just open your text editor add the wpa_supplicant line to /etc/rc.d/rc.local:+
  
-  vim /etc/rc.d/rc.local+That should get you online.
  
-in your editor add: +  * To automate this so it happens each time your system boots up:
-  wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf+
  
-Save your changesLogout of your superuser session using Ctrl-D or exit.\\ +  * Open your text editor:<code bash> 
-You should be all set. Enjoy having wireless outside of X and in your window manager of choice.+vim /etc/rc.d/rc.local 
 +</code>
  
 +  * add these two lines:<code bash>
 +wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf
 +dhcpcd</code>
  
 +  * Save your changes.
 +  * Log out of your superuser session using Ctrl-D or exit.
 +  * Enjoy having wireless outside of X and in your window manager of choice.
  
 ====== Sources ====== ====== Sources ======
 <!-- Extremely helpful page from the archlinux wiki --> <!-- Extremely helpful page from the archlinux wiki -->
-* Original source for some content: [[https://wiki.archlinux.org/index.php/WPA_supplicant]]+  * Original source for some content: [[https://wiki.archlinux.org/index.php/WPA_supplicant]]
 <!-- Authors are allowed to give credit to themselves! --> <!-- Authors are allowed to give credit to themselves! -->
-* Originally written by [[wiki:user:slackwood | User slackwood]]+  * Originally written by [[wiki:user:slackwood | User slackwood]]
 <!-- * Contributions by [[wiki:user:yyy | User Y]] --> <!-- * Contributions by [[wiki:user:yyy | User Y]] -->
  
 <!-- Please do not modify anything below, except adding new tags.--> <!-- Please do not modify anything below, except adding new tags.-->
 <!-- You must remove the tag-word "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
-{{tag>howtos}}+{{tag>howtos author slackwood}}

In Other Languages
QR Code
QR Code howtos:misc:wireless_with_wpa_cli (generated for current page)