iw reg get
global
country 00: DFS-UNSET
(2402 - 2472 @ 40), (6, 20), (N/A)
(2457 - 2482 @ 20), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
(5170 - 5250 @ 80), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(5250 - 5330 @ 80), (6, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
(5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
(5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
(57240 - 63720 @ 2160), (N/A, 0), (N/A)
Yeah,so domain unset…there are multiple ways to set it and some donnot work in ubuntu
https://wiki.fw-web.de/doku.php?id=en:bpi-r2:wlan#ghz
Have you installed the regdomain package?
iirc the cfg80211 way was working (and manual iw reg set),but of course needs the regulatory.db
I tried iw reg set CZ but iw reg get still returns:
global
country 00: DFS-UNSET
(2402 - 2472 @ 40), (6, 20), (N/A)
(2457 - 2482 @ 20), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
(5170 - 5250 @ 80), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(5250 - 5330 @ 80), (6, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
(5490 - 5730 @ 160), (6, 20), (0ms), DFS, PASSIVE-SCAN
(5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
(57240 - 63720 @ 2160), (N/A, 0), (N/A)
My /etc/hostapd/hostapd_wlan1.conf setting:
ctrl_interface=/var/run/hostapd_2
#ctrl_interface_group=0 # These 2 are just parameters so that the hostap daemon runs.
interface=wlan1
#interface=ap0
driver=nl80211
ssid=r3_AP1
#2.4G
hw_mode=g
channel=1
#5G-Support
country_code=DE
ieee80211n=1
ieee80211d=1
hw_mode=a
#34-50 step 2
#channel=40
#channel=44
channel=36
ieee80211h=1
require_vht=1
ht_capab=[GF][HT40+][SHORT-GI-20][SHORT-GI-40][RX-STBC1][DSSS_CCK-40]
vht_oper_chwidth=1
vht_capab=[SHORT-GI-80][RX-STBC-1][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]
#42 would be the centered frequency center channel number for 36 primary
#channel only if this were a 80 MHz channel, so the combination here is
#invalid. You would either need to change this to use vht_oper_chwidth=1
#or set vht_oper_centr_freq_seg0_idx=0 if you want to use a 40 MHz
#channel.
vht_oper_centr_freq_seg0_idx=42
#channel=60
ieee80211ac=1
wmm_enabled=1
#security
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
#ignore_broadcast_ssid=0
auth_algs=1
#rsn_pairwise=CCMP
#macaddr_acl=0
#accept_mac_file=/etc/hostapd/acl_accept
#deny_mac_file=/etc/hostapd/acl_deny
#macaddr_acl=1
#accept_mac_file=/etc/hostapd/hostapd.allow
Have you installed the regdomain package?
Sorry, but I don’t know how to install the regdomain package. Google didn’t help either. I am trying to create a basic wifi router. I don’t want to use Openwrt because it simply freezes.
apt-get install iw wireless-regdb
Afair crda was not available on ubuntu and i used this
$ sudo nano /etc/modprobe.d/cfg80211.conf
options cfg80211 ieee80211_regdom=US
Found documentation of ubuntu way in my wiki
Hello, Would it be possible to include Docker support in the image? I got the error:
docker run hello-world
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error setting cgroup config for procHooks process: bpf_prog_query(BPF_CGROUP_DEVICE) failed: invalid argument: unknown.
i have added the cgroups_bpf option to my kernel and currently rebuilding images…
can you confirm the wifi-regdomain way works?
edit: pipeline finished…
https://drive.google.com/drive/folders/1A5S7_82Bg4EYxjzdQ5FKyBw9Qi2C3uK-?usp=drive_link
You posted a link to Bookworm 6.6.36. There was no problem with the 5GHz AP. Here the AP works probably fine - I connect to it with a Raspberry Pi 5. Regdomains were problematic in Ubuntu. So I tried the new June 30 Bookworm 6.6.36 image. Docker works fine. I don’t know why wlan1 is not active after boot. I have to activate it in the boot process using
ExecStart=/usr/sbin/hostapd /etc/hostapd/hostapd_wlan1.conf
After boot, wlan1 and wlan0 won’t connect wireless client until I do
systemctl restart systemd-networkd
I also added it to the boot process. Then it works. Perhaps it would like to solve these two shortcomings… Otherwise perfect job!
The link is for all images which are built automaticly for all boards…ubuntu is now noble (24.04).
Hostapd for wlan1 can only start if the regulatory domain is set at this time…but this should only needed for 5g (wlan1)…2g4/wlan0 should work on boot
How to set up a regulatory domain?
Already answered here:
iw reg get
Must NOT show 00
reg get
global
country US: DFS-FCC
(902 - 904 @ 2), (N/A, 30), (N/A)
(904 - 920 @ 16), (N/A, 30), (N/A)
(920 - 928 @ 8), (N/A, 30), (N/A)
(2400 - 2472 @ 40), (N/A, 30), (N/A)
(5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
(5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
(5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
(5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
(5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
(57240 - 71000 @ 2160), (N/A, 40), (N/A)
… but wlan1 is not active after boot.
Not sure about the “global” can you bring hostapd after this is shown?
systemctl restart hostapd2
What does log says (/var/log/hostapd2_error.log,and without error)?
But basicly channels look strange…
German ubuntuusers wiki still refers to crda which was not there in u22,and i guess same in u24
After boot:
systemctl status hostapd2
○ hostapd2.service - Access point and authentication server for Wi-Fi 2 and Ethernet
Loaded: loaded (/lib/systemd/system/hostapd2.service; disabled; preset: enabled)
Active: inactive (dead)
Docs: man:hostapd(8)
After:
systemctl restart hostapd2
No errors.
systemctl status hostapd2
● hostapd2.service - Access point and authentication server for Wi-Fi 2 and Ethernet
Loaded: loaded (/lib/systemd/system/hostapd2.service; disabled; preset: enabled)
Active: active (running) since Mon 2024-07-01 17:17:24 UTC; 40s ago
Docs: man:hostapd(8)
Process: 3555 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd2.pid $DAEMON2_OPTS ${DAEMON_CONF2} (code=exited, status=0/SUCCESS)
Main PID: 3556 (hostapd)
Tasks: 1 (limit: 2298)
Memory: 992.0K
CPU: 40ms
CGroup: /system.slice/hostapd2.service
└─3556 /usr/sbin/hostapd -B -P /run/hostapd2.pid /etc/hostapd/hostapd_wlan1.conf
Jul 01 17:17:24 bpi-r3 systemd[1]: Starting hostapd2.service - Access point and authentication server for Wi-Fi 2 and Ethernet...
Jul 01 17:17:24 bpi-r3 systemd[1]: Started hostapd2.service - Access point and authentication server for Wi-Fi 2 and Ethernet.
Does 5ghz work after restart the service?
I see it is disabled…so try
systemctl enable hostapd2
Then it should start at boot
That I didn’t think of it! It works! I have one more request (perhaps for a long time last). I have lan0 to lan3 ports in bridge. DHCP works on Bridge. I can’t connect wlan0 and wlan1 to Bridge. I need all ports lan and wlan on one DHCP range. My current WLAN0 (and below I WLAN1):
[Match]
Name=wlan0
[Network]
ConfigureWithoutCarrier=true
DHCP=yes
DNS=dhcp
After reboot, the clinet does not join WiFi. Or connect, but does not have access to the Internet. Usually this is solved by systemctl restart systemd-networkd. If WLAN has its adrsional range and DHCP, then the connection is fine. But I don’t need this setting.
If you need all wlan+lan in same ip subnet you have to bridge them and have dhcp/ip config on the bridge…but sometimes wlan in bridge causes some issues,so i avoid this…on r3/r4 there is wed (offloading flow for traffic from wifi to ethernet),but have not done much with it. On r2 i did this with simple rooting…but this requires different subnets like currently configured in my images.
When bridging you have to remove the wifi network configs with fixed ips/dhcp. Maybe you have to define bridge via hostapd config,not via systemd…but why do you care about wifi subnet? It is better to handle in firewall when having dedicated interface not be bridges…but thats my opinion
Indeed, totally leave wlan0/1 out of systemd-networkd and set bridge in hostapd.conf
Yes it’s right! I “moved” the wlan to hostapd and they work fine. Could you sell me how to set a static MAC address for the WAN port? Currently, every time you connect to a router, the parent router receives a random MAC address from the Banana Pi. I tried in /etc/systemd/network/15-wan.network use
[Link]
# Override MAC address (spoof MAC address)
MACAddress=aa:bb:cc:dd:ee:ff
but I won’t connect to the internet.
EDIT: I already solved it. I have to set in /etc/systemd/network/10-wan.link:
[Link]
Name=wan
MACAddressPolicy=none
MACAddress=08:22:33:44:55:77
I apologize for the confusion.