hostapd + wpa_supplicant + 4addr for client bridge
Nick Rossi
nickrossi00 at gmail.com
Tue May 3 16:47:42 PDT 2016
Hello,
Hoping this group can help - I'm trying to bridge two wired networks
into a single VLAN using 4-address mode with wpa_supplicant and
hostapd (both v2.5), following recommendations from an old thread on
this list (below).
One one machine I have a working hostapd AP with "wds_sta=1" and
wlan0/eth0 bridge. On another, wpa_supplicant with 4addr enabled on
wlan0, also bridged to its eth0. Hardware and kernel are identical on
both machines (nl80211 driver).
$ brctl addbr br0
$ brctl addif br0 eth0
$ iw dev wlan0 set 4addr on
$ brctl addif br0 wlan0
$ wpa_supplicant -B -b br0 -dd -i wlan0 -D nl80211 -c <conf> -f <log>
The above script succeeds, wpa_supplicant connects to the AP, and the
client machine can ping the host and IPs bridged behind the host.
However, the client-side bridge doesn't work, because it seems 4addr
isn't actually active; hostapd does not create an additional
"wlan0.sta1" interface, and hostapd debug output shows no recognition
of WDS mode. Also, icmp packets in tcpdump with 4addr enabled look
identical to packets without it enabled (I thought 4addr would
increase the payload size for the additional MAC address).
I have tried all this without the bridges, with the same result.
What could cause 4addr mode to not be active or recognized by hostapd
despite enabling it on the client? Does some wireless hardware not
support it?
Thank you,
Nick
> michaelm michael.melkonian at netcommwireless.com
> Thu Apr 9 05:01:10 EDT 2015
>
> After stuffing around a lot more with 4-address mode, it all appears
> good. Here are some tips (not too obvious in the documentation):
>
> 1) On AP side, when writing hostapd configuration file, make sure to add:
> wds_sta=1
> wds_bridge=br0
>
> When 4-address enabled WDS client connects, an interface appears with a
> name of wlan0.sta1 (I am assuming additional interfaces will appear as
> wlan0.sta2 and so on if more 4-address enabled clients connect).
>
> The wds_bridge line in the hostapd configuration file will automatically
> add the wlan0.sta to your nominated bridge, e.g. br0. Alternatively, you
> can always do brctl addif and so on.
>
> As one would hope, non 4-address clients continue to work as normal and
> co-exist with 4-address clients.
>
> 2) On STA side, as specified in documentation, the interface has to be
> brought up with 4addr on option, e.g.
> iw phy phy0 interface add wlan_sta0 type station 4addr on
> Bridge the 4-addr mode client interface (which is now connected to AP
> side) wlan_sta0 to AP, e.g.
> brctl addif br0 wlan_sta0 wlan0
More information about the Hostap
mailing list