Alternative ways to backup MAC-to-IP setting

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

leon

Regular Contributor
Hello,

I like to do a factory reset, and reconfigure my router. I don't mind re-do all except the setting unde LAN where I assign IP based on the MAC address. Is there a way for me just to backup these data?

Thanks in advance!
 

QuikSilver

Very Senior Member
Would this work for you?


 

dave14305

Part of the Furniture
See this script: https://www.snbforums.com/threads/dhcp_staticlist-and-dhcp_hostnames-utility.58957/

Or another option is to run this command to create the necessary commands to reapply the settings:
Bash:
printf "nvram set dhcp_staticlist=\"%s\"\nnvram set dhcp_hostnames=\"%s\"\nnvram commit\nservice restart_net_and_phy\n" "$(nvram get dhcp_staticlist)" "$(nvram get dhcp_hostnames)"
The idea is you would save the 4 lines this command creates, and paste them back into the SSH window after the reset. It will restart your network so the devices will disconnect and fetch the manual IP assignments.
 

QuikSilver

Very Senior Member
See this script: https://www.snbforums.com/threads/dhcp_staticlist-and-dhcp_hostnames-utility.58957/

Or another option is to run this command to create the necessary commands to reapply the settings:
Bash:
printf "nvram set dhcp_staticlist=\"%s\"\nnvram set dhcp_hostnames=\"%s\"\nnvram commit\nservice restart_net_and_phy\n" "$(nvram get dhcp_staticlist)" "$(nvram get dhcp_hostnames)"
The idea is you would save the 4 lines this command creates, and paste them back into the SSH window after the reset. It will restart your network so the devices will disconnect and fetch the manual IP assignments.
Dang, forgot about this one created by @Xentrk
 

dfunked

Regular Contributor
I've done this a few times recently and it's pretty painless.

Run "nvram show | sort" and copy all of this into a text file for reference later (might need to extend scrollback settings of your SSH client). The stuff you want is on the dhcp_staticlist line.

After reset, enable SSH and run the below;
nvram set dhcp_staticlist="<00:68:XX:XX:XX:XX>192.168.1.209><84:C5:XX:XX:XX:XX>192.168.1.200><80:32:XX:XX:XX:XX>192.168.1.201>"
nvram commit
reboot

I rebooted to clear the DHCP leases and force clients to pick up their reservation at the end, but there's probably a more elegant way to do it...
 

Xentrk

Part of the Furniture
The save-mynvram.sh script that is part of the NVRAM Save/Restore Utility can also be used and provides the ability to specify other nvarm parms

save-mynvram.sh is a small script that can save/restore a small number of user specified nvram settings. Pass the nvram values you want to save to the script as parameters (e.g. dhcp_hostnames and dhcp_staticlist). This will create a script called restore-mynvram.sh. Run restore-mynvram.sh to restore the nvram parameters. If a previous restore-mynvram.sh restore file exists, a backup file will be created.

Code:
sh save-mynvram.sh dhcp_hostnames dhcp_staticlist

Saving dhcp_hostnames
Saving dhcp_staticlist
Backing up previous restore script to /tmp/mnt/AC88U/nsru/restore-mynvram.sh.bak

Saved 2 NVRAM variable(s)
Run /tmp/mnt/AC88U/nsru/restore-mynvram.sh to restore your saved settings
 

Similar threads

Sign Up For SNBForums Daily Digest

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