Bridging the wireless adapter with br0

Hello all,

When trying to set up a laptop as LXD host, I wonder what I am missing in this netplan yaml configuration to configure the wireless interface to be the slave of br0 bridge:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: networkd
  wifis:
      wlp2s0:
         dhcp4: no
         dhcp6: no
         access-points:
             "freewifi":
                 password: "secretpassword"
  bridges:
      br0:
          dhcp4: no
          dhcp6: no
          addresses: [192.168.0.12/24]
          nameservers:
              addresses: [192.168.0.254, 1.1.1.1]
          routes:
              - to: default
                via: 192.168.0.254 
          interfaces:
              - wlp2s0
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 5c:26:0a:40:47:c9 brd ff:ff:ff:ff:ff:ff
    altname enp0s25
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 32:84:fb:72:7c:b6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.12/24 brd 192.168.0.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::3084:fbff:fe72:7cb6/64 scope link 
       valid_lft forever preferred_lft forever
4: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 58:94:6b:f2:d4:b8 brd ff:ff:ff:ff:ff:ff
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:67:3b:38:d1 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever

The br0 shows as “UNKNOWN” however, it has the ip address set from the configuration I applied in netplan above. I have not find the way yet to get the state to UP and get connectivity just yet.

Again, this is a laptop that I am trying to make a testing LXD but prefer not to be running cat 6 cables around the room.

If you have any suggestions I will really appreciate it.

Sincerely,

This isn’t really possible because the wifi interface will only be able to use a single MAC address (due to wifi auth) and so bridging additional devices onto it won’t work.

Really! that sucks… a hardware limitation?

I guess the only option I have will be to connect it using the ethernet adapter… :thinking:

Thank you @tomp for the prompt response. I will mark this as a solution then.

Sincerely,

1 Like

A protocol limitation, unless you’re using something like WDS, the MAC address is part of the WIFI client’s authentication to the access point. See Connecting LXD Containers to LAN in Centos 8 - #4 by stgraber

You can use routed NIC for instances being connected to a wireless parent, see

Alternatively see

1 Like

@tomp I will definitely check this out, I already configured the ethernet and the host is running now but I will check those other options you sent me.

I really appreciate it.

Sincerely,

This is my netplan from when during the first COVID lockdown I created a dual Wifi Access point with both a 2.4GHZ and a 5GHZ dongle. The Access point was dealt with by hostapd however I found the only way to enable the Wifi interfaces without making them client wifi devices was to name them in the ethernets. Probably not what you need but its another reference.

Worked fine however it didn’t have the bandwidth I required so moved my existing AP to the middle of the house to improve coverage.

network:
    version: 2
    renderer: networkd
    ethernets:
        eth0:
            dhcp4: false
            addresses: [192.168.0.10/24,192.168.0.1/24]
            gateway4: 192.168.0.254
            nameservers:
                addresses: [192.168.0.254]
            match:
                driver: bcmgenet smsc95xx lan78xx
            set-name: eth0
        wlan1:
            optional: true
        wlan2:
            optional: true

    bridges:
        br0:
            dhcp4: false
            interfaces:
            - wlan1
            - wlan2
            addresses:
            - 192.168.7.1/24
            nameservers:
                addresses:
                - 192.168.7.1
            parameters:
                stp: true
                forward-delay: 0
1 Like

Yes this would work as the wifi parent interface is the access point, rather than being a wifi client.

I apologize for the delayed response, I ended up not following up with that, but I will check that example you proposed and let you know.

Thank you again!