What's new

Latest Merlin on RT-BE88U Problem Setting NVRAM dhcp_staticlist From File

dwp

Regular Contributor
On my old Asus GS-AX3000 I have a very long list of static bindings that I hope to avoid manually typing-in on my new RT-BE88U w/Merlin...

I have entered a couple dummy static bindings in the new router and see the format of the data stored in nvram has changed in a minor way from the old router. So I have manually edited the file so that it conforms. Basically
Code:
<48:5A:3F:1F:03:DF>192.168.1.126>
is changed to
Code:
<48:5A:3F:1F:03:DF>192.168.1.126>>
and that pattern is applied to all of the old data.

Then I move the resulting, 1-line file to the new router's USB drive, change dir to the proper location in /tmp/mnt and issue the following command:
Code:
nvram set dhcp_staticlist "$(cat dhcp_staticlist.txt)"
I know this worked at least one time as I could see the results in the browser UI. The DNS Server column was all "default" and the Hostname column was all blank.

I re-worked the file to grab the old router's custom_clientlist info into host names and the result looked like this for each item:
Code:
<00:0A:F5:C9:5F:54>192.168.50.21>>V40-ThinQ

And again, this seemed to work as I could see the results in the browser UI.

Then I needed to re-work some of the names since they were not valid hostnames. And when I tried again, I started to get errors:
Code:
"Input command:<the data is here> is not supported."

So I decided to go back to my original format of
Code:
<48:5A:3F:1F:03:DF>192.168.1.126>>

But now even this gives the not supported error.

What is going on? Thanks!
 
Hi,

You should be able to just export or copy dhcp_staticlist and custom_clientlist and reimport them. See this post for a summary. Easiest way when not using an Addon.

A second option If you’re struggling with the syntax and would like to try this, a while back I created a custom_clientlist generator which I cobbled together in Excel, have a wee look at this post, for doing what I believe you are attempting to do.

I did the above before I discovered the awesome YazDHCP Addon where you can export and import these manual reservations very easily and then @Martinski introduced guest network support to YazDHCP and it was even better. Highly recommended.
 
Thanks. I now see that I am a f**king idiot/old man. I forgot to use the = in my set commands. Clearly I remembered it a couple times then spaced it totally. Sorry!
 
The problem I ran into when doing this via Putty SSH is that there's a line-length limit. So I originally tried
Code:
nvram set dhcp_staticlist="$(cat mystaticlist.txt)"
and it failed because at the time I had a lot of static clients so the 1-line file was nearly 1300 characters. I couldn't find a way to get past that.
Since I don't have to import often, I hand-edit the file to break it up at about 500 characters with a ' \' at the end of the lines to continue them.

So something like:
Code:
nvram set dhcp_staticlist="<MAC>IP>>Name<MAC>IP>>Name \
<MAC>IP>>Name<MAC>IP>>Name \
<MAC>IP>>Name<MAC>IP>>Name"

Note that you only want the opening quote on the first line and the closing quote on the last line.

There may be an easier way, but like I said I don't have to do it often, so I haven't pursued.
 
Even easier is to just use WinSCP as no typing anything.
Just upload the file from your save location and if you want to save just download to whatever location on your PC you desire.
Yep, agree, I use WinSCP a lot, it’s great, although you have to be careful with file permissions 0644 and 0755 and sometimes the ‘nix vs windows txt format trips me up.

Using WinSCP is why I wrote copy above and in the link I referred to I noted this:
I use WinSCP to do this (SCP only works with Merlin FW). I actually used to just drag and drop the 3 files back and forth without issue, but as above, Tech9 cautions against this. I now use YazDHCP, which is highly recommended.
One of the issues with referring folks to posts (and I’m equally bad at it) is that few folks read the post in its entirety, if they follow the link at all.
 
Last edited:
The problem I ran into when doing this via Putty SSH is that there's a line-length limit. So I originally tried
Code:
nvram set dhcp_staticlist="$(cat mystaticlist.txt)"
and it failed because at the time I had a lot of static clients so the 1-line file was nearly 1300 characters. I couldn't find a way to get past that.
Since I don't have to import often, I hand-edit the file to break it up at about 500 characters with a ' \' at the end of the lines to continue them.

So something like:
Code:
nvram set dhcp_staticlist="<MAC>IP>>Name<MAC>IP>>Name \
<MAC>IP>>Name<MAC>IP>>Name \
<MAC>IP>>Name<MAC>IP>>Name"

Note that you only want the opening quote on the first line and the closing quote on the last line.

There may be an easier way, but like I said I don't have to do it often, so I haven't pursued.
Thanks so much! I am using putty. I too have alot of static clients. Interestingly, I did not hit any command line length limits. When I was f**king up and NOT using the = in my nvram commands, I thought the issue could well have been this. But it turns out that my problem is just old age and stupidity :-(
 
Even easier is to just use WinSCP as no typing anything.
Just upload the file from your save location and if you want to save just download to whatever location on your PC you desire.
Just a heads up on SCP btw, as the GS-AX3000 is not supported by Merlin, it may not be (is very unlikely to be) possible to use WinSCP to export the files.

Refer to this post from 2024 where Merlin notes:
Likewise, a few months ago one of their security changes was to remove scp from the firmware, something I will not apply to Asuswrt-Merlin, because it's very useful for advanced users.

It stuck in my mind because like you I love using WinSCP but if I read this correctly, it only continues to be available on routers with Merlin FW. So the OP can import the files into the RT-BE88U using WinSCP … but cannot do the same getting them out of the GS-AX3000… so back to Putty it is ;-).
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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