# wpa_supplicant on two interfaces



## fari (Oct 28, 2011)

I need run to run wpa_supplicant on both wired re0 interfaces and wireless wlan0 interface. Preferably with two different config files, as wired interfaces is statically configured and i would like to use wpa_gui on wireless interface.

Is there any way how to force system to start two wpa_supplicants with different drivers and config files?

I have managed to configure system to work either with wpa_supplicant on wlan0 configurable with wpa_gui or with wpa_supplicant on wired interface succesfuly connecting to network, but not both at the time.

Have you any idea how to solve the problem?

Thanks


----------



## ecazamir (Oct 28, 2011)

WPA Supplicant can only be used with 802.11 (wireless) interfaces on FreeBSD up to 8.2-RELEASE, see wpa_supplicant(8).


----------



## fari (Oct 28, 2011)

ecazamir said:
			
		

> WPA Supplicant can only be used with 802.11 (wireless) interfaces on FreeBSD up to 8.2-RELEASE, see man 8 wpa_supplicant.



well, I am using 8.2-RELEASE and WPA Supplicant works fine with wired driver, but I cannot manage to run it both on wired and wireless interface at one time

respectively I surely can do it:


```
wpa_supplicant -B /
 -D wired -i re0 -c /etc/wpa_supplicant/wpa_supplicant_re0.conf / 
 -D bsd -i re0 -c /etc/wpa_supplicant/wpa_supplicant_wlan0.conf
```

which does exactly what I want, but must be done manualy. 

What I don't know is how to configure system (rc.conf I presume) to do it when booting.


----------



## ecazamir (Oct 29, 2011)

Put the full command line in /etc/rc.local. Disable wpa in /etc/rc.conf, use only the /etc/rc.local method. You could duplicate the /etc/rc.d/wpa_supplicant in /etc/rc.d/wpa_supplicant2, but you should also duplicate some variables for /etc/rc.conf, pid files, etc.


----------



## fari (Oct 29, 2011)

ecazamir said:
			
		

> Put the full command line in /etc/rc.local. Disable wpa in /etc/rc.conf, use only the /etc/rc.local method.



Ok, I try this, thanks 



			
				ecazamir said:
			
		

> You could duplicate the /etc/rc.d/wpa_supplicant in /etc/rc.d/wpa_supplicant2, but you should also duplicate some variables for /etc/rc.conf, pid files, etc.



I actually like this solution. It occured to me at first, but as I am new to the BSD, I didn't want to mess with the system scripts unless I am sure there is no "cleaner" solution.

I intend to copy and tweak /etc/rc.d/wpa_supplicant in the way it handles both config files and reads two $wpa_supplicant_conf_files from /etc/rc.conf but I would like to know one last thing.

I which way is the token WPA from /etc/rc.conf:


```
...
ifconfig_re0="WPA DHCP" #my re0 config
...
```

binded to the /etc/rc.d/wpa_supplicant so system starts wpa on interface re0? I couldn't find any binding neither in /etc/rc.d/wpa_supplicant nor in /etc/rc.d/netif.

Thanks for your help ;-)


----------



## ecazamir (Oct 29, 2011)

I forgot about 
	
	



```
ifconfig_ifaceN="WPA DHCP"
```
 It is related only to /etc/rc.d/wpa_supplicant only. If you will add a new wpa_supplicant_x script, this should not be affected/invoked, unless you keep unmodified the PROVIDE line. 

```
ifconfig_ifaceNumber="WPA"
```
 will trigger automatic startup for wpa_supplicant from /etc/network.subr on ifconfig_up() function.

This will require wpa_supplicant to be enabled to work properly. The 'manual' method should work fine.


----------



## wblock@ (Oct 29, 2011)

Purely out of curiosity, why run WPA on a wired interface?


----------



## ecazamir (Oct 30, 2011)

for 802.1x authentication.


----------

