[SOLVED] WLAN doesn't stay in bridge

Starkeeper

New Member
Nov 30, 2018
3
0
1
124
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?
 
wlan devices does not work with bridges...
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.
 
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
 
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.
 
glad it worked out! Please mark the thread as solved - so that others know what to expect. Thanks!
 
  • Like
Reactions: Go_oG
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?
Are you using hostapd to connect to the wifi router and then bridge the wlp2s0 to vmbrX?
 
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.
Same problem here, same resolution, just added bridge=vrbm1 in hostapd.conf, and it's done!
Thank you!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!