You are not logged in.
With wpa_supplicant and ifplugd properly configured, a computer will autoconnect to the strongest open wireless network. That's all well and good.. But sometimes you want to connect to a specific network - usually an encrypted one.
How can I do that with wpa_supplicant and wpa_cli, without having to edit wpa_supplicant.conf for every specific network I want to connect to? i.e. what commands would I use in wpa_cli to set the authentication type and key for a network with a given SSID, and then force association with it? I've looked at the man pages and the built-in help, but I seem to be missing something.
Also, on a related topic: is there any kind of shorthand for referring to networks in wpa_cli, so I don't have to type out the whole SSID?
Offline
Hmm... If I'm correct, the configuration file for wpa_supplicant doesn't have to be named "wpa_supplicant.conf," so you could have a different conf file set up for each network, and then be lazy like me and manage them with a script, like this:
#!/bin/sh
if [ "$@" = "-a" ]
then
sudo wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_conf1.conf
echo "wpa configuration 1 loaded."
elif [ "$@" = "-b" ]
then
sudo wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_conf2.conf
echo "wpa configuration 2 loaded."
else
echo "Hmm... No configuration for that."
fi
exit 0
#Of course edit this as needed.
Then you could just type in "sh script_name.sh -a" into a terminal to start your first configuration. If you're also as lazy as me, you can set an alias in your .bashrc to execute the script like "alias wpa_start='sh ~/script_name.sh'" so you can just do "wpa_start -a".
Also, did you check the wiki here? It's a godsend, I tell ya.
I also don't know of any type of shorthand, sorry.
Sorry if this is too patronizing, I want to be detailed as this is the newbie corner, and it's better to give a bit too much than to not give enough. >_>
Last edited by SlayingDragons (2011-08-14 07:10:59)
Offline
Thanks, but I'm talking about once-off connections to encrypted networks, e.g. at a hotel or somesuch. Surely that can be done without editing or creating any new files?
As for the wiki, it annoyingly does not say anything about how to use wpa_cli. It does tell you how to use wpa_gui (which is easy enough), but what if you want to connect from the command line?
Offline
As for the wiki, it annoyingly does not say anything about how to use wpa_cli. It does tell you how to use wpa_gui (which is easy enough), but what if you want to connect from the command line?
I haven't wpa_supplicant installed, but there should be a man page like this one.
To know or not to know ...
... the questions remain forever.
Offline
Oh... Duh. Somehow I missed this:
Example request for password and a matching reply:
CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
> password 1 mysecretpasswordExample request for generic token card challenge-response:
CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
> otp 2 9876
But this still doesn't answer how I force association with a specific network. Also, is there any way to get wpa_cli to repeat a request like that?
Offline
Thanks, but I'm talking about once-off connections to encrypted networks, e.g. at a hotel or somesuch. Surely that can be done without editing or creating any new files?
As for the wiki, it annoyingly does not say anything about how to use wpa_cli. It does tell you how to use wpa_gui (which is easy enough), but what if you want to connect from the command line?
networkmanager with frontend. (or wicd)
Last edited by Mr.Elendig (2011-08-14 15:28:22)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
IOW, no way of doing it.
Drat.
I figured that it would at least be possible, if not exactly easy... Oh well.
Offline
wifi-select is probably the nicest way of handling this. Or, if you're using openbox, wifi-pipe.
Offline