Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
howtos:misc:wireless_with_wpa_cli [2015/03/16 15:19 (UTC)] slackwood fixed two bullets |
howtos:misc:wireless_with_wpa_cli [2015/07/07 18:57 (UTC)] didierspaier [Configuring Wireless With wpa_cli] Typo fix in my previous update |
||
---|---|---|---|
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 / |
- | Then try this command in bash: | + | </ |
- | chmod 644 / | + | |
+ | chmod 644 / | ||
+ | chmod 600 / | ||
+ | </ | ||
- | | + | * You might want to restart your machine at this point. |
- | Run these commands: | + | |
- | + | ||
- | chmod 644 / | + | |
- | chmod 600 / | + | |
- | + | ||
- | | + | |
- | (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 | |
- | | + | </ |
You may get back something like: | You may get back something like: | ||
- | + | < | |
- | root 1337 0.0 0.0 28268 1468 ? Ss | + | root 1337 0.0 0.0 28268 1468 ? Ss |
root 4146 0.0 0.0 | root 4146 0.0 0.0 | ||
+ | </ | ||
- | * This means you need to kill the wpa_supplicant process: | + | * This means you need to kill the wpa_supplicant process:<code bash> |
+ | kill (process id number) | ||
+ | </ | ||
- | | + | |
+ | kill 1337 | ||
+ | </ | ||
- | In this case the process id or pid for wpa_supplicant is 1337. | + | |
- | So you would do: | + | vim / |
- | + | </ | |
- | kill 1337 | + | |
- | + | ||
- | | + | |
- | + | ||
- | | + | |
It needs to look like: | It needs to look like: | ||
- | + | < | |
- | ctrl_interface=/ | + | ctrl_interface=/ |
- | update_config=1 | + | update_config=1 |
+ | </ | ||
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 / | + | wpa_supplicant -B -i wlan0 -D wext -c / |
+ | </ | ||
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 56: | ||
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 |
+ | </ | ||
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 | ||
+ | </ | ||
- | | + | scan should return OK and 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 | |
- | | + | set_network 0 ssid " |
- | set_network 0 ssid " | + | set_network psk " |
- | set_network psk " | + | </ |
add_network should return 0. If it returns some other number you may want to run " | add_network should return 0. If it returns some other number you may want to run " | ||
Line 78: | Line 79: | ||
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 |
+ | </ | ||
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 " | You can now quit wpa_cli by typing " | ||
- | * Remove the update_config line from wpa_supplicant.conf: | + | * Remove the update_config line from wpa_supplicant.conf: |
- | + | vim / | |
- | | + | </ |
Just remove " | Just remove " | ||
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 |
+ | </ | ||
+ | |||
+ | 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 / | ||
+ | </ | ||
- | | + | |
+ | wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf | ||
+ | dhcpcd</code> | ||
- | add these two lines: | ||
- | |||
- | < | ||
- | dhcpcd</ | ||
* 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 ====== |