Hi,

edit: I probably wasn't clear enough about one thing: this package is a quick hack I put together over the course of a few hours. It was tested and tagged as "works for me" on my wrt54gs, using a fairly simple network configuration. I could use some feedback on how this mod does on other hardware, but if you are not able to deal with your router being inaccessible after rebooting with these scripts, you probably shouldn't touch them.
My apologies to those who thought this was anywhere near usable. I hope it will be some time soon, but for now, it is something you'll want to try if you're interested in helping me debug it smile

I have packaged my implementation of the "central nvram maps" proposal. For now, it allows bringing up a more complex network configuration than the current stock S40network allows, and permits configuring hostname/domainname from flat files instead of altering the nvram settings. The repository is at:

src natulte http://ipkg.natulte.net/

# ipkg update
# ipkg install nvmaps

The installation procedure backs up any files it replaces into /etc/nvm.bak . `ipkg remove` will put them back.

I have tested bringing up several static networks on a WRT54GS running an otherwise stock OpenWRT. DHCP and other interface configuration methods are currently untested. PPP line setup is plain unsupported (might work, might not), contrary to the nvram maps implementation on the wiki.

The configuration files included in the package are configured to bring up a network by pulling information from the nvram, so you should end up with a router in a configuration similar to that of the stock scripts. please note however that nvmaps doesn't build br0 from vlan0 and eth1!. The stock configuration brings up vlan0 and eth1 as separate interfaces, though building the bridge on boot is probably possible by tweaking /etc/network/interfaces .

This is what the default configuration brings up:

vlan0 - configured with lan_* variables from nvram
vlan1 - configured with wan_* variables from nvram
eth1 - configured with wifi_* and wl0_* variables from nvram

vlan0 on switch ports 1-4 (marked LAN on WRT54GS)
vlan1 on switch port 0 (marked WAN/Internet on WRT54GS)
Both on port 5 (for obvious reasons of "otherwise it don't work")

if you want to try a more complex config, try:

/etc/network/interfaces
-----------------------

switch_ifname=et0

# LAN
iface vlan0
  vlan0_conf_method="static"
  vlan0_address="192.168.1.1"
  vlan0_hwaddress="00:0F:66:C7:C9:01"
  vlan0_netmask="255.255.255.0"

# WAN
iface vlan1
  vlan1_conf_method="static"
  vlan1_address="192.168.2.1"
  vlan1_hwaddress="00:0F:66:C7:C9:02"
  vlan1_netmask="255.255.255.0"
  vlan1_gateway="192.168.2.254"

# MAN (residential network)
iface vlan3
  vlan3_conf_method="static"
  vlan3_address="192.168.3.1"
  vlan3_hwaddress="00:0F:66:C7:C9:03"
  vlan3_netmask="255.255.255.0"

# DMZ
iface vlan5
  vlan5_conf_method="static"
  vlan5_address="192.168.4.1"
  vlan5_hwaddress="00:0F:66:C7:C9:04"
  vlan5_netmask="255.255.255.0"

----------------------
/etc/network/vlan-maps
----------------------

vlan0_ports="2 3"
vlan1_ports="0"
vlan3_ports="1"
vlan5_ports="4"

--------------------
/etc/network/domains
--------------------

HOSTNAME=realitycheck
DOMAINNAME=unreal.net

# ignored for now
parent_dns=

Notice that I only use odd vlan numbers, because of the admcfg bug that puts a port on vlanX AND vlan(X-1) if X is even.

If everything gets messed up, boot into failsafe mode and restore your old files out from /etc/nvm.bak , or simply run ipkg -o /jffs remove nvmaps . That should restore the backed up scripts so that your router can boot up normally again.

Thanks in advance for any feedback/flames/suggestions...