What's new

Entering static dhcp thru command line, is this how?

  • 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!

redsandvb

Occasional Visitor
Hello-

Bought an AC86U and am going through setup. Been using an older AC68P and tomato and am used to entering a bunch of static dhcp addresses through the Tools-->System Commands window using 'nvram set dhcpd_static=blah blah blah, etc' because it's so much faster than doing them individually through the Basic-->Static DHCP section of the GUI.

After some searching the forum it's my understanding I need to do it this way for Merlin:

-ssh into the router
-use 'nvram set dhcp_staticlist=<mac-address-1>ip-address-1>name-1<mac-address-2>ip-address-2>name-2...etc

Do I have that correct?

Thanks!
 
Hello-

Bought an AC86U and am going through setup. Been using an older AC68P and tomato and am used to entering a bunch of static dhcp addresses through the Tools-->System Commands window using 'nvram set dhcpd_static=blah blah blah, etc' because it's so much faster than doing them individually through the Basic-->Static DHCP section of the GUI.

After some searching the forum it's my understanding I need to do it this way for Merlin:

-ssh into the router
-use 'nvram set dhcp_staticlist=<mac-address-1>ip-address-1>name-1<mac-address-2>ip-address-2>name-2...etc

Do I have that correct?

Thanks!
Did you see this recent post?

https://www.snbforums.com/threads/add-dhcp-static-leases-from-cli.55502/
 
If I understood it correctly it means I can do it the way I mentioned in my first post?

I'm no expert, so I'm not sure I did... Thanks for any help!
 
@redsandvb
Make sure you enclose the string in double quotes (or the < and > are read as redirect symbols).
Also, the string length is limited in the latest firmware. For dhcp_staticlist, the assignment string can be no longer than 2999 characters.
 
Am I remembering correctly that this way doesn't show the list in the GUI though?
 
Am I remembering correctly that this way doesn't show the list in the GUI though?

Are you thinking of the method outlined here:

https://www.snbforums.com/threads/add-dhcp-static-leases-from-cli.55502/#post-471853

as posted the other day where he said: “Another way of doing this is to have a file for static leases and have dnsmasq read that........The only downside is that clients are not listed in the WebUIs manually assigned DHCP list, but that's not much of a problem.”?
 
@redsandvb
Make sure you enclose the string in double quotes (or the < and > are read as redirect symbols).
Also, the string length is limited in the latest firmware. For dhcp_staticlist, the assignment string can be no longer than 2999 characters.
Thanks for that tip!

And for the rest of the replies too.
 
? by the time you typed that would have used GUI to add it :)

That's quite possible :)

But if you type it into a script which you then run from a USB stick, you can run the script again every time you completely reset, without any further typing.

An added plus for me is that it's much easier to check a script for mis-types, and if necessary correct them, than to do this directly on the input screen. Maybe I am just clumsy at typing :)
 
I am a fan of the static list. I encountered the nvram 2999 character limit at one point and then decided to go the dnsmasq.conf.add route.
IMHO, it saves on nvram space and is much more portable. Having a file I can easily edit, change, backup etc. is great.
This all assumes you are comfortable of using the CLI. If not, stay with the WebUI and hope that at some point you don't hit the 2999 char limit.
If you don't mind some CLI time, I would recommend setting up the dnsmasq.conf.add file.
 
? by the time you typed that would have used GUI to add it :)
That's true if I'm typing it all out, but a simple copy-n-paste can fix that. ;)

It makes it much easier re-configuring a list of IPs after factory resetting the router after upgrading firmware, troubleshooting something, or other situations where one might restore default settings.

Also thanks for the additional replies.
 

Similar threads

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