DD-WRT on WL-330GE

I recently bought Asus WL-330GE wireless router. I needed small travel router and I needed to run DD-WRT on it. It seemed like perfect match.

Upgrade to DD-WRT went without a hitch. However, as soon as it booted I noticed that I was getting DHCP address from my hotel's server instead from router. Quick investigation revealed that there was no WAN port configured. Single port was in my LAN segment and thus it was leaking everything. Solution for that ought to be simple - I just went to Setup -> Networking and changed WAN assignment there. It seemed to work but, as soon as I rebooted router, everything went back to original state. Quite annoying.

Quick googling revealed something that looked quite close to solution but it didn't work for me. I could get it to work sometime but every time after restart it would put my WAN port into default bridge. Not quite what I wanted.

In order to debug this I executed nvram show after clean install and then I executed it again after everything got working. That gave me delta that I had to apply. And, as far as bridges go, I decided to manually remove eth0 (WAN port) from default bridge.

Final result was this start-up script (Administration > Commands):

brctl delif br0 eth0
nvram set lan_ifnames="eth1"
nvram set wan_ifname="eth0"
nvram set wan_ifname2="eth0"
nvram set wan_ifnames="eth0"
nvram set wanup=0
nvram unset dhcpc_done
nvram commit
udhcpc -i eth0 -p /var/run/udhcpc.pid -s /tmp/udhcpc &

First line just ensures that WAN port is thrown out of bridge. All those nvram lines sort out minor differences. Last line enables DHCP renewal on WAN interface. After startup that should produce bridge state as displayed on picture. Just what I wanted. :)

Only thing that might look funny afterward is that both WLAN and LAN interface have same MAC address. To solve this we need to telnet (or ssh) to machine and execute following commands:

nvram get lan_hwaddr
nvram get wan_hwaddr
nvram get wl0_hwaddr

Each command will give you MAC address of each interface. In my case this was:

lan_hwaddr: F4:6D:06:94:02:39
wan_hwaddr: F4:6D:06:94:02:39
wl0_hwaddr: F4:6D:06:94:02:3B

From that we can interpolate that wan_hwaddr should be F4:6D:06:94:02:3A (just before wireless and just after LAN). Only thing to do now is to enhance our startup script (somewhere BEFORE nvram commit) with:

nvram set wan_hwaddr=F4:6D:06:94:02:3A
nvram set et0macaddr=F4:6D:06:94:02:3A

This game with MAC is not strictly necessary but I like to set it anyhow.

I tested this on build 14896 (recommended for Asus WL-330GE in router database) and on special build 15962 (recommended on forums as stable).

P.S. Next time remember not to take router advice from Windows programmer.

4 thoughts to “DD-WRT on WL-330GE”

  1. Hi,
    Your feedback helped me a lot to figure it out. I believe there is no need to have such startup commands.
    You would still do the same thing through configuring the dd-wrt interface.
    This what I have done:
    Setup-Basic-> Connection type: Auto-Conf-DHCP
    DHCP Type: DHCP Server
    Enable DHCP Server

    Setup-Networking->
    Port Setup: eth0, unbridged

    Save apply and reboot.
    It worked.

    1. I tried that first, but it would not work for me. It is little bit murky this long after, but it definitely would destroy my bridge configuration after reboot.
      I am glad that it worked simpler for you.
      Which version of DD-WRT was this?

  2. I was looking for a solution to this exact problem and nothing worked, except for your script which worked perfectly. Thanks a lot!

  3. I was also looking for a solution to a DD-wrt (micro) (v24 from 2010) on a WAP-54g Ver.2, which also doesn’t have a WAN and your start-up script worked, since if you set manually Setup>Network>PortSetup>Wan Port Assignment to eth0, the next reboot it forgets the settings. Thank you, this works perfectly. For all those who wish to turn their APs into wireless routers on the wireless side, follow this advice.

Leave a Reply to Josip Medved Cancel reply

Your email address will not be published. Required fields are marked *