How to use Wifi, as client, from BPI-R2 to shared internet to Ethernet interfaces?

Incorrect

                Frequencies:
                        * 2412.0 MHz [1] (20.0 dBm)
                        * 2417.0 MHz [2] (20.0 dBm)
                        * 2422.0 MHz [3] (20.0 dBm)
                        * 2427.0 MHz [4] (20.0 dBm)
                        * 2432.0 MHz [5] (20.0 dBm)
                        * 2437.0 MHz [6] (20.0 dBm)
                        * 2442.0 MHz [7] (20.0 dBm)
                        * 2447.0 MHz [8] (20.0 dBm)
                        * 2452.0 MHz [9] (20.0 dBm)
                        * 2457.0 MHz [10] (20.0 dBm)
                        * 2462.0 MHz [11] (20.0 dBm)
                        * 2467.0 MHz [12] (20.0 dBm)
                        * 2472.0 MHz [13] (20.0 dBm)
                        * 2484.0 MHz [14] (disabled)
                Frequencies:
                        * 5170.0 MHz [34] (disabled)
                        * 5180.0 MHz [36] (23.0 dBm)
                        * 5190.0 MHz [38] (disabled)
                        * 5200.0 MHz [40] (23.0 dBm)
                        * 5210.0 MHz [42] (disabled)
                        * 5220.0 MHz [44] (23.0 dBm)
                        * 5230.0 MHz [46] (disabled)
                        * 5240.0 MHz [48] (23.0 dBm)
                        * 5260.0 MHz [52] (20.0 dBm)
                        * 5280.0 MHz [56] (20.0 dBm)
                        * 5300.0 MHz [60] (20.0 dBm)
                        * 5320.0 MHz [64] (20.0 dBm)
                        * 5500.0 MHz [100] (26.0 dBm)
                        * 5520.0 MHz [104] (26.0 dBm)
                        * 5540.0 MHz [108] (26.0 dBm)
                        * 5560.0 MHz [112] (26.0 dBm)
                        * 5580.0 MHz [116] (26.0 dBm)
                        * 5600.0 MHz [120] (26.0 dBm)
                        * 5620.0 MHz [124] (26.0 dBm)
                        * 5640.0 MHz [128] (26.0 dBm)
                        * 5660.0 MHz [132] (26.0 dBm)
                        * 5680.0 MHz [136] (26.0 dBm)
                        * 5700.0 MHz [140] (26.0 dBm)
                        * 5745.0 MHz [149] (13.0 dBm)
                        * 5765.0 MHz [153] (13.0 dBm)
                        * 5785.0 MHz [157] (13.0 dBm)
                        * 5805.0 MHz [161] (13.0 dBm)
                        * 5825.0 MHz [165] (13.0 dBm)
                        * 5845.0 MHz [169] (disabled)
                        * 5865.0 MHz [173] (disabled)
                        * 5920.0 MHz [184] (disabled)
                        * 5940.0 MHz [188] (disabled)
                        * 5960.0 MHz [2] (disabled)
                        * 5980.0 MHz [6] (disabled)
                        * 6000.0 MHz [10] (disabled)
                        * 6020.0 MHz [14] (disabled)
                        * 6040.0 MHz [18] (disabled)
                        * 6060.0 MHz [22] (disabled)
                        * 6080.0 MHz [26] (disabled)
virnik@ap-unimatrix:~$ readlink /sys/class/net/wlan0/device/driver
../../../../../../bus/pci/drivers/ath9k
virnik@ap-unimatrix:~$ readlink /sys/class/net/mt6625_0/device/driver
../../../bus/platform/drivers/mt-wifi
virnik@ap-unimatrix:~$ 
virnik@ap-unimatrix:~$ sudo lshw -class network | grep ath9k
       configuration: broadcast=yes driver=ath9k driverversion=5.15.173-bpi-r2-main firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11
       configuration: broadcast=yes driver=ath9k driverversion=5.15.173-bpi-r2-main firmware=N/A ip=10.43.18.98 link=no multicast=yes wireless=IEEE 802.11
virnik@ap-unimatrix:~$ sudo lshw -class network | grep mt-wifi
       configuration: broadcast=yes driver=mt-wifi driverversion=5.15.173-bpi-r2-main multicast=yes
       configuration: broadcast=yes driver=mt-wifi driverversion=5.15.173-bpi-r2-main ip=10.43.17.65 multicast=yes wireless=IEEE 802.11
virnik@ap-unimatrix:~$ 


Tested in AP mode and in client mode. Internal wireless on BananaPi R2 is hybrid, two-interface MAC wireless device. While ath9k loads first and registers wlan0 under its phy0 (which has two layers, one for 2.4GHz, and another for 5GHz), BPi-R2 internal wireless spawns two physical interfaces, both using either wlan0 (if alone with no other wireless card inserted), or as mt6625_0 if wlan0 is already taken. Either way, phy1 and phy2 do represent separate MACs, one for 2.4GHz, and another for 5GHz. The driver switches over to either one depending on configuration and channel requested.

ok, then i remembered wrong…then problem was ac mode missing, only a…but wonder about frequencies go up to 6GHz.

the mt6625_0 is from my changes as the driver created wlanX depending of existing interfaces, but ap-mode always targeted wlan0 and did not startup when another wifi-card was recognized earlier.

not sure why these 2 interfaces are created, but wlan0 should not be created, at least for ap-mode…maybe it is created for client-mode i have not tested in latest versions.

but if you are able to port the driver to 6.1/6.6 maybe some users are happy to keep r2 with internal wifi running…i replaced my r2 with r3 some months ago to have latest lts kernel running.

wlan0 in my case is created by ath9k driver, as I do use Atheros AR958x card for peer link.

Your changes works fine. Haven’t tested AC on internal card, as this will serve guest users from the street, so 802.11n will do fine.

As for 6GHz, it is a matter of modulator in the card and the driver. As I unlocked regdomain limits, all channels the card reports to support are visible. As I am no idiot, I made sure to disable those I won’t ever need. While I do not use DFS and disable it on any router I own, I am picky on frequencies I do use, and occupy. I know local meteo radar frequencies and their directions, as well as military frequencies from nearby military base, so I stay clear from them. Plus, I use tge same channels with the same width and same directions for past 25 years.

But it is ok for within-the-wall testing I was doing.