1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Backing up your configuration with NVRAM Export

Discussion in 'Tomato Firmware' started by sarelc, Jan 25, 2013.

  1. sarelc

    sarelc Addicted to LI Member

    I recently came across Toastman's post on saving a router's configuration from a CLI terminal. I would ideally like to use this to create a script containing all of the user-generated settings, with the goal of being able to swap hardware around with ease.

    Browsing through the list of NVRAM variables though, several issues present themselves. Settings related to clockspeed, interrupts, etc. should obviously not be included in case the new hardware isn't identical. Additionally, it occurs to me that one GUI entry may assign multiple values, not just the one with the same name. Toastman included a short list of variable groups that might be desirable to duplicate, but this is did not cover the many unique applications that each build now has - many of which have NVRAM variables even though they are disabled.

    I hypothesise that the best way to get only the needed variables (without plugging them into a spreadsheet and manually googling the unknown ones, which I have already started doing) would be a procedure like this:
    1. Flash intended Tomato build
    2. Reset NVRAM
    3. Export variables, giving a default baseline for the hardware in question
    4. Manually apply desired settings and reboot
    5. Export variables a second time
    6. Use a diff program to select changed lines and trim out everything else.
    Will this give me the results I'm looking for?

    Additionally, if I want to go deeper and catalogue what each control (or group of controls) in a setting page alters so that I can easily mix and match, how can I use the remote logging to capture the NVRAM changes?
     
  2. gfunkdave

    gfunkdave LI Guru Member

    Dunno. This is what I use.

    Code:
    nvram export --set | grep modem_ipaddr
    nvram export --set | grep wan_mtu
    nvram export --set | grep mtu_enable
     
    nvram export --set | grep wan_proto=
    nvram export --set | grep wan_hostname=
    nvram export --set | grep pppoe_
     
    nvram export --set | grep wan_dns
     
    nvram export --set | grep lan_ipaddr=
    nvram export --set | grep lan_netmask=
    nvram export --set | grep dhcpd_
     
    nvram export --set | grep wl0_
    nvram export --set | grep wl1_
    nvram export --set | grep wl0.1_
     
    nvram export --set | grep ipv6_
     
    nvram export --set | grep router_name
    nvram export --set | grep lan_hostname=
    nvram export --set | grep wan_domain
     
    nvram export --set | grep tm_
    nvram export --set | grep ntp_tdod
    nvram export --set | grep ntp_server
    nvram export --set | grep ntp_updates
     
    nvram export --set | grep ddnsx_
    nvram export --set | grep ddnsx0=
    nvram export --set | grep ddnsx1=
     
    nvram export --set | grep arpbind_only=
     
    nvram export --set | grep dhcp_
     
    nvram export --set | grep ct_
    nvram export --set | grep nf_
     
    nvram export --set | grep dns_
    nvram export --set | grep dnsmasq_
     
    nvram export --set | grep udpxy_
    nvram export --set | grep multicast_pass
     
    nvram export --set | grep wait_time
     
    nvram export --set | grep upnp_
     
    nvram export --set | grep qos_
     
    nvram export --set | grep rrule
     
    nvram export --set | grep smbd_
    nvram export --set | grep usb_
    nvram export --set | grep ftp_
    nvram export --set | grep ms_
     
     
    nvram export --set | grep pptpd_
    nvram export --set | grep vpn_client
    nvram export --set | grep vpn_server
     
    nvram export --set | grep http_wanport
    nvram export --set | grep http_lanport
    nvram export --set | grep http_passwd
    nvram export --set | grep http_enable
     
    nvram export --set | grep web_css
    nvram export --set | grep sshd_authkeys
    nvram export --set | grep sshd_remote
    nvram export --set | grep sshd_pass
    nvram export --set | grep sshd_forwarding
    nvram export --set | grep sshd_port
    nvram export --set | grep sshd_rport
    nvram export --set | grep sshd_eas
    nvram export --set | grep telnetd_
     
    nvram export --set | grep rstats_
    nvram export --set | grep cstats_
    nvram export --set | grep sesx_
     
    nvram export --set | grep cifs1=
    nvram export --set | grep cifs2=
     
    nvram export --set | grep log_
     
    nvram export --set | grep sch_
    nvram export --set | grep script_
     
    nvram export --set | grep snmp_
     
     
    
     
    yomismoos likes this.
  3. yomismoos

    yomismoos New Member Member

    Thanks, great code!! Just working years later! :D:D:D
     

Share This Page