3

I have two access points in my home, and I connect to either one of them depending on which one I need. One runs behind a Tor router, the other is my normal access point.

Can I use wpa_supplicant to connect to either one? I do not want to enable roaming.

I usually connect to an access point like so:

sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf

This was fine when I had one network, but how can I specify which AP to connect to now that I have 2 AP's in my interfaces file?

For now, I guess I could just create 2 config files but I'd really like to know how to achieve this using either wpa_supplicant or wpa_cli. For now I'll go through the man pages to see what I can find.

1 Answer 1

2

I have 2 wireless access points too. Here's what I do:

Have systemd start wpa_supplicant at boot.

Put both access points in /etc/wpa_supplicant/wpa_supplicant.conf. That looks something like:

network={
        ssid="Jan Vermeer of Delft"
        psk="SOmeThing"
        priority=3
}
network={
        ssid="Pieter Brueghel the Younger"
        psk="SomethngElse"
        priority=4
}

I use wpa_cli command line program to change from one access point to the other as I desire. The list_networks and select_network commands are about all you need there.

3
  • My config looks similar to yours. With wpa_supplicant running if I run sudo wpa_cli I get could not connect to wpa_supplicant: (null) - retrying. I think its something to do with it not being able to connect to the ctrl socket or something. Some guides suggest adding ctrl_interface=/var/run/wpa_supplicant to the config but that file does not exist for me. I'm on Debian Jessie if that's any help. Jan 19, 2016 at 13:55
  • I have been following: fmepnet.org/debian_wpa.html Jan 19, 2016 at 13:57
  • My bad, the file isn't mean to exist. Added that line and group 20 and it works. Many thanks :) Jan 19, 2016 at 14:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .