morrownr / rtl8852bu

Linux Driver for USB WiFi Adapters that are based on the RTL8832BU and RTL8852BU Chipsets - v1.19.3 - 20230505
Other
81 stars 13 forks source link

Driver does not support switching network namespaces (set_wiphy_netns) #13

Open sipefree opened 7 months ago

sipefree commented 7 months ago

I was trying to set up this driver for use in an LXC container running hostapd, but I was unable to because LXC cannot switch the network namespace of the physical device created by this driver.

# pct start 106
command failed: Operation not supported (-95)
lxc_network_move_created_netdev_priv: 3549 Operation not permitted - Failed to move network device "wlxc83a35b44625" with ifindex 27 to network namespace 1106187 and rename to phys12kZU4
lxc_spawn: 1840 Failed to create the network
__lxc_start: 2107 Failed to spawn container "106"
startup for container '106' failed

Neither can you manually change the namespace when the container is started:

# iw phy phy1 set netns 1096930
command failed: Operation not supported (-95)

This is because the driver does not support the set_wiphy_netns command:

# iw phy phy1 info
[...]
    Supported commands:
         * new_interface
         * set_interface
         * new_key
         * start_ap
         * new_station
         * set_bss
         * join_ibss
         * set_pmksa
         * del_pmksa
         * flush_pmksa
         * remain_on_channel
         * frame
         * set_channel
         * tdls_mgmt
         * tdls_oper
         * connect
         * disconnect
         * channel_switch
[...]

Implementing this command would enable the flexible use of RTL8852BU hardware as an Access Point in a more secure setup, such as using LXC containers to run hostapd, or by providing such a virtual machine with its own wlan NIC.

morrownr commented 7 months ago

Hi @sipefree

This is because the driver does not support the set_wiphy_netns command...

I understand. I wish Realtek did a better job supporting their products under Linux but they do not. I work hard to help users that already own selected Realtek based adapters to make the best of them that they can but adding new features would take more time than I have available.

I checked and the following usb wifi chipsets do support the set_wiphy_netns command:

mt7921au mt7612u mt7610u

The Main Menu for this site is:

https://github.com/morrownr/USB-WiFi

Reading menu items 1 and 2 should be of help to you.

Regards,

@morrownr

kimocoder commented 7 months ago

Added NET_NS to rtl8812au few years ago, it's fairly simply. (aircrack-ng version)

morrownr commented 6 months ago

@kimocoder

Thanks. I will take a look.