Hostapd + blue nic

Hello All,

i’m running IPFire on a Zotac Ri531 with hostapd on an internal Intel 3160 Wifi-Card, which is working fine so far. Unfortunately the Wifi signal is not available on all floors. I got a few Devolo dlan 500 Wifi adapters covering the other areas connected to the green Network, since at least one requires a ethernet connection. I would prefer to have them also connected to the blue Network and thought i could use a free nic to bridge the blue network between hostapd and the free nic.
i tried this method and also the zone configuration, but always ended up with the same problem.
It seems like the bridge started fine, i’m able to receive a dhcp lease on the blue nic, but hostapd is no longer working. The Access Point Configuration page is asking to select an Interface, but is not accepting the availabe green0 and blue0 interface with the message “Selected interface is not a wirless lan card!”.
Looking at the interfaces i can see the following:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: red0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 00:01:2e:66:4c:b0 brd ff:ff:ff:ff:ff:ff
3: green0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 00:01:2e:66:4c:b1 brd ff:ff:ff:ff:ff:ff
4: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master blue0 state DOWN mode DEFAULT group default qlen 1000
link/ether 00:71:00:ff:0f:e1 brd ff:ff:ff:ff:ff:ff
5: blue0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
link/ether 02:4f:c7:1a:7a:48 brd ff:ff:ff:ff:ff:ff
6: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
link/ether e4:f8:9c:6a:ad:60 brd ff:ff:ff:ff:ff:ff

eth0 is now a member of the bridge blue0, but the Wifi-Card is listed as wlan0. Seems like that wlan0 was not able to join the bridge and is no longer selectable for hostapd.
Not sure if there is a solution for my problem, so any help is appreciated.

Regards

You can change the used device for hostapd manually in /var/ipfire/wlanap/settings and after this call the webif page and save the config to reenable hostapd for wlan0.

Also it is tricky to get a wlan device into a bridge. It can only added if the device is down. So it may needed to do this manually via a script.

Thanks for your response Arne,

seems like the main problem is to get the wlan0 added to the bridge. I slightly modified your bridge-script and did shut down the wlan0 interface first before adding it to the bridge:

bridge-script

#!/bin/sh
########################################################################

Begin $rc_base/init.d/bridge

Description : Skript to use more than one NIC’s as green/orange/blue net

Authors : Arne Fitzenreiter - arne_f@ipfire.org

Version : 01.00

Notes :

########################################################################
. /etc/sysconfig/rc
. ${rc_functions}

case “${1}” in
start)
boot_mesg “Create bridge for blue net…”

down blue0 and wlan0

ip link set blue0 down
ip link set wlan0 down

rename blue0 to blue1

          ip link set blue0 name blue1

create new bridge blue0

brctl addbr blue0

wait 2 seconds because udev try to rename the nics

if the real blue nic was added to fast…

sleep 2

Add real blue nic and the unused ones

brctl addif blue0 blue1
# add all the unused nics here
brctl addif blue0 wlan0

Bring nic’s up

ip link set wlan0 up
ip link set blue1 up
#ip link set eth3 up
;;

stop)

boot_mesg “Remove bridge for blue net…”

Bring nic’s down

ip link set wlan0 down
ip link set blue1 down

Bring bridge down

ip link set blue0 down

Delete Bridge

brctl delbr blue0

rename blue1 to blue0

ip link set blue1 name blue0
;;
*)
echo “Usage: ${0} {start|stop}”
exit 1
;;
esac

End $rc_base/init.d/bridge

but still received the message: can’t add wlan0 to bridge blue0: Operation not supported
Not sure if the “ip link set wlan0 down” command in the script is sufficient to shut down the interface.

Im also not sure. I think you have to shutdown also hostapd before adding wlan0 to the bridge.
Im sure it is still working but im not at home at the moment to check my working system.

hostapd was definitely down, because i uninstalled it before i started my testing, so wlan0 was just an unused interface.
I started using the setup script configuring the free ethernet interface as blue0 and checked that everything is working as expected. Then tried to add wlan0 with the above listed script, unfortunately witht he error message “can’t add wlan0 to bridge blue0”
The bridge itself is working fine, but with one member blue1 only.
Seems like there is no way around this.

Im sure it is possible because i use it at home…

Maybee the wlan must manually set to master mode before it was put in the bridge.

Getting closer …
I found a hint about enableing 4addr on the wifi-interface, so added the following statement at the beginning of the bridge-script:
iw dev wlan0 set 4addr on
The bridge is now building up as expected without any error messages.
[root@ZFire ~]# brctl show
bridge name bridge id STP enabled interfaces
blue0 8000.007100ff0fe1 no blue1
wlan0

Now i’m having problems starting hostapd with the correct interface. The gui is only offering green0 and blue0, which are obvioulsy not accepted.
I modified /etc/hostapd.conf with:
interface=wlan0
but still not accepted, during boot-up the message
Selected interface is not a wirless lan card!
appears in the logs.
Any idea where else i can force hostapd to use wlan0 ?

try to add “interface=wlan0” to
/var/ipfire/wlanap/settings

After this the WebIF should work

2 Likes

Thanks for your continued support Arne.
After modifying /var/ipfire/wlanap/settings the WebIF was accessible and all previously configured parameters were there, but Wifi still not working and the service didn’t start.
After executing an “ip a” i found a strange interface “wlan0_man:” , but after rebooting IPFire it disappeared and everything came up as expected.
Thanks a lot again
BTW, what’s best practice to mark a thread as resolved ?

On Arne’s post click the Solution checkbox. It should turn green.

1 Like