Header Shadow Image


DD-WRT: Missing 5Ghz settings and kern.warn kernel: wl driver 7.14.164.18 (r692288) failed with code 1

If the Wireless setup page is missing the 5GHz or any GHz settings, or other pages are missing this info:it could be a sign of exhausted nvram.  A clue to this is when resetting the nvram to defaults, all options become available again.  But what about this message?

kern.warn kernel: wl driver 7.14.164.18 (r692288) failed with code 1

The above was really a red herring.  The module can be checke using:

# lsmod|grep -Ei wl
wl                   4420666  0

And if not loaded, use rmmod wl then modprobe wl to re add the module.  These pop up and look like they could be related but they are not, in reality connected to the Wireless page not showing settings.  This is also interesting since these settings don't show up even with plenty of NVRAM left.  Hmm:

# nvram show >/dev/null
size: 68727 bytes (62345 left)

The culprit for the 5Ghz was too many F/W rules in DD-WRT causing (apparent) nvram exhaustion.  To fix this, relocate the iptables rules to /jffs where there's plenty of storage:

To save nvram space, encode the F/W commands as follows (First command below compresses directly from the current F/W settings):

# nvram set pH_fw="$(nvram get rc_firewall | gzip | uuencode -m /dev/stdout)"

# nvram set rc_firewall="nvram get pH_fw | uudecode -o /tmp/pH_fw.gz;gunzip /tmp/pH_fw.gz;chmod +x /tmp/pH_fw;/tmp/pH_fw"

# nvram get pH_fw
begin-base64 644 /dev/stdout
H4sIAAAAAAAAA9VabXeiRhT+vr/inqbnbHJORBgxoh/aYwzZuFVC1WTbTz1E
JkqjQAE3zuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuumb7AwLId
k0Jf/+jjtQxjyw2MpwX1odaFvqY/TKDmgyIKSlNQZEGsEwI1F4KpC7U/YeHM
.
.
.
0LEUlPgqKJ2agtLRFSR8FSSnpiA5uoINvgo2Tk3BxtEVlPkqKJ+agvKRFHzU
tUsYOsv6sssssssssssssssssssssssssssssssssssssssssssTUbMPl9Nh
S7GtRObgnX1l48XuYnASZg+VkzDpbCuRSWyTh2H8YLilQxAGIcmCRBQGovDS
KQ2Xj1KZjbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbnW4lMQp6b63Tfdlsg
cgMfAj9xdjH5SJPKtAKRwmdkGf4xPXYP36P1uyV2CCl2JtzaHpQRwpWalEWt
2S56YB0j12yXOh4+TI/k0CuvXXMNuIl3DPg7urAcH841Le0G3zvFJru9zr6J
xTHyY5gcggggggggggggggggggggggggggggggggggggggg+2NcYRZ4RnwDl
F/L7XKtQKbbbbbbbbbbbbbbbbbbbbbbbbbbbbbQrPhhhhhhhhhhJc5MVx+S3
xdpjWoFIzzzzzzzzzzzzzzzzzzzzzzkkkkkkkkzzhBDu2+ddVF7b51S2lciU
Gb50hBMJ/YPkKgb/h38AsEVI4rQ2AAA=
====

The command that will show in the UI is:

# nvram get pH_fw | uudecode -o /tmp/pH_fw.gz;gunzip /tmp/pH_fw.gz;chmod +x /tmp/pH_fw;/tmp/pH_fw

To edit the rules use:

# nvram get pH_fw|uudecode | gunzip | tee -a $(nvram get router_name)-firewall.conf

Edit the F/W rules conf file:

# vi $(nvram get router_name)-firewall.conf

Then compress once more:

# nvram set pH_fw="$(cat $(nvram get router_name)-firewall.conf | gzip | uuencode -m /dev/stdout)"

And verify:

# nvram get pH_fw

Verify in the UI that the .rc_firewall command has the compress line above.  An alternative to the above, is to always compress the firewall from a file stored on /jffs.  This will allow for far more storage available to firewall rules.  Create a file on the /jffs/firewall folder or another folder, perhaps on your USB:

# vi /jffs/firewall/$(nvram get router_name)-firewall.run

Copy in or enter the firewall rules.  Once done, set the rc_firewall nvram setting to:

# nvram set rc_firewall="time /bin/sh /jffs/firewall/$(nvram get router_name)-firewall.run"

Verify:

# nvram get rc_firewall
# time /bin/sh /jffs/firewall/$(nvram get router_name)-firewall.run

UI verification:

https://i1.wp.com/www.microdevsys.com/WordPressImages/DD-WRT-Firewall-Rules-In-Jffs.png?ssl=1

Cheers,

 

REF: https://wiki.dd-wrt.com/wiki/index.php/Useful_Scripts#Compress_the_Firewall_Script_.28to_reduce_nvram_usage.29 
REF: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327261 


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License