Results 1 to 3 of 3

Thread: WIFI AP on hotplug usb device.

  1. #1

    Default WIFI AP on hotplug usb device.

    Hello.

    I'm looking for decision to start WiFi AP on hotplug WiFi USB adapter.
    Main problem is to add wlan interface to existing bridge when USB adapter plugged.

    I've configuration of wlan interface in ifcfg-wlan0 file (the name of interface is changed by udev rule, it's ok)

    Code:
    BOOTPROTO='none' 
    NAME='wlan0' 
    STARTMODE='hotplug' 
    LINK_REQUIRED='no' 
    ZONE='internal'


    and
    ifcfg-br0

    Code:
    STARTMODE='auto' 
    BOOTPROTO='static' 
    USERCONTROL='no' 
    IPADDR='172.30.1.1/27' 
    BRIDGE='yes' 
    BRIDGE_PORTS="eth_GRAY wlan0" 
    BRIDGE_STP='off' 
    BRIDGE_FORWARDDELAY='0' 
    LINK_REQUIRED='no' 
    ZONE='internal'


    After reboot (wicked mode) the br0 is misconfigured (the IP is not set) and consist
    eth_GRAY interface only. I think the adding wlan0 to br0 ending with an error.

    Code:
    brctl show
    bridge name     bridge id               STP enabled     interfaces 
    br0             8000.5adeebd60847       no              eth_GRAY 


    I know, to add wifi interface to bridge it must be configured by a command:


    Code:
    iw dev wlan0 set 4addr on
    How this command can be added to automatic configuration?

    Next, I've plan to start wpa_supplicant for AP mode.

    Well, is it wrong way? Do you know more simple decision?

  2. #2
    Join Date
    Sep 2012
    Posts
    6,369

    Default Re: WIFI AP on hotplug usb device.

    Quote Originally Posted by HenryPootel View Post
    I've configuration of wlan interface in ifcfg-wlan0 ... and ifcfg-br0 Next, I've plan to start wpa_supplicant for AP mode.
    You got it backwards. First you must create AP mode interface which then can be added to bridge.
    I know, to add wifi interface to bridge it must be configured by a command:
    Code:
    iw dev wlan0 set 4addr on
    This is only if you want to do WDS (i.e. forward packets between different AP). AP by definition forwards packets between WiFi and Ethernet so does not need any special settings for this. See
    https://networkengineering.stackexch...1-frame-header

    While setting 4addr on client side allows it to be added to bridge, it will not work unless your AP also supports it.

    Do you know more simple decision?
    Usually AP mode is managed by hostapd which can be configured either in bidged or in NAT mode and adds interface to bridge itself. NetworkManager can create AP, you may be interested in this thread

    https://serverfault.com/questions/99...os-8-or-fedora

    wicked is certainly the wrong tool here.

  3. #3

    Default Re: WIFI AP on hotplug usb device.

    Quote Originally Posted by arvidjaar View Post
    First you must create AP mode interface which then can be added to bridge.
    Ok, I've made an interface (Please check, is it right?):
    Code:
    root@BELKA:/etc/sysconfig/network# cat ifcfg-wlan_nick0 
    BOOTPROTO='none' 
    STARTMODE='hotplug' 
    WIRELESS_ESSID='DELETED' 
    WIRELESS_AUTH_MODE='psk' 
    WIRELESS_MODE='master' 
    WIRELESS_WPA_PSK='DELETED' 
    WIRELESS_AP_SCANMODE='1' 
    LINK_REQUIRED='no' 
    ZONE='internal'
    

    and add this interface to bridge:
    Code:
    root@BELKA:/etc/sysconfig/network# cat ifcfg-br0  
    STARTMODE='auto' 
    BOOTPROTO='static' 
    USERCONTROL='no' 
    IPADDR='172.30.1.1/27' 
    BRIDGE='yes' 
    BRIDGE_PORTS="eth_GRAY wlan_nick0" 
    BRIDGE_STP='off' 
    BRIDGE_FORWARDDELAY='0' 
    LINK_REQUIRED='no' 
    ZONE='internal'
    

    After reboot the WLAN interface is not added to bridge:
    Code:
    root@BELKA:/etc/sysconfig/network# brctl show       
    bridge name     bridge id               STP enabled     interfaces 
    br0             8000.5adeebd60847       no              eth_GRAY
    

    But I can add it to bridge:
    Code:
    root@BELKA:~# brctl addif br0 wlan_nick0 
    can't add wlan_nick0 to bridge br0: Operation not supported 
    root@BELKA:~# iw dev wlan_nick0 set 4addr on  
    root@BELKA:~# brctl addif br0 wlan_nick0     
    root@BELKA:~# brctl show                                
    bridge name     bridge id               STP enabled     interfaces 
    br0             8000.5adeebd60847       no              eth_GRAY 
                                                            wlan_nick0 
    root@BELKA:~# 
    
    I think, 'iw dev wlan_nick0 set 4addr on' is necessary. Else, how it possible to add wifi interface to bridge?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •