# wpa_supplicant and multiple interfaces?

## dasPaul

Hi

I have two wifi interfaces in my gentoo, wlan0 and wlan1.

both are configured in /etc/conf.d/net:

```
## WLAN0

config_wlan0="192.168.1.9 netmask 255.255.255.0 brd 192.168.1.255"

modules_wlan0="wpa_supplicant"

wpa_supplicant_wlan0="-Dnl80211 -d -f /var/log/wpa_supplicant.log"

## WLAN1

config_wlan1="dhcp"

modules_wlan1="wpa_supplicant"

wpa_supplicant_wlan1="-c /etc/wpa_supplicant/wpa_supplicant_wlan1.conf -Dnl80211 -d -f /var/log/wpa_supplicant_wlan1.log"

```

I occasionally use wlan0 at home on an encrypted AP.

I want to use wlan1 on an unencrypted public AP.

I have two configs for both interaces in my /etc/wpa_supplicant/ dir...

wpa_supplicant.conf:

```
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

network={

        ssid="Satan"

        psk=".666666."

        scan_ssid=1

        proto=RSN

        key_mgmt=WPA-PSK

        group=CCMP TKIP

        pairwise=CCMP TKIP

        priority=5

}
```

wpa_supplicant_wlan1.conf:

```

ctrl_interface=DIR=/var/run/wpa_supplicant_wlan1 GROUP=wheel

#ap_scan=0

#update_config=1

network={

        ssid="God"

        key_mgmt=NONE

}
```

Now if I start /etc/init.d/net.wlan1 it still uses the wpa_supllicant.conf from the first config file. 

So I obviously doing it wrong. I thought I can specify what config file to use in /etc/conf.d/net by 

appending "-c /etc/wpa_supplicant/wpa_supplicant_wlan1.conf" to the "wpa_supplicant_wlan1" parameter...

Any ideas how to do it the right way?

----------

## UberLord

Silly question - why don't you just use one wireless interface and set the config file to prefer encrypted AP over unencrypted public one?

----------

## dasPaul

 *UberLord wrote:*   

> Silly question - why don't you just use one wireless interface and set the config file to prefer encrypted AP over unencrypted public one?

 

Well the unencrypted AP is where I get Internet from and the encrypted AP is there to have an SSH/VNC connection to the gentoo box...

Nevertheless I found a way to circumvent this scenario.

----------

