2015年(5)
分类: 系统运维
2015-08-25 10:51:05
原文地址:openwrt - NVRAM集合 作者:tsengtim
如何使用
telnet登录openwrt后,第一次使用nvram的话,尝试一下 nvram show 命令(加上回车),将列出所有的nvram参数。
第二步仍然是尝试一下,用 nvram get flash_type 看看FLASH芯片是什么型号的,但这台7231-4p却无法看到型号。
我这里学习nvram的主要目的是用来设置的,设置命令是 nvram set ,完整的写法是“nvram set 参数=值”,我用一个例子说明。
参数设置后,必须使用 nvram commit 进行保存,如果有必要,还需要 reboot 命令重启设备,使新修改的参数生效。
设置方面的一个例子----修改路由器内网IP地址
把 LAN 的 IP 由 192.168.1.1 改为 192.168.1.9,可执行:
nvram set lan_ipaddr=192.168.1.9
nvram commit
reboot
第1行是修改IP地址,第2行是保存,第3行是重新启动 OpenWrt ,因为更改IP地址后要重启才能生效。
命令列表
nvram show
- 列出 nvram 所有参数
nvram show | grep 参数
- 用附加的 grep 命令来抽取部分参数,例如 nvram show | grep lan_ 意思就是取出关于LAN方面的参数
nvram get flash_type
- 取得FLASH芯片型号
nvram set 参数=值
- 设置用,见例子
nvram unset 参数
- 删除参数,例子:要删除 dr_lan_rx=0 ,执行:nvram unset dr_lan_rx ,不需要值
nvram commit
- 保存,若否,则路由器重启后,这些修改便会丢失
reboot
- 重启硬件,非nvram系列命令,不是一定必要,但大多数情况会用到
这是安装openwrt后,最初的 nvram ,没有任何改动,感觉应该不齐全
aa0=3
ag0=255
Back_Page=basic_tonline.htm
boardflags2=0
boardflags=0x0388
boardrev=0x10
boardtype=0x0101
boot_flash_addr=bfc00000
boot_wait=on
BridgeFlag=0
burnin=0
ccode=0
cctl=0
check_language=NO
clkfreq=200
console_loglevel=1
cpu_type=0x4712
d11b_bcn=100
d11b_channel=11
d11b_dtim=1
d11b_frag=2346
d11b_plcphdr=long
d11b_rate=0
d11b_rateset=default
d11b_rts=2347
d11g_bcn=100
d11g_channel=11
d11g_dtim=3
d11g_frag=2346
d11g_hwaddr=
d11g_mode=1
d11g_rate=0
d11g_rateset=default
d11g_rts=2347
d11g_shortslot_restrict=0
Daylight_Edd=0
Daylight_Emm=0
Daylight_enable=0
Daylight_Sdd=0
Daylight_Smm=0
def_et1macaddr=00:01:E3:0E:95:C4
default_lan_dhcp_client_br=0
default_lan_dhcp_client_nat=0
default_lan_gateway=192.168.2.1
default_lan_ipaddr=192.168.2.1
default_lan_netmask=255.255.255.0
default_lan_proto_br=static
default_lan_proto_nat=dhcp
default_language=de
default_policy=0
dhcp_end=192.168.2.200
dhcp_lease=72
dhcp_start=192.168.2.100
dhcp_static=
dl_ram_addr=a0001000
dmz_enable=0
dmz_ipaddr=
dmz_macaddr=
dos_enable=0
dyndns_hostname=
dyndns_password=
dyndns_username=
emi_test=0
et0macaddr=00:01:E3:0E:95:C4
et0mdcport=0
et0phyaddr=0
et1macaddr=00:01:E3:0E:95:C4
et1mdcport=1
et1phyaddr=30
fi0=
fi10=
fi11=
fi12=
fi13=
fi14=
fi15=
fi1=
fi2=
fi3=
fi4=
fi5=
fi6=
fi7=
fi8=
fi9=
fi=
filter_enable=0
filter_list=
firewall_enable=1
firewall_list=
fm=
forward_enable=0
freenet_login=
freenet_pin=
freenet_pwd=
freenet_realm=
ft=
fu=
fw_id=cDHN-02
fw_reset=0
fwt=
fwu=
gpio1=adm_eesk
gpio2=adm_eecs
gpio4=adm_rc
gpio6=adm_eedi
http_lanport=80
http_passwd=
http_username=
http_wan_enable=0
http_wanport=8080
il0macaddr=00:01:e3:0e:95:c5
internal_policy=1
ip_filter=0
kernel_mods=et wl slhc ppp_generic pppox pppoe ppp_async mppe
lan_dhcp_client=0
lan_dns=
lan_gateway=192.168.2.1
lan_hwaddr=00:01:E3:0E:95:C4
lan_hwnames=et0 il0 wl0 wl1
lan_ifname=br0
lan_ifnames=vlan0 eth1 wlanb0 wlana0
lan_ipaddr=192.168.2.1
lan_netmask=255.255.255.0
lan_proto=static
lan_stp=0
language=de
log_level=0
log_tftp=0
log_tftp_server=
m_lan_ipaddr=192.168.2.1
m_lan_netmask=255.255.255.0
m_wan_dns=
m_wan_domain=
m_wan_gateway=
m_wan_hostname=
m_wan_ipaddr=
m_wan_netmask=
m_wan_wins=
mac_filter=0
NatFlag=1
new_et1macaddr=
new_m_wan_dns=
new_m_wan_domain=
new_m_wan_gateway=
new_m_wan_hostname=
new_m_wan_ipaddr=
new_m_wan_netmask=
new_m_wan_wins=
new_pppoe_demand=1
new_pppoe_idletime=300
new_pppoe_keepalive=0
new_pppoe_mode=0
new_pppoe_mru=
new_pppoe_passwd=
new_pppoe_username=
new_pptp_demand=
new_pptp_enable=1
new_pptp_idle_disconnect=0
new_pptp_idle_interval=
new_pptp_idletime=
new_pptp_ipaddr=
new_pptp_keepalive=
new_pptp_mode=
new_pptp_netmask=
new_pptp_password=
new_pptp_server_ipaddr=
new_pptp_username=
new_wan_proto=pppoe
ntp_country=26
ntp_enable=1
ntp_server=ptbtime1.ptb.de
ntp_sync_interval=1
ntp_timezone=+1
one_passwd=
one_username=
opo=0x0
os_flash_addr=bfc40000
os_name=linux
os_ram_addr=80001000
os_server=
os_version=de_3.02.03
pa0b0=0x119a
pa0b1=0xfb93
pa0b2=0xfea5
pa0itssit=62
pa0maxpwr=66
pf0=
pf10=
pf11=
pf12=
pf13=
pf14=
pf15=
pf1=
pf2=
pf3=
pf4=
pf5=
pf6=
pf7=
pf8=
pf9=
pf_name=
pmon_ver=CFE 3.61.13.0
pppoe_auth_mode=auto
pppoe_demand=1
pppoe_idletime=300
pppoe_idletime_min=5
pppoe_ifname=vlan1
pppoe_keepalive=0
pppoe_mode=1
pppoe_mru=1492
pppoe_mtu=1492
pppoe_passwd=
pppoe_username=
pptp_demand=1
pptp_enable=0
pptp_idle_disconnect=
pptp_idle_interval=5
pptp_idletime=300
pptp_ipaddr=
pptp_mode=2
pptp_netmask=
pptp_passwd=
pptp_password=
pptp_server_ipaddr=
pptp_username=
process=mac_2_ip
radius_ipaddr=
radius_key=
radius_port=
remote_enable=0
remote_ipaddr=
reset_gpio=7=0
restore_defaults=0
scratch=a0180000
sdram_config=0x0033
sdram_init=0x0002
sdram_ncdl=0x2023e
sdram_refresh=0x0000
sromrev=2
static_route=
stats_server=
strato_name=
strato_pwd=
strato_realm=internet1/
tcp_filter=0
tdsl_ans=
tdsl_mit=0001
tdsl_num=
tdsl_per=
temp_dhcp_static=
temp_dmz_list=
temp_fi_name=
temp_filter_enable=1
temp_filter_list=
temp_filter_service=
temp_firewall_list=
temp_forward_list=
temp_forward_service=
temp_mac_id=
temp_mac_name=
temp_pf_name=
temp_url_enabled=0
temp_url_str=
temp_wan_ping=
temp_wds=
temp_wds_name=
tempSec_mac_id=
tempSec_mac_name=
time_zone=PST8PDT
timer_interval=3600
timezone_country=Germany
tmp_dmz_enable=0
tmp_page=de/adv_admin_manage.htm
udp_filter=0
upnp_enable=1
upnp_uuid=5daa
url_enabled=0
url_list=
url_path=de/adv_wl_access_manual.htm
user_conf_ver=1.01
user_time_dd=1
user_time_hr=0
user_time_mn=0
user_time_mo=1
user_time_update=0
user_time_yr=1970
vlan0hwname=et0
vlan0ports=0 1 2 3 5*
vlan1hwname=et0
vlan1ports=4 5
wan_device=vlan1
wan_dns=217.237.150.115 217.237.149.142
wan_domain=
wan_gateway=217.0.118.3
wan_hostname=
wan_hwname=et1
wan_ifname=ppp0
wan_ifnames=vlan1
wan_ipaddr=87.186.107.68
wan_lease=864000
wan_netmask=255.255.255.255
wan_ping=0
wan_proto=pppoe
wan_provider=tdsl
wan_wins=
wds=
wds_name=
webpage=de/adv_admin_manage.htm
wl0_afterburner=off
wl0_antdiv=-1
wl0_ap_isolate=0
wl0_auth=0
wl0_auth_mode=psk
wl0_bcn=100
wl0_channel=11
wl0_closed=1
wl0_corerev=7
wl0_country=Worldwide
wl0_country_code=AU
wl0_crypto=tkip
wl0_dtim=3
wl0_enable=1
wl0_frag=2346
wl0_frameburst=off
wl0_gmode=1
wl0_gmode_protection=off
wl0_hwaddr=00:01:E3:0E:95:C5
wl0_ibss=1
wl0_ifname=eth1
wl0_infra=1
wl0_key1=
wl0_key2=
wl0_key3=
wl0_key4=
wl0_key=1
wl0_lazywds=0
wl0_maclist=
wl0_macmode=allow
wl0_macname_list=
wl0_mode=ap
wl0_mrate=0
wl0_name=LinuxBox
wl0_phytype=g
wl0_phytypes=g
wl0_plcphdr=long
wl0_psk_obscure=
wl0_radio=1
wl0_radioids=BCM2050
wl0_radius_ipaddr=
wl0_radius_key=
wl0_radius_port=1812
wl0_rate=0
wl0_rateset=default
wl0_rts=2347
wl0_ssid=
wl0_unit=0
wl0_wds0=
wl0_wds0_nwam=
wl0_wds1=
wl0_wds1_nwam=
wl0_wds2=
wl0_wds2_nwam=
wl0_wds3=
wl0_wds3_nwam=
wl0_wds=
wl0_wds_enable=1
wl0_wep=disabled
wl0_wep_format=hex
wl0_wep_mode=tkip
wl0_wpa_gtk_rekey=900
wl0_wpa_psk=
wl0gpio1=0
wl0gpio2=0
wl0gpio3=0
wl0gpio4=0
wl0gpio5=0
wl0id=0x4320
wl_country_code=AU