Skip to content

Instantly share code, notes, and snippets.

@francoism90
Last active December 4, 2023 11:56
  • Star 45 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Change country to unlock channels, increase TX-power. (Use at your own risk)

Warning

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).

Introduction

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 https://www.htpcguides.com/enable-ssh-asus-routers-without-ssh-keys/ 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 https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts 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:

#!/bin/sh

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

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

#!/bin/sh

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.

#!/bin/sh
# 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
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_unii4=1
nvram set wl_acs_excl_chans_dfs=
nvram set wl_acs_excl_chans=
nvram set wl0_acs_dfs=1
nvram set wl0_acs_excl_chans_base=
nvram set wl0_acs_excl_chans=
nvram set wl1_acs_dfs=1
nvram set wl1_acs_excl_chans_base=
nvram set wl1_acs_excl_chans=
# 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
@barkmarkin
Copy link

wl txpwr_target_max shows

Maximum Tx Power Target (chanspec:0x100b): 28.00 28.00 28.00 28.00

On my ax88u pro. Is this too high or within limtis of the router? I dont want to damage it,
Also this is from someone here who possted for their ax86u, It gave them 26.00

Put this in init-start

#!/bin/sh
nvram set location_code=US
nvram set asuscfe0:ccode=#a
nvram set asuscfe1:ccode=#a
nvram set asuscfe0:regrev=0
nvram set asuscfe1:regrev=0
nvram set asuscfecommit=1
nvram set 0:regrev=0
nvram set 1:regrev=0
nvram set 0:ccode=#a
nvram set 1:ccode=#a
nvram set pci/1/1/ccode=#a
nvram set pci/1/1/regrev=0
nvram set pci/2/1/ccode=#a
nvram set pci/2/1/regrev=0
nvram set regulation_domain=#a
nvram set regulation_domain_5G=#a
nvram set wl_country_code=#a
nvram set wl_country_rev=0
nvram set wl0_country=#a
nvram set wl0_country_code=#a
nvram set wl0_country_rev=0
nvram set wl0_reg_mode=h
nvram set wl1_country=#a
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=h
nvram set 0:maxp2ga0=0x78
nvram set 0:maxp2ga1=0x78
nvram set 0:maxp2ga2=0x78
nvram set 1:maxp5ga0=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga1=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga2=0x78,0x78,0x78,0x78
nvram set wl_txpower=708
nvram set wl0_txpower=708
nvram set wl1_txpower=708

nvram set wl1_chanspec=161/80
nvram set territory_code=US/02

nvram commit

@barkmarkin
Copy link

barkmarkin commented Aug 17, 2023

#!/bin/sh
nvram set location_code=US
nvram set asuscfe0:ccode=#a
nvram set asuscfe1:ccode=#a
nvram set asuscfe0:regrev=0
nvram set asuscfe1:regrev=0
nvram set asuscfecommit=1
nvram set 0:regrev=0
nvram set 1:regrev=0
nvram set 0:ccode=#a
nvram set 1:ccode=#a
nvram set pci/1/1/ccode=#a
nvram set pci/1/1/regrev=0
nvram set pci/2/1/ccode=#a
nvram set pci/2/1/regrev=0
nvram set regulation_domain=#a
nvram set regulation_domain_5G=#a
nvram set wl_country_code=#a
nvram set wl_country_rev=0
nvram set wl0_country=#a
nvram set wl0_country_code=#a
nvram set wl0_country_rev=0
nvram set wl0_reg_mode=h
nvram set wl1_country=#a
nvram set wl1_country_code=#a
nvram set wl1_country_rev=0
nvram set wl1_reg_mode=h
nvram set 0:maxp2ga0=0x78
nvram set 0:maxp2ga1=0x78
nvram set 0:maxp2ga2=0x78
nvram set 1:maxp5ga0=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga1=0x78,0x78,0x78,0x78
nvram set 1:maxp5ga2=0x78,0x78,0x78,0x78
nvram set wl_txpower=708
nvram set wl0_txpower=708
nvram set wl1_txpower=708

nvram set wl1_chanspec=161/80
nvram set territory_code=US/02

nvram commit

This script works like charm for Asus RT-AX86U with latest firmware from Asuswrt-Merlin v388.1. wl txpwr_target_max returns 26.00 26.00 26.00 and channels unblocked. Even after router reboot or changing wifi bandwidth/channel. My router original territory_code was UK/02

This works on my ax88u pro and shows 28.00 28.00 28.00 28.00. But when I change any settings after turning it off than on, it goes back down to 24.00 24.00 24.00 24.00 how can I prevent this?

@francoism90
Copy link
Author

@barkmarkin Did you paste them in init-start as well?

A workaround (if init-start doesn't do the trick) is using a cronjob.

@barkmarkin
Copy link

@barkmarkin Did you paste them in init-start as well?

A workaround (if init-start doesn't do the trick) is using a cronjob.

İ used winscp to copy it into init start jffs folder it works what is a cronjob,? I'm code disabled

@barkmarkin
Copy link

@barkmarkin https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts#creating-scripts

Make sure the script is executable.

Well it is. Maybe it's not the right settings for ax88u pro but it's all fine unless I change a setting and if I reboot its 28 again and settings persist

@francoism90
Copy link
Author

@barkmarkin https://gist.github.com/francoism90/3dede7973354d067c41bff5e54203fe9?permalink_comment_id=4620888#gistcomment-4620888

See note/warning - changing (WiFi) settings using the UI, will overrule the nvram changes.

@francoism90
Copy link
Author

I have improved the instructions, based on comments given on this gist (many thanks for that!).

If anything is missing, please let me know. :)

@barkmarkin
Copy link

Well thank you if it says 28 then I'm getting the most out of my device correct?

@francoism90
Copy link
Author

francoism90 commented Aug 21, 2023

@barkmarkin It all depends, even if your router uses a different country, the device still can use different/legit settings. I think 28 in tx power?

I've done some reading, and tried multiple things, but it seems WiFi is able to send a signal, which make sure no one can actually change the country, as like forcing Germany when being in the EU.

As said in the disclaimer, it may work, but results may vary.

@ovidiu4
Copy link

ovidiu4 commented Sep 14, 2023

Hi guys,

None of the settings from above worked on my ASUS ZenWiFi Pro ET12.
I am trying to enable the 6GHz channel but nothing seems to work.

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 2:ccode=#a nvram set 2:regrev=0 nvram set territory_code=CN/02 nvram set wl_country_code=#a nvram set wl_reg_mode=h nvram set wl2_country_code=#a nvram set wl2_country_rev=0 nvram set wl2_reg_mode=h nvram set acs_unii4=1 nvram set wl_acs_excl_chans_dfs= nvram set wl_acs_excl_chans= nvram set wl2_acs_dfs=1 nvram set wl2_acs_excl_chans_base= nvram set wl2_acs_excl_chans=

Does anyone have any idea what else they may be locking on this router?

@Doc-Steve
Copy link

Doc-Steve commented Nov 21, 2023

Hi, does anyone know which settings change the "PRE-ISM Channel Availability Check (CAC)" for DFS-channels? I don't want to switch DFS off with #a, In-Service-Monitoring is fine and I think necessary. But I'd like to reduce the initial wait time for the WLAN to come up scanning for 60s after every reboot or WLAN channel change. Any tips appreciated - thanks in advance.

@francoism90
Copy link
Author

@ovidiu4 @Doc-Steve Please use nvram dump, and check the values.

Hopefully you can force this, by changing the nvram setting.

@ovidiu4
Copy link

ovidiu4 commented Dec 4, 2023

@francoism90 there are literally 5000 lines in the nvram dump and i have no idea what to look for...
Somehow the radio for the 6GHz band is disabled because even though i can change any settings i want, there is no network broadcasting. Asus technicians are useless like always so i am stuck

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