[SOLVED] WLAN doesn't stay in bridge

Discussion in 'Proxmox VE: Networking and Firewall' started by Starkeeper, Dec 21, 2018.

  1. Starkeeper

    Starkeeper New Member

    Joined:
    Nov 30, 2018
    Messages:
    3
    Likes Received:
    0
    I'm running proxmox on a PC that has a wireless interface (wlp2s0) and I've bridged it into vmbr50. I'm running hostapd in order to turn the wireless interface into an AP. I have everything working. When I run "brctl show" it lists wpl2s0 in bridge vmbr50. When I reboot its no longer in there even though its in the interfaces configuration. hostapd still brings up the AP configuration and I can connect but it does not farm out an IP because the DHCP server interface is on vmbr50. If I run "brctl addif vmbr50 wlp2s0" the test machine gets an IP address.

    I've attempted to write a script with the one command above in init.d ("/etc/init.d/bridge.sh") to join the interface during bootup but it doesn't take. In order to try and get to connect after bootup I've moved the script to crontab using @reboot. I've even tried @reboot sleep 60 && /etc/init.d/bridge.sh. Running the script manually works just fine and causes the interface to join the bridge.

    Any thoughts?
     
  2. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    16,484
    Likes Received:
    314
    wlan devices does not work with bridges...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Starkeeper

    Starkeeper New Member

    Joined:
    Nov 30, 2018
    Messages:
    3
    Likes Received:
    0
    As I mentioned above it does in fact connect to a bridge once you run hostapd and turn the radio into an AP. It joins the bridge as shown below.

    root@proxmox1:~# brctl show
    bridge name bridge id STP enabled interfaces
    vmbr10 8000.80ee73dcd574 no enp0s31f6.10
    tap100i2
    tap101i0
    tap102i0
    vmbr20 8000.80ee73dcd574 no enp0s31f6.20
    tap100i3
    vmbr50 8000.80ee73dcd574 no enp0s31f6.50
    enp1s0
    tap100i1
    vmbr99 8000.80ee73dcd574 no enp0s31f6
    tap100i0
    root@proxmox1:~# brctl addif vmbr50 wlp2s0
    root@proxmox1:~# brctl show
    bridge name bridge id STP enabled interfaces
    vmbr10 8000.80ee73dcd574 no enp0s31f6.10
    tap100i2
    tap101i0
    tap102i0
    vmbr20 8000.80ee73dcd574 no enp0s31f6.20
    tap100i3
    vmbr50 8000.80ee73dcd574 no enp0s31f6.50
    enp1s0
    tap100i1
    wlp2s0
    vmbr99 8000.80ee73dcd574 no enp0s31f6
    tap100i0
    root@proxmox1:~#

    The issue I am running into is that when I run brctl addif vmbr50 wlp2s0 it works just fine. However when I reboot it the interface drops out of the bridge. If I set the command to run in cron using the command

    @reboot sleep 90;brctl addif vmbr50 wlp2s0;touch ~/success

    I see in syslog the command running. I get a file in the home directory called success but I don't get the WLAN interface in the bridge. If I run the exact same command

    sleep 90;brctl addif vmbr50 wlp2s0;touch ~/success

    It works just fine. Note the reason I was using the sleep 90 command was in the event that the interface was taken out by the proxmox config on load I wanted to ensure that it would be put in after proxmox loaded.

    Unfortunately I'm not that knowledgeable about the *nix operating systems.
     
  4. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,380
    Likes Received:
    129
    the problem is probably that brctl is not in the path used by cron (/bin:/usr/bin:/usr/local:bin) - it's in /sbin.

    however - you should be able to specify the bridge where the wifi-interface should be added in the hostapd config - and configure the bridge via /etc/network/interfaces.
    That should make for a cleaner setup.
    hope this helps
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Starkeeper

    Starkeeper New Member

    Joined:
    Nov 30, 2018
    Messages:
    3
    Likes Received:
    0
    Awesome. I didn't even think about hostapd doing it. That worked like a charm. I can now connect to my system even when its stand alone.
     
  6. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,380
    Likes Received:
    129
    glad it worked out! Please mark the thread as solved - so that others know what to expect. Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice