OpenWrt Forum Archive

Topic: Openwrt nvram variables list

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi
Is there a list of all nvram variables that Openwrt uses?
i'm sorry if this question was asked before but i searched the forum and the wiki, and found only fragments of the nvram variables that are used in Openwrt.

A list of all nvram variables that are used in the last version of Openwrt would be very helpfull, or maybe a script that is a part of the firmware that can be edited with the needed values. That way with every new firmware version that script can be adapted to the new variables and the old ones that are not needed can be erased.
It could be something like a master config script, that ca be used to hold your personal configuration also.
This script should not be used as a start script, but only to do a manual nvram configuration to make our lives easer. wink

What do you think, is this possible?

I have saved my NVRAM-variables from an "original" firmware.

After that i compare some important settings with the "original" firmware and the OpenWRT.


Sorry, but a list of all NVRAM-variables i don't find yet.

Here is my nvram list (not exhausive maybe)

os_ram_addr=80001000
wl0_net_mode=mixed
wl0_frameburst=off
il0macaddr=xx:xx:xx:xx:xx:xx
boardrev=0x10
et0macaddr=xx:xx:xx:xx:xx:xx
bootnv_ver=2
watchdog=5000
boot_wait=on
wl0_infra=1
et0mdcport=0
wl0_country_code=AU
pmon_ver=CFE 3.61.13.0
lan_gateway=192.168.2.2
wl0_ifname=eth1
vlan0ports=1 2 3 4 5*
gpio5=robo_reset
wl0_mode=ap
wl0_ap_isolate=0
os_flash_addr=bfc40000
sromrev=2
wl0_gmode=6
boardtype=0x0708
lan_netmask=255.255.255.0
wl0_ssid=OpenWrt
wl0_dtim=1
wl0id=0x4320
wl0_key1=
wl0_key2=
wl0_key3=
wl0_key4=
ag0=255
wl0_closed=0
wl0_rate=0
wl0_plcphdr=long
wl0_macmode=disabled
wl0_radioids=BCM2050
wl0gpio2=0
wl0_phytype=g
wl0gpio3=0
wl0_lazywds=0
boardflags2=0
wl0_afterburner=auto
wl0_antdiv=-1
wl0_wpa_psk=
wl0_unit=0
wl_country_code=AU
pa0itssit=62
wl0_wds=
cctl=0
lan_dns=192.168.1.250
wl0_auth=0
wl0_radius_port=1812
wl0_radius_ipaddr=
pa0maxpwr=0x4e
lan_ipaddr=192.168.2.1
clkfreq=200
aa0=3
vlan1hwname=et0
wl0_phytypes=g
wl0_wep=disabled
wl0_frag=2346
sdram_config=0x0062
wl0_country=
vlan1ports=0 5
scratch=a0180000
ccode=0
wl0_rateset=default
boardflags=0x0118
sdram_refresh=0x0000
sdram_ncdl=0xfe0009
wl0_rts=2347
wl0_wpa_gtk_rekey=3600
wl0_key=1
et0phyaddr=30
wl0_radio=1
wl0_bcn=100
wl0_hwaddr=xx:xx:xx:xx:xx:xx
pa0b0=0x15eb
wl0_gmode_protection=auto
pa0b1=0xfa82
wl0_maclist=
pa0b2=0xfe66
sdram_init=0x000b
vlan0hwname=et0
dl_ram_addr=a0001000
wl0_radius_key=
wl0_corerev=7
wl0_channel=11
wl0_auth_mode=open
boot_ver=v3.4
boardnum=42
wl0_crypto=tkip

Hope this helps. If you want to get back to a minimal nvram configuration, simply do :

mtd erase nvram

on next reboot you will get the needed variables only

Thanks for the help, i did a factory reset with the reset button and configured the nvram variables that i needed for my VPN connection. It was not that difficult but it took me about 4h to find out all the nvram variables that i needed to set right to do the job!

Now if such a nvram variables config script file would exist, it would take me much less time to change the values that i need.
Change the values, then run the script, and that's it, nvram is set wink

I would love to help in putting this script file together, but i don't have a very deep understanding in nvram variables and Openwrt for that matter yet. I'm working on that and hope to learn more and more every day smile

Maybe an OpenWRT guru could put a script file together, if it's not to much time consuming?
I know that i will try when i get to know the system better wink

RItalMan wrote:

If you want to get back to a minimal nvram configuration, simply do :

mtd erase nvram

on next reboot you will get the needed variables only

I've bricked v2.0 unit about a year ago doing "mtd erase nvram". The only way to revive is to use JTAG cable.
The reason of bricking is some variables like sdram_* which are required to get CFE working.
So be careful.

@trooper: And what is a secure way to reset to defaults?

I was lucky because when I passed from dd-wrt at openwrt, I have a buttin "reset factory default after flashing" and after I had a openwrt rc2 with a minimal nvram variables.

It's odd that there is no secure way to reset nvram with factory default from openwrt :-(.

Bye

(Last edited by thierry_b on 26 Jul 2005, 09:04)

inh wrote:

aw come on folkes. like the ever so popular phrase in IRC.. "its on the wiki"

http://openwrt.org/OpenWrtNVRAM

True, its on the wiki. But those are surely not all the variables that are required to keep the box running. The idea is to delete all superfluous variables from the nvram to save space, or just to keep things neat. If you would rely on those variables that are in the wiki, you would erase things like boot_wait, board*, and maybe some others that are probly required.

OK. In the interest of resolving this, once and for all.. Here's the dump from my "nvram show | sort" command. I've left out all settings documented on the wiki page in question. The rest have been categorized based on what I think that they might do, forum discussions where settings have been mentioned, and "all the rest" - noise left over from the Linksys firmware that may not be important, but may give insight on how to implement compatible packages with nvram-based settings... and possibly could be implemented in future versions of OpenWRT (after the feature-frozen White Russian).

For those who know what settings mean, please post comments to this thread. I'll do my best to take responsibility over updating the wiki. For example, boot_wait, boardflags, clkfreq, etc. all have much documentation in the forums that should be wikified.

For those who are troubleshooting bricked wrt54g's and want to know what a working nvram looks like, feel free to use this as a cross-reference. I haven't done any serious modifications to firmware and I have had absolutely no problems upgrading from Linksys --> experimental 2005-05-25 --> White Russian RC2.

One final note: This isn't a complete list of undocumented nvram values. Some obviously useless settings were already removed. But since I've been distracted numerous times today, I figured I should post what I had before I lost it all.

And onward...

Definitely important:

boot_wait=on
boardflags=0x0118
clkfreq=216
wl0_crypto=tkip

Possibly important:

bcm4712_firmware_version=v1.50.0
boardflags2=0
boardnum=42
boardrev=0x10
boardtype=0x0708
boot_ver=v3.4
firmware_version=v3.01.3
flash_type=Intel 28F320C3 2Mx16 BotB

Unmentioned lan vars:

lan_domain=
lan_hwaddr=00:13:10:2B:35:6A
lan_lease=86400
lan_wins=

Unmentioned wl0 vars:

wl0_active_mac=
wl0_afterburner=off
wl0_auth=0
wl0_country=Worldwide
wl0_mac_deny=
wl0_mac_list=
wl0_macmode1=disabled
wl0_mrate=0
wl0_net_mode=mixed
wl0_passphrase=
wl0_radioids=BCM2050
wl0_unit=0
wl0_wep_bit=64
wl0_wep_buf=
wl0_wep_gen=
wl0_wep_last=
wl0gpio2=0
wl0gpio3=0
wl0id=0x4320

Wifi client mode?

wl0_ap_ip=
wl0_ap_ssid=

Unmentioned wan vars:

wan_domain=
wan_gateway_buf=0.0.0.0
wan_get_dns=
wan_get_domain=
wan_hwaddr=00:13:10:2B:35:6B
wan_hwname=
wan_iface=vlan1
wan_lease=43200
wan_mtu=1500
wan_primary=1
wan_run_mtu=1500
wan_unit=0
wan_wins=0.0.0.0

PPP/PPoE Settings?

ppp_ac=
ppp_demand=0
ppp_get_ac=
ppp_get_srv=
ppp_idletime=5
ppp_keepalive=0
ppp_mru=1500
ppp_mtu=1500
ppp_passwd=
ppp_redialperiod=30
ppp_service=
ppp_static=0
ppp_static_ip=
ppp_username=
pppoe_ac=
pppoe_demand=0
pppoe_idletime=5
pppoe_ifname=
pppoe_keepalive=0
pppoe_passwd=
pppoe_service=
pppoe_static=0
pppoe_static_ip=
pppoe_username=

Everything else:

console_loglevel=1
bootnv_ver=2
pmon_ver=CFE 3.61.13.0
Intel_firmware_version=v1.41.8
QoS=0
aa0=3
ag0=255
autofw_port0=
ccode=0
cctl=0
ct_modules=
d11g_bcn=100
d11g_channel=10
d11g_dtim=1
d11g_frag=2346
d11g_mode=1
d11g_rate=0
d11g_rateset=default
d11g_rts=2347
daylight_time=1
def_hwaddr=00:00:00:00:00:00
dl_ram_addr=a0001000
dmz_enable=0
dmz_ipaddr=0
dr_lan_rx=0
dr_lan_tx=0
dr_setting=0
dr_wan_rx=0
dr_wan_tx=0
eou_configured=1
eou_device_id=JJDKHE24
eou_expired_hour=72
eou_key_index=2
eou_private_key=7622fffc73dc556ef8a905c7e1fdb14b6603602e58b466009d8d2e5cf07a60c0a7d0e65ff83b7a668d52fa7c28a0d4736b22fb540ab97b2d981f7a381d2ca61da0365a615d6f3819e21bd59be66992f7e6e285989d82d875ba6e41bde071aa48412fa9b65bceead5d9a31985a3159ffbd33ae0bc2ea5d92bf11100a8d126e7f5
eou_public_key=df25aaa3f74ada4363e9ee798e6d6b5587cd7cc952384ee4b7d1c95a38039a4f75dfec0a9bfe91de2763d923692fca2f589768f41441e8ab74ad3c311aa9ab8f297b46087c8aae23bbb15ad39eaf586754a473f63266cbf059d73988959453f743a1ddf180e8c2b4ccf3d45b65249872d3787a2a25d33b37948c9d44dcb1cd1911
et0macaddr=00:13:10:2B:35:6A
et0mdcport=0
et0phyaddr=30
ezc_enable=1
ezc_version=2
forward_port=
fw_disable=0
gpio5=robo_reset
hb_server_domain=
hb_server_ip=
ident_pass=0
il0macaddr=00:13:10:2b:35:6c
ipsec_pass=1
l2tp_get_ip=
l2tp_pass=1
l2tp_server_ip=
log_enable=0
log_ipaddr=0
log_level=0
mac_clone_enable=0
manual_rate=0
mtu_enable=0
multicast_pass=0
ntp_mode=auto
ntp_server=
os_date=Sep 22 2004
os_flash_addr=bfc40000
os_name=linux
os_ram_addr=80001000
os_server=
os_version=3.61.13.0
pa0b0=0x15eb
pa0b1=0xfa82
pa0b2=0xfe66
pa0itssit=62
pa0maxpwr=0x4e
ping_ip=;*/n${IFS}show>tmp/ping.log
ping_times=5
port_flow_control_1=1
port_flow_control_2=1
port_flow_control_3=1
port_flow_control_4=1
port_priority_1=0
port_priority_2=0
port_priority_3=0
port_priority_4=0
port_rate_limit_1=0
port_rate_limit_2=0
port_rate_limit_3=0
port_rate_limit_4=0
port_trigger=
pptp_get_ip=
pptp_pass=1
pptp_server_ip=
qos_appname1=
qos_appname2=
qos_appname3=
qos_appport1=0
qos_appport2=0
qos_appport3=0
qos_devmac1=00:00:00:00:00:00
qos_devmac2=00:00:00:00:00:00
qos_devname1=
qos_devname2=
qos_devpri1=0
qos_devpri2=0
rate_mode=1
remote_management=0
remote_mgt_https=0
restore_defaults=0
router_disable=0
router_name=openwrt
scratch=a0180000
sdram_config=0x0062
sdram_init=0x000b
sdram_ncdl=0xfd0008
sdram_refresh=0x0000
security_mode=wep
security_mode_last=
sel_qosftp=0
sel_qoshttp=0
sel_qospop3=0
sel_qosport1=0
sel_qosport2=0
sel_qosport3=0
sel_qossmtp=0
sel_qostelnet=0
skip_amd_check=0
skip_intel_check=0
sromrev=2
static_route=
static_route_name=
stats_server=
time_zone=-05 2 1
timer_interval=3600
traceroute_ip=
upnp_enable=1
upnp_wan_proto=
watchdog=5000
web_wl_filter=0
wk_mode=gateway

Any further discussion on this one, or is it dead? I was hoping to get some useful feedback to add to the wiki...

Hi

I wrote this little awk script reading all current set nvram variable names and values into a complete command list:

"nvram set varname="varvalue"

all unset variables will be transormed into:
"nvram unset varname"

The nvram can be restored by simply do a cut&paste ;-)

The awk script is part of my weekly backup crontab running via ssh:

ssh -l root wrt54gs nvram show | awk 'FS="=" {if(length($2)>0) {print "nvram set " $1 "=\"" $2 "\"";}else{print "unset nvram " $1;}}'|sort > nvram-"`date +%Y%m%d%H%M`".txt

Thus the dump-files get the current date and time any changes can be viewed over time. The AWK part can also be done into a smal shell-script eg. /sbin/nvram-dump.sh as you like! :-)

Have a nice weekend!

Cheers dp

The discussion might have continued from here.