What's new

[RT-AC66U] Finding Default Settings Location

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

wweigand

New Around Here
Hello,

I'm looking to be able to edit the default settings the router falls back to when the reset button is triggered. I found this post: https://www.snbforums.com/threads/faq-nvram-and-factory-default-reset.22822/ which says:

" The first time a router boots, it will start by copying various default settings from the bootloader (or CFE in the case of Broadcom's routers). Once it starts booting the firmware itself, another set of default settings are taken from the firmware, and written back to nvram. "

I was able to dump mtd0 (boot/cfe), and I do see that it has some settings such as MAC, region, model, but not a fraction of the settings stored in NVRAM. I assume the location of the rest of the defaults are what the bolded part of the quote is referring to, but I have been unable to locate where I can find or edit them. If it helps, I specifically want to edit "sshd_enable", for example, but there are others I would like to change that I assume are in the same location.

I would appreciate it if anyone can point me in the right direction to finding these or if someone knows where they are.
 
Hello,

I'm looking to be able to edit the default settings the router falls back to when the reset button is triggered. I found this post: https://www.snbforums.com/threads/faq-nvram-and-factory-default-reset.22822/ which says:

" The first time a router boots, it will start by copying various default settings from the bootloader (or CFE in the case of Broadcom's routers). Once it starts booting the firmware itself, another set of default settings are taken from the firmware, and written back to nvram. "

I was able to dump mtd0 (boot/cfe), and I do see that it has some settings such as MAC, region, model, but not a fraction of the settings stored in NVRAM. I assume the location of the rest of the defaults are what the bolded part of the quote is referring to, but I have been unable to locate where I can find or edit them. If it helps, I specifically want to edit "sshd_enable", for example, but there are others I would like to change that I assume are in the same location.

I would appreciate it if anyone can point me in the right direction to finding these or if someone knows where they are.

Are you wanting to change settings not in the webUI?

OE
 
Are you wanting to change settings not in the webUI?

OE

I would like to be able to change all the settings in nvram in the location they are pulled from when the router is reset. The idea being that when the router is reset I can maintain SSH access, password stays the same, etc. The reason I would like to be able to do this is I work for a local ISP and we provision these routers to customers who reset them. I would like the customer to maintain the ability to reset it incase of issues, but we would like to maintain our SSH control over it to push them a new config if necessary. At the moment, if the customer resets the router we have to go out and reconfigure the static ip info for them.
 
The setting you are referring to is part of the firmware defaults, so to change it you would need to compile your own version of the firmware.


Thanks Colin,
Our routers are not currently using merlin, so I would like to edit this on an existing default firmware installation via SSH if possible. It may not be possible, but I was hoping I could edit a binary file with hex editor or something and upload it via SCP to replace an existing firmware one. Merlin may be an option for us, however the logistics of updating to Merlin over the air to customers will be much more difficult without physical access, and the support for the RT-AC66U only seems to be for the _B1 variant of it.
 
I wasn't suggesting that you use Merlin's firmware but just used that as an example because it was easier to link to rather than a part of the Asus GPL dump.

Good luck trying to find a specific instance of "0" in the binary files to change. The firmware is in ROM so not easily changeable.
 
I wasn't suggesting that you use Merlin's firmware but just used that as an example because it was easier to link to rather than a part of the Asus GPL dump.

Good luck trying to find a specific instance of "0" in the binary files to change.

Oh, alright. Not familiar with Asus GPL dumps/how Merlin was created. I read this guide https://openwrt.org/docs/techref/bootloader/cfe/changing.defaults#changing_defaults , and hoped the config for NVRAM defaults would be stored similarly, but I guess these are baked into the binary without string references from what you are saying. Too bad if that's the case, unless anyone has any other ideas for changing nvram defaults over ssh.

Also, a basic but suboptimal option could be disabling the reset button via ssh. I saw reset_gpio=11 in nvram but changing it to a nonsense value did not break the reset button.
 
Last edited:
I wonder if a resident local script could trigger on reset to reconfigure the router.

OE
 
@OzarkEdge, I hope not. That sounds like a good way to 'software' brick a router, with the wrong settings applied over and over?
 
@OzarkEdge, I hope not. That sounds like a good way to 'software' brick a router, with the wrong settings applied over and over?

Well, I assumed it could be smart script... use some logic to decide when and what to do... do nothing when nothing is required.

OE
 
Well, I assumed it could be smart script... use some logic to decide when and what to do... do nothing when nothing is required.
I can't really see this being viable with stock firmware. No matter how clever the script I don't see it still running after the user presses the reset button.
 
Last edited:

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top