# What is the correct Regdomain code?



## neilms (Apr 9, 2017)

Hi
I am setting up FreeBSD on my laptop for use as a development machine only. I don't plan on installing any gui etc and will just use the console.
I had FreeBSD installed on this machine before but I must have not set it up correctly and want to try harder to get it right.
I will need a internet connection only to download updates and install packages from time to time.
I'm going through the installation steps now and there is a dialogue box that says select your regdomain. There is a list of codes but I'm not sure which one I should use. I live in the UK. Can anyone help me with this? Thanks.


----------



## ralphbsz (Apr 9, 2017)

This controls how your WLan client is configured: Not all countries use the same frequencies, same power, and so on.  The weird things about regdomain include: (a) there is a level of indirection, in the US we say regdomain=FCC and in Europe presumable regdomain=ETSI (those are the standards/regulatory agencies that make the definitions), and (b) the country is not specified as a 2-letter code but as a full name.

For UK = GB, you probably need to set regdomain = ETSI, and country = "United Kingdom" (not UK).  Don't worry too much about setting it right initially; you can always fix it later in an ifconfig command for wlan.  Or ignore the wireless interface temporarily and string an Ethernet cable.


----------



## Phishfry (Apr 9, 2017)

What I have found is most wireless modules are set according to the market they will serve. For instance a module bought off ebay US would probably be set for FCC use, but if this module was used in another country then you might need to worry about country code in module firmware.

https://wiki.freebsd.org/WiFiRegulatory


----------



## neilms (Apr 9, 2017)

I'll have another go soon. I just selected a random one and the wireless didn't work at all. Thank you for your replies.


----------



## ShelLuser (Apr 9, 2017)

I'd go with US. I'm using a wifi dongle in my laptop and it was manufactured somewhere in China I believe, and used within Europe yet it still uses US.

_Edit:_ I think I'm mixing up my facts here a little bit. Right now I'm specifically referring to country code which got me a bit of trouble when I tried to set up my wifi through ifconfig.

_Edit2:_ `# ifconfig wlan0 list regdomain` that might be able to give you a good clue as to what you might want to use.

And since I'm editing anyway...

For what's it worth: to get my dongle to work I also had to use a specific 3rd party firmware supplied through the Ports collection (net/bwn-firmware-kmod) before it would work at all. Obviously I can't say that this also applies to your setup, but it's something to keep in mind.

Further more: /etc/wpa_supplicant.conf. See also wpa_supplicant(8). I'm using a hidden SSID on my network and the only way I could get this to work was using this approach. A small snippet:


```
network={
        ssid="<my hidden SSID name>"
        scan_ssid=1
        key_mgmt=WPA-PSK
        auth_alg=OPEN
        psk=<my hidden hexadecimal password>
        priority=10
}
```
The reason I mention this is because I have no idea how the installation procedure handles all this. But if it doesn't support this approach then I wouldn't worry too much about your wifi not working right away because you might be able to get it working afterwards.


----------



## xtaz (Apr 10, 2017)

I too live in the UK and I set this in /etc/rc.conf

```
create_args_wlan0="country GB"
```
If you look in /etc/regdomain.xml you can see that GB maps to etsi. So yes, select GB or etsi. That works fine for me.


----------



## Chris_H (Apr 18, 2017)

xtaz is _exactly_ right. *That* is what the installer was asking for. I know this, because I _just_ went through the whole ordeal _the hard way_. 

Good luck!

--Chris


----------



## vince66 (Jun 13, 2018)

Could be help:

Regulatory Domains by Country


----------



## grahamperrin@ (Dec 29, 2018)

Phishfry said:


> https://wiki.freebsd.org/WiFiRegulatory



That page no longer exists, we have:

https://wiki.freebsd.org/WiFi/RegulatoryDomainSupport
https://wiki.freebsd.org/WiFi/RegulatoryDomainSupport/Requirements



xtaz said:


> … select GB or etsi. …



I thnk: `etsi`, not `GB`, because the two are not synonymous for `regdomain` purposes.

Bearing in mind, the invitation to select a `regdomain` (not just a `country`) during installation of FreeBSD.


```
root@momh167-gjp4-8570p:~ # grep wlan /etc/rc.conf
create_args_wlan0="country GB regdomain etsi"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
root@momh167-gjp4-8570p:~ #
```


```
root@momh167-gjp4-8570p:~ # grep -A 2 GB /etc/regdomain.xml
<country id="GB">
  <isocc>826</isocc> <name>United Kingdom</name> <rd ref="etsi"/>
</country>
root@momh167-gjp4-8570p:~ #
```


----------



## xtaz (Dec 30, 2018)

Yep. Since I wrote that post I have worked that out myself. I now use the same as you posted. "regdomain ETSI country GB".


----------



## Phishfry (Jan 13, 2020)

I had a wireless module that was showing debug and had to force it. For the US:
create_args_wlan0="regdomain FCC country US"


----------



## cloud8111 (Jan 13, 2020)

The countrycode and regdomain settings control the channels the card can operate on, as well as maximum transmission power, whether active scanning can be used, where and how ad-hoc mode can be used and also whether DFS and TPC (802.11h) support is required.


----------



## jomm (Aug 16, 2021)

Chris_H said:


> xtaz is _exactly_ right. *That* is what the installer was asking for. I know this, because I _just_ went through the whole ordeal _the hard way_.
> 
> Good luck!
> 
> --Chris


Wow! I'm up against the same issue - I wouldn't have guessed that the small list of regdomains (in pairs, some with a country as the first or second part of the 'pair', some with just two regdomains) was a prompt to drop out of the installer and manually edit a configuration file!

Anyway 'No wireless networks were found. Rescan?'

This aspect of the installer is quite a deal-breaker in some ways, and will definitely put people off if they have been using other Unix-like OSes! It would be awesome to be able to detect WiFi networks (it is such a shame, because the WiFi device I am using is supported in FreeBSD, and while it not may be the regdomain, it just won't find any networks, but it does on mac, Debian (including Ubuntu), Windows, etc!


----------



## grahamperrin@ (Aug 16, 2021)

jomm said:


> the WiFi device



What is it?


----------



## grahamperrin@ (Jan 8, 2022)

Vull said:


> … Also incidentally …:
> 
> For me, `create_args_wlan0="country US"` and it has never been necessary (for me) to specify regdomain.
> When I use the USB installer to configure wireless networking while installing 13.0-RELEASE, it allows me, but notably, _doesn't require me_, to specify regdomain.
> regdomain is not case-sensitive. For country code US, /etc/regdomain.xml specifies rd id="fcc" but <rd id="fcc"> specifies <name>FCC</name>. I get the same results whether I use "FCC" or "fcc" for regdomain in my /etc/rc.conf file. I've tried it all three ways, just to be certain of this. Quoting from /etc/regdomain.xml, "Regdomain code gets this information with the IEEE80211_IOC_DRIVERCAPS ioctl." 𡀦…



I can't recall (and can't easily test), does a prompt for regdomain appear _automatically_ if the person installing chooses a WLAN configuration?

bsdinstall(8) `netconfig` mentions `wlanconfig`, which is probably:

https://github.com/freebsd/freebsd-src/blob/main/usr.sbin/bsdinstall/scripts/wlanconfig



Vull said:


> _*[FONT=monospace]riemannesco[/FONT]*_'s  country code is probably "FR" for France



I imagine so. Elsewhere, riemannesco /u/riemannesco wrote: "… la nationalité suisse en habitant en France, …".

Seeing the `etsi2` discrepancy for `AT`, I wondered whether something other than `etsi` might be appropriate for `FR`. I found a few documents on the Internet with other codes, but nothing definitive. (I find much of it quite mysterious. I can't complain, when one of the initially interesting documents appeared to be an unauthorised copy of something confidential.)

<https://en.wikipedia.org/wiki/IEEE_802.11#Regulatory_domains_and_legal_compliance>




vince66 said:


> Could be help:
> 
> Regulatory Domains by Country



It certainly was helpful, thanks, however the site is now down. In the Wayback Machine (nothing more recent): 

<https://web.archive.org/web/2021030...mmitdata.com/Documents/Regulatory_Domains.pdf>


----------

