Is there a way to backup the Manually Assigned IP entries via the command-line? And if so, how? Could I also assume that it could then be restored after doing a factory reset?
nvram get dhcp_staticlist
nvram show > /mnt/sda1/settings.txt
nvram set dhcp_staticlist="values_previously_saved"
nvram commit
This should be made sticky.
Code:nvram get dhcp_staticlist
Ideally, save the whole nvram to a text file, so you can cherry-pick various settings. Assuming USB disk is mounted as sda1:
Code:nvram show > /mnt/sda1/settings.txt
To re-enter a setting:
Code:nvram set dhcp_staticlist="values_previously_saved" nvram commit
Hi Merlin,
I've a USB disk mounted with enough available space but when I tried "nvram show > /mnt/sda1/settings.txt" using the Run Cmd in the N66U router, how come the file is not saved to the disk (I substitute sda1 with FLASH256, that's the volume label of my USB disk). Am I missing anything here? Thanks
mount
Your shares are at directory levels, not at the root. You probably need to save the output to a shared folder on the disk rather than at its root.
Also make sure the disk is really mounted using the label. Best way is to check the mount points:
Code:mount
nvram show > /mnt/FLASH256/download/settings.txt
I can't think of any reason how the resulting file could end up being 0 bytes long. You are running these commands over SSH or telnet, correct?
Oric1, you switched the mount point of FLASH256 from /dev/sda1 (post #7) to /dev/sdb1 (post #9)?
nvram get dhcp_staticlist > dhcp.txt
nvram set dhcp_staticlist=`cat dhcp.txt`
Going back to the original poster's question, I have a suggestion.
If you create a file called /jffs/configs/dnsmasq.conf.add with this line:
dhcp-hostsfile=/jffs/etc/dnsmasq/static_leases
Then you can put all your manual DHCP leases into this file /jffs/etc/dnsmasq/static_leases which will survive firmware resets and is easily maintained using nano or vi.
The format of the static_leases file is:
xx:xx:xx:xx:xx:xx,hostname,a.b.c.d,time_to_live
for example:
00:0C:29:41:AA:BB,barney,192.168.0.50,10080m
If you create a file called /jffs/configs/dnsmasq.conf.add with this line:
dhcp-hostsfile=/jffs/etc/dnsmasq/static_leases
Then you can put all your manual DHCP leases into this file /jffs/etc/dnsmasq/static_leases which will survive firmware resets and is easily maintained using nano or vi.
Code:[code] nvram show > /mnt/sda1/settings.txt
This is nice, but it's advised to be careful with that output file, as it contains the router password in clear text.
Dec 31 19:00:11 dnsmasq[295]: started, version 2.65 cachesize 1500
Dec 31 19:00:11 dnsmasq[295]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Dec 31 19:00:11 dnsmasq[295]: asynchronous logging enabled, queue limit is 5 messages
Dec 31 19:00:11 dnsmasq-dhcp[295]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Dec 31 19:00:11 dnsmasq[295]: read /etc/hosts - 5 addresses
Dec 31 19:00:11 dnsmasq[295]: read /etc/hosts.dnsmasq - 37 addresses
Dec 31 19:00:11 dnsmasq-dhcp[295]: read /etc/ethers - 37 addresses
Dec 31 19:00:11 WAN Connection: Fail to connect with some issues.
Dec 31 19:00:11 dropbear[299]: Running in background
Dec 31 19:00:11 RT-AC66U: start httpd
Dec 31 19:00:11 crond[308]: crond: crond (busybox 1.20.2) started, log level 8
Dec 31 19:00:11 kernel: scsi 0:0:0:0: Direct-Access Kingston DT Mini 10 1.00 PQ: 0 ANSI: 2
Dec 31 19:00:11 kernel: sd 0:0:0:0: [sda] 7822288 512-byte hardware sectors (4005 MB)
Dec 31 19:00:11 kernel: sd 0:0:0:0: [sda] Write Protect is off
Dec 31 19:00:11 kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Dec 31 19:00:11 kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Dec 31 19:00:11 kernel: sda: sda1
Dec 31 19:00:11 kernel: sd 0:0:0:0: [sda] Attached SCSI removable disk
Dec 31 19:00:11 kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0
Dec 31 19:00:12 hotplug[327]: USB vfat fs at /dev/sda1 mounted on /tmp/mnt/ASUS
Dec 31 19:00:27 start_nat_rules: apply the nat_rules(/tmp/nat_rules_ppp0_eth0)!
Dec 31 19:00:27 dnsmasq[295]: exiting on receipt of SIGTERM
Dec 31 19:00:27 FTP Server: daemon is stoped
Dec 31 19:00:27 Samba Server: smb daemon is stoped
Dec 31 19:00:27 dnsmasq[469]: started, version 2.65 cachesize 1500
Dec 31 19:00:27 dnsmasq[469]: compile time options: IPv6 GNU-getopt no-RTC no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Dec 31 19:00:27 dnsmasq[469]: asynchronous logging enabled, queue limit is 5 messages
Dec 31 19:00:27 dnsmasq-dhcp[469]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1d
Dec 31 19:00:27 dnsmasq[469]: read /etc/hosts - 5 addresses
Dec 31 19:00:27 dnsmasq[469]: read /etc/hosts.dnsmasq - 37 addresses
Dec 31 19:00:27 dnsmasq-dhcp[469]: read /etc/ethers - 37 addresses
To: Zirescu
I don't think you can put static_leases file on SD card because the USB thumb drives are not mounted when DNSmasq starts. If you try it, please report back though as it is just my guess.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!