Page MenuHomeVyOS Platform

vyos-1x: WiFi Regulatory Domain should be set system-wide instead of per-device
Open, NormalPublicBUG

Description

Wireless devices are subject to regulations issued by authorities. For any given AP or router, there will most likely be no case where one wireless NIC is located in one country and another wireless NIC in the same device is located in another country, resulting in different regulatory domains to apply to the same box.

Bug:

Currently, wireless Regulatory Domains in VyOS need to be configured per-NIC:

set interfaces wireless wlan0 country-code us

This leads to several side-effects:

  1. When operating multiple WiFi NICs, they all can have different RegDomains configured which might offend legislation.
  2. Some NICs need additional entries to /etc/modprobe.d/cfg80211.conf to apply RegDom settings, such as: options cfg80211 ieee80211_regdom=US. This is true for the Compex WLE600VX. This setting cannot be done per-interface.
  3. Newer standards, drivers and implementations of IEEE 802.11 might or might not abandon this module parameter, and it is hard to foresee the future here.

Suggested fix:

Along with a matching parameter setting in /etc/modprobe.d/cfg80211.conf, this setting has to be automatically set for a system-wide and unique configuration stanza in /var/run/hostapd/wlanN.conf (Ref: https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf):

# Country code (ISO/IEC 3166-1). Used to set regulatory domain.
# Set as needed to indicate country in which device is operating.
# This can limit available channels and transmit power.
# These two octets are used as the first two octets of the Country String
# (dot11CountryString)
#country_code=US

Details

Difficulty level
Unknown (require assessment)
Version
1.4-rolling-202404091022
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav triaged this task as Normal priority.Thu, May 9, 1:54 PM

I'm unsure here. But I have two suggestions:

  1. "system": we had it just there a few years ago. Then, at some point, it vanished from there and there must have been a reason for this.
  2. "interfaces wireless": as it is a setting affecting all wireless LAN interfaces but would not be needed by anyone not using WiFi. So for the non-WiFi folks, this setting would stay out of their way.