What's new

Edit DHCP reservations?

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

htismaqe

Very Senior Member
I just bought a new RT-N66W and loaded Merlin Firmware:3.0.0.4.374.39.

I'm upgrading from a WNDR3700v2 and love the firmware so far. The only thing I miss is the ability to edit existing DHCP reservations. From what I can tell, the only options via the GUI are to add or delete. I definitely used the edit feature in the Netgear firmware as devices come in and out of my network often.

Does anybody know if this is something that can be done via the CLI? Is it a feature that could be added in a future GUI release?
 
I just bought a new RT-N66W and loaded Merlin Firmware:3.0.0.4.374.39.

I'm upgrading from a WNDR3700v2 and love the firmware so far. The only thing I miss is the ability to edit existing DHCP reservations. From what I can tell, the only options via the GUI are to add or delete. I definitely used the edit feature in the Netgear firmware as devices come in and out of my network often.

Does anybody know if this is something that can be done via the CLI? Is it a feature that could be added in a future GUI release?

I use a script.....

http://forums.smallnetbuilder.com/showthread.php?t=12876

Regards,
 
Thanks for that thread.

It appears I can change an individual entry via the CLI and (if I can figure it out :)) also maintain my list externally if I ever need to reset to defaults...
 
So you load your script via WinSCP? I'm not familiar, I'm not using Windows.

I'm assuming I could put your script on the JFSS partition and run it from there, could I not?
 
So you load your script via WinSCP? I'm not familiar, I'm not using Windows.

I'm assuming I could put your script on the JFSS partition and run it from there, could I not?

If you SSH/TELNET to the router you can cut 'n' paste directly into nano (if you have installed it via entware etc.) or vi if you are familiar with this native editor.



Regards,
 
I got it figured out. Thanks!

I can now auto-load my pre-sorted list - I have over 100 devices so this saved me a TON of time.
 
I add and delete items in the GUI and export the list periodically. Then I edit the list in Notepad and import it when I feel the need to sort it.
 
How do you import the list?

I separated mine with backslashes and input it 20 or so entries at a time, via telnet.

It would be nice if it could be done via the GUI command line interface.
 
How do you import the list?

I separated mine with backslashes and input it 20 or so entries at a time, via telnet.

It would be nice if it could be done via the GUI command line interface.


I copy and paste the result of:

nvram get dhcp_staticlist

into a text file on an attached USB flash drive (named 'RouterUSB'), and then re-import it after editing:

nvram set dhcp_staticlist="`cat /mnt/RouterUSB/dhcp_staticlist.txt`"
 
Last edited:
Yes, exactly. I have a USB hard drive connected anyway for video and use that.
 
Ah.

I may have to connect a thumb drive just for that purpose.

Why not simply create a script file in /jffs/scripts - having enabled the JFFS file system and formatted it?

NOTE: /tmp can be used to initially dump the nvram variable.

Code:
#!/bin/sh

# Refresh a sorted list of the DHCP STATIC table

logger -t "($(basename $0))" DHCP static table reset

# Add lines in the order / grouping as desired to be displayed in the GUI

nvram set dhcp_staticlist="<xx:xx:xx:xx:xx:xx>10.88.8.63>Kindle\
<xx:xx:xx:xx:xx:xx>nn.nn.8.65>HP6470B-WORK\
<xx:xx:xx:xx:xx:xx>nn.nn.8.100>EeeBox\
<xx:xx:xx:xx:xx:xx>nn.nn.8.101>HP-DM1\
<xx:xx:xx:xx:xx:xx>nn.nn.8.114>HP14-1190ea\
<xx:xx:xx:xx:xx:xx>nn.nn.8.115>U200-115\

repeat for all your devices

<xx:xx:xx:xx:xx:xx>nn.nn.8.254>DIR-855"


nvram set dhcp_static_x="1"

nvram commit

Then this may be executed in the GUI CMD box, or simply run from the router SSH/TELNET command line.

NOTE: You will need to be able restore the script file if the /jffs/ file system is lost during flashing, in which case an external USB flash drive would be more appropriate (or install an internal SDCARD if you have the RT-N66U and don't mind potentially voiding the warranty)

Regards,
 
Last edited:
I guess I don't really see any difference.

If I have to make changes to the file, I'm going to do it externally.

Script or text file, you're still uploading a file and then either running it (in the case of the script) or loading it in nvram via CLI.

It seems to me like 6 of one, one half doesn't of the other. Am I missing something? Are you editing the script on the box itself?
 

Similar threads

Latest threads

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