WiFi country issue (OpenWRT 23.05)

I have just seen that when I set the same country in WiFi configuration to all wireless interfaces as follows:

config wifi-device 'radio0'
          option country 'IT'
[...]
config wifi-device 'radio1'
          option country 'IT'

and then I check the status using:
iw reg get

the section global returns the assigned country, however the sections for each interface return the default country for that router.

For example if I set the country to 'IT' to both WiFi interfaces on a BT Home Hub 5, iw reg get returns:

global
country IT: DFS-ETSI
[...]

phy#1
country GB: DFS-ETSI
[...]

phy#0
country GB: DFS-ETSI
[...]

whilst if I set country = 'IT' to both WiFi interfaces of an R7800 or an EA8500 (same chipset), iw reg get returns:

global
country IT: DFS-ETSI
[...]

phy#1
country US: DFS-FCC
[...]

phy#0
country US: DFS-FCC
[...]

The same happens with Linksys EA8300, EA8500, MR8300 and Netgear R7800
However the radio country for each of the above devices varies. EA8300 and MR8300 have GB, EA8500 and R7800 have US. This messes up greatly my WiFi configuration as I have several routers/repeaters around the premises.

Is this the expected behaviour? Is this a defect? How do I ensure that the country is consistent across all devices?

[Moved to "For Developers" as this looks like a bug]

Note: For those who do not read books and newspapers [...] means "omissis" (omitting irrelevant information) to unclutter the message

Use your actual country code across all devices.

1 Like

How does this answer my question? I do use my country across all devices, but the physical devices report a different (likely default) country, so my setting is ignored! Why? Is this a defect?

Might want to take a look

1 Like

Are you setting your country on both radios? Now that a single instance of hostapd is used for both radios, it is essential that both radios be set to the same country. Setting only one and leaving the other unset can lead to this.

3 Likes

Yes, I am setting the same country to both radios (3 radios for MR8300 and EA8300), however this appears to have no effect because 'iw reg get' shows that the radios are configured with a different country (please see above), that I assume is the routers' default.

Please could anyone with one of the routers listed above confirm the issue reported with the country not being assigned correctly to the wireless interfaces?

I have a 2xR7800 and get the same behavior, if I assign both to the same country then "Global" is set to my country, the phy#1 and #0 are set to US.

Note this also occurs 22.03.05.

So if this is a bug then its an old(er) bug. It may have no effect though.

Asus Lyra MAP-2200

cat /etc/openwrt_release | grep TARGET
DISTRIB_TARGET='ipq40xx/generic'
iw reg get | grep -A1 'global\|phy'
global
country JP: DFS-JP
--
phy#2
country US: DFS-FCC
--
phy#1
country US: DFS-FCC
--
phy#0
country US: DFS-FCC

Mikrotik CAP-AC

cat /etc/openwrt_release | grep TARGET
DISTRIB_TARGET='ipq40xx/mikrotik'
iw reg get | grep -A1 'global\|phy'
global
country JP: DFS-JP
--
phy#1
country US: DFS-FCC
--
phy#0
country US: DFS-FCC

Redmi Ax6s only show global

cat /etc/openwrt_release | grep TARGET
DISTRIB_TARGET='mediatek/mt7622'
iw reg get | grep -A1 'global\|phy'
global
country JP: DFS-JP
1 Like

Since most devices have their country code hardcoded two examples
region free Cudy WR3000

root@wr3000:~# iw reg get
global
country PA: DFS-FCC
        (2400 - 2483 @ 40), (N/A, 36), (N/A)
        (5150 - 5250 @ 80), (N/A, 36), (N/A), AUTO-BW
        (5250 - 5350 @ 80), (N/A, 30), (N/A), AUTO-BW
        (5470 - 5725 @ 160), (N/A, 30), (N/A)
        (5725 - 5850 @ 80), (N/A, 36), (N/A)
        (57000 - 64000 @ 2160), (N/A, 43), (N/A)

AVM 7362SL region DE

root@7362sl:~# iw reg get
global
country PA: DFS-FCC
        (2400 - 2483 @ 40), (N/A, 36), (N/A)
        (5150 - 5250 @ 80), (N/A, 36), (N/A), AUTO-BW
        (5250 - 5350 @ 80), (N/A, 30), (N/A), AUTO-BW
        (5470 - 5725 @ 160), (N/A, 30), (N/A)
        (5725 - 5850 @ 80), (N/A, 36), (N/A)
        (57000 - 64000 @ 2160), (N/A, 43), (N/A)

phy#0
country DE: DFS-ETSI
        (2400 - 2483 @ 40), (N/A, 20), (N/A)
        (5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
        (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
        (5725 - 5875 @ 80), (N/A, 13), (N/A)
        (5945 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

BTW Cudy radio wont work unless region is set so I can imagine why default region is set for a reason.

Thank you for posting your reports.

Is the discrepancy between global and radios expected or is this a defect?