1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

bridging wan to lan port

Discussion in 'Tomato Firmware' started by humba, Oct 9, 2007.

  1. humba

    humba Network Guru Member

    I'm trying to brige my WAN to one of my LAN ports on my WRT54GL1.1 as per these instructions

    However, there's a glitch. While the instructions work perfectly on dd-wrt, it appears that the ports that belong to vlan0 are always reset to include all 4 LAN ports.

    If I start out with
    vlan0ports=3 2 1 0 5*
    vlan1ports=4 5
    and then make the following changes

    # nvram set vlan0ports="3 2 1 5*"
    # nvram set vlan1ports="0 4 5"
    # nvram commit
    And reboot, afterwards things look as follows:

    vlan0ports=3 2 1 0 5*
    vlan1ports=3 4 5
    So while port 3 (using the numbering in front it's the first port) is now also a member of vlan1, it remains a member of vlan3 - however, the port no longer acts as a LAN port anyway.. any device behind won't get a dhcp address and is unreachable even if the device in question has a static gateway.

    Shouldn't the nvram variables after the reboot look like this (which they do on my dd-wrt router):

    vlan0ports=2 1 0 5*
    vlan1ports=3 4 5
    @update: actually.. I was a bit off.. further testing showed that port 1 is still very much part of the LAN.. I'm not quite sure what happened when I tried to put my AP behind the changed port.
  2. mstombs

    mstombs Network Guru Member

    What exact router do you have? I noticed in the source that some maybe re-assigned every boot because they are in reverse order - maybe this is your problem?

    My vlan0 defaults to

    vlan0ports=1 2 3 4 5*

    The source for Tomato 1.07 includes these lines in init.c

    	case HW_BCM5352E:	// G v4, GS v3, v4
    		dirty |= check_nv("vlan0ports", "3 2 1 0 5*");
    Which may reassign vlan0ports, it may work if you reassign it again in the init script...
  3. humba

    humba Network Guru Member

    It's a WRT54GL V1.1 as written in the intial post. I'm not aware there are any submodels.

    According to the OpenWRT Wiki the GL has the port numbering swapped... 4 is the WAN port, 0-3 are the LAN ports (and port 0 in nvram refers to lan port 4... I verified that on my second WRT54GL v1.1 with dd-wrt where my changes remain sticky).
  4. mstombs

    mstombs Network Guru Member

    And I think this is the same chipset as the GS V4 (GL not mentioned in source comment) so it is over-riding you on reboot. My GS 1.1 has different chipset so I don't have this problem
  5. humba

    humba Network Guru Member

    According to wikipedia, it's indeed the same hardware as the V4 (though it says G, not GS) - I think that's a bug then.. it shouldn't override any manual nvram settings.

    How would you suggest I re-assign them in the init script?

    nvram set vlan0ports="3 2 1 5*"
    nvram commit
    to my init script?
  6. mstombs

    mstombs Network Guru Member

    Yes give it a try - I hope it is early enough. I wouldn't bother with the commit this is slow, you know it doesn't stick, and something else will probably do it for you anyway...

    I would have thought such definitions should only be made when you reset to factory defaults, I can only think it was done this way to sort out WAN from LAN on first run after upgrade?
  7. humba

    humba Network Guru Member

    I reported this issue to Jon and he suggested to set the variable manual_boot_nv to 1. I searched for that variable and found a bit of code from dd-wrt - there if set to 1, no nvram variables are reset back to their default during the initialization phase.
  8. mstombs

    mstombs Network Guru Member

    I see, using manual_boot_nv in Tomato stops init.c from resetting the vlan0ports variable. Resetting to defaults clears this flag so low risk - does it work?
  9. humba

    humba Network Guru Member

    I'll report back when I've tried it. First I need to make a dozen backups of my current configuration as I've finally gotten everything to work properly. I'd be surprised if it wouldn't work since after all changing the variables in the init script also does the trick (if you do the whole thing I outlined here).
  10. humba

    humba Network Guru Member

    I finally tried it and it works like a charm. Now I just need to configure my switched networks with the appropriate vlans such as to simply change the default vlan on a port and switch between my routers.

Share This Page