Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
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)] 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:< |
+ | chmod 644 / | ||
+ | </ | ||
- | * Open you favorite terminal emulator, and make yourself root. Then try this command in bash: | + | * rc.wireless should also be turned off.\\ Run these commands:<code bash> |
+ | chmod 644 / | ||
+ | chmod 600 / | ||
+ | </ | ||
- | | + | |
- | 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 600 / | + | ps aux | grep wpa |
- | + | </ | |
- | 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: | + | |
- | + | ||
- | | + | |
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. Try this: | + | * In this case the process id or pid for wpa_supplicant is 1337.\\ |
+ | * This means you need to terminate | ||
+ | wpa_cli terminate | ||
+ | </ | ||
- | | + | |
- | + | vim / | |
- | In this case the process id or pid for wpa_supplicant is 1337. | + | </ |
- | So you would do: | + | |
- | + | ||
- | kill 1337 | + | |
- | + | ||
- | Next, you will be editing | + | |
- | + | ||
- | | + | |
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. | ||
- | 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 / | + | 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 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 |
+ | </ | ||
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 |
- | Wait a little between each command: | + | 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 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 |
+ | </ | ||
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 " |
- | Open the file with your text editor: | + | |
- | vim / | + | |
+ | 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. | ||
- | 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/ | + | |
- | 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 / | + | |
- | Save your changes. Logout of your superuser session using Ctrl-D or exit.\\ | + | * Open your text editor:< |
- | You should be all set. Enjoy having wireless outside of X and in your window manager of choice. | + | vim /etc/rc.d/rc.local |
+ | </ | ||
+ | * add these two lines:< | ||
+ | wpa_supplicant -B -i wlan0 -D wext -c / | ||
+ | dhcpcd</ | ||
+ | * 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:// | + | |
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> | ||
- | * Originally written by [[wiki: | + | |
<!-- * Contributions by [[wiki: | <!-- * Contributions by [[wiki: | ||
<!-- 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 " | <!-- You must remove the tag-word " | ||
- | {{tag> | + | {{tag> |