Skip to content

Instantly share code, notes, and snippets.

Last active May 12, 2024 11:26
Show Gist options
  • Save francoism90/3dede7973354d067c41bff5e54203fe9 to your computer and use it in GitHub Desktop.
Save francoism90/3dede7973354d067c41bff5e54203fe9 to your computer and use it in GitHub Desktop.
Change country to unlock channels, increase TX-power. (Use at your own risk)


Following instructions are provided without any warranty, and may even get you in trouble legally. The instructions are provided for testing, and should be use with care. We (including commentators) are not responsible for any damage to your device(s).


This may enable additional channels and power (in most cases don't) on ASUS Merlin provided routers.

The nvram settings have been tested on a ASUS RT-AX58U, they may work on other models as well (ASUS RT-AC78U).

Please use nvram dump and adjust when needed, as they may differ on your device!

Credits to the commentators below, and members on the SNBForums posting instructions. Please post your findings, and help others when needed. :)

Login into router using SSH

See for instructions.

Backup current settings

nvram dump > dump.txt

NOTE: You need to copy the dump.txt (or output by nvram dump to somewhere else, as they will be lost on reboot

JFFS custom scripts and configs

Make sure Enable JFFS custom scripts and configs, is enabled in System settings. See for details.

Create a /jffs/scripts/wl file, and paste the nvram overwrites into this file (see given example file).

Create/adjust /jffs/scripts/init-start:


[ -x /jffs/scripts/wl ] && /jffs/scripts/wl &
# [ -x /jffs/addons/AdGuardHome.d/ ] && /jffs/addons/AdGuardHome.d/ init-start & # place before addons

Create/adjust /jffs/scripts/services-start:


cru a wl "0 */8 * * * /jffs/scripts/wl"

Make sure the scripts are executable:

chmod a+rx /jffs/scripts/*

Applying changes

You need to reboot the router to apply changes

Please note changing settings in the UI, may undo nvram changes.

It is recommended to change settings using CLI instead:

nvram set wl1_chanspec=149/160
# nvram set wl1_chanspec=149/80
# nvram set wl1_chanspec=48
service restart_wireless

To make the changes persistent, make sure to add them to the jffs/scripts/wl script.

# Allow all channels
nvram set location_code=#a
nvram set 0:ccode=#a
nvram set 0:regrev=0
nvram set 1:ccode=#a
nvram set 1:regrev=0
nvram set territory_code=CN/02 # or US/02
nvram set wl_country_code=#a
nvram set wl_reg_mode=h
nvram set wl0_chlist="1 2 3 4 5 6 7 8 9 10 11 12 13 14"
nvram set wl0_country_code=#a
nvram set wl0_country_rev=0
nvram set wl0_reg_mode=h
nvram set wl1_chlist="36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 149 153 157 161 165 169 173 177"
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=h
nvram set acs_dfs=0
nvram set wl_acs_excl_chans_dfs=
nvram set wl_acs_excl_chans=
nvram set wl0_acs_dfs=0
nvram set wl0_acs_excl_chans_base=
nvram set wl0_acs_excl_chans=
nvram set wl1_acs_dfs=0
nvram set wl1_acs_excl_chans_base=
nvram set wl1_acs_excl_chans=
nvram set acs_unii4=1
# Channel selection
# nvram set wl0_chanspec=0 # auto select
# nvram set wl1_chanspec=0 # auto select
# nvram set wl_chanspec=0 # auto select
# nvram set wl0_sel_channel=7/80 # force 2.4GHz channel
# nvram set wl1_sel_channel=149/80 # force 5GHz channel
# Set TX-Power (risky!)
nvram set 0:maxp2ga0=120
nvram set 0:maxp2ga1=120
nvram set 1:maxp5gb0a0=120
nvram set 1:maxp5gb0a1=120
nvram set 1:maxp5gb0a2=120
nvram set 1:maxp5gb0a3=120
nvram set 1:maxp5gb1a0=120
nvram set 1:maxp5gb1a1=120
nvram set 1:maxp5gb1a2=120
nvram set 1:maxp5gb1a3=120
nvram set 1:maxp5gb2a0=120
nvram set 1:maxp5gb2a1=120
nvram set 1:maxp5gb2a2=120
nvram set 1:maxp5gb2a3=120
nvram set 1:maxp5gb3a0=120
nvram set 1:maxp5gb3a1=120
nvram set 1:maxp5gb3a2=120
nvram set 1:maxp5gb3a3=120
nvram set 1:maxp5gb4a0=120
nvram set 1:maxp5gb4a1=120
nvram set 1:maxp5gb4a2=120
nvram set 1:maxp5gb4a3=120
nvram set wl0_txpower=500
nvram set wl1_txpower=500
nvram set wl_txpower=500
# Commit changes
nvram commit
Copy link

Reeplosin commented Mar 24, 2024 via email

Copy link

Warborn123 commented Apr 23, 2024

I just noticed that the location of my router sends by the beacon is: DE, which presumably stands for Germany? Although my ccode and location code are set to US. I bought my router(ASUS BE98)here in the UK. Very strange. Can confirm this using S24 Ultra and winfi
I'm more confused about my iPhone 15PM and AX210 that decided not to work with the 6GHz band.

Copy link

omrij commented Apr 26, 2024

Guys, bad news. I think someone in ASUS saw our posts, after the last firmware update, I cannot change my ccode and country rev anymore... It will remain as US for my router now...

Doesn't work in what method? changing nvram or using wl commands?

Copy link

omrij commented Apr 26, 2024

when using just this:

nvram set location_code=#a
nvram commit

don't you get all the channels/max power?

Copy link

Sorry for the misinformation. It still works...My bad.

Copy link

omrij commented May 3, 2024

Does anyone know how to disable DFS using nvram without changing country/local/transmit power?
I can do it using wl command but it's not persistent.

Copy link

I think you need to change the country, as the chipset/firmware probably does some testing if it even can be disabled.

You don't have to change the transmit power. It's there as a reference.

Just a reminder: even when setting a different country or TX-power, it doesn't mean it actually works. The Intel chipsets most people have on their end devices, does some hidden checking and makes it really difficult to workaround certain 'hacks'.

So the given instructions, may or may work. It depends on your setup and maybe a bit of luck.

Copy link

omrij commented May 3, 2024

Thanks, I guess I'll stick with wl method using services-start which works for me (but I wish it was persistent)

Copy link

pasko-zh commented May 4, 2024

Hi Does anyone know how to disable DFS using nvram without changing country/local/transmit power? I can do it using wl command but it's not persistent.

Just put all your WL commands in a bash script. Run it manually after a reboot of your router. I mean, I reboot my router once year or so...
Or, put in a script which is run after reboot, see documentation here

Copy link

omrij commented May 4, 2024

That's the way I do it now
Using services-start script and also service-event-end script (so it's running after every change made in wireless settings).
It's still more convinent to make the changes once using nvram which is also applicable to asuswrt and not only Merlin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment