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

Both sides previous revision Previous revision
Next revision
Previous revision
howtos:misc:wireless_with_wpa_cli [2015/03/16 15:19 (UTC)]
slackwood fixed two bullets
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> 
-Open your favorite terminal emulator, and make yourself root. +chmod 644 /etc/rc.d/rc.networkmanager 
-Then try this command in bash:+</code>
  
-  chmod 644 /etc/rc.d/rc.networkmanager+  * 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>
  
-  * rc.wireless should also be turned off.\\ +  * 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.)
-Run these commands: +
- +
-  chmod 644 /etc/rc.d/rc.wireless +
-  chmod 600 /etc/rc.d/rc.wireless.conf +
- +
-  * 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.)+
  
   * After booting, log back in as a regular user and make yourself root again.   * After booting, log back in as a regular user and make yourself root again.
  
-  * Check to ensure that wpa_supplicant is not currently running: +  * Check to ensure that wpa_supplicant is not currently running:<code bash> 
- +ps aux | grep wpa 
-  ps aux | grep wpa+</code>
  
 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:+  * 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 +
- +
-  * Edit 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.
  
-  * Start wpa_supplicant from the command line: +  * 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 58: 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.
  
-  * 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 configure your wireless setup, waiting a little between each command:+  * Now configure your wireless setup, waiting a little between each command:<code bash> 
 +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.  You can now quit wpa_cli by typing "quit" and hitting enter. 
  
-  * Remove the update_config line from wpa_supplicant.conf: +  * Remove the update_config line from wpa_supplicant.conf:<code bash> 
- +vim /etc/wpa_supplicant.conf 
-  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.
  
-  * Run dhcpcd: +  * Run dhcpcd:<code bash> 
-  dhcpcd wlan0+dhcpcd wlan0 
 +</code> 
 + 
 +That should get you online.
  
-That should get you online.\\ 
   * To automate this so it happens each time your system boots up:   * To automate this so it happens each time your system boots up:
  
-Open your text editor:+  * Open your text editor:<code bash> 
 +vim /etc/rc.d/rc.local 
 +</code>
  
-  vim /etc/rc.d/rc.local+  * add these two lines:<code bash> 
 +wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf 
 +dhcpcd</code>
  
-add these two lines: 
- 
-<code>wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf 
-dhcpcd</code> 
   * Save your changes.   * Save your changes.
   * Log out of your superuser session using Ctrl-D or exit.   * Log out of your superuser session using Ctrl-D or exit.
   * Enjoy having wireless outside of X and in your window manager of choice.   * Enjoy having wireless outside of X and in your window manager of choice.
- 
- 
  
 ====== Sources ====== ====== Sources ======

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