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

How to connect to a DSL modem's WEB GUI through the Asus RT-N16 router.

Discussion in 'Tomato Firmware' started by bellamr, Jan 24, 2011.

  1. bellamr

    bellamr Networkin' Nut Member

    Set the following scripts:
    Init:

    sleep 5
    ip addr add 10.0.0.2/24 dev vlan2 brd +

    Firewall:

    iptables -I POSTROUTING -t nat -o vlan2 -d 10.0.0.0/24 -j MASQUERADE

    In this case the router itself creates the PPPoE connection to the ISP server; but to work, the connection between the modem and the router must have an IP address. Usually the modem gives an address to the client; but this address will never be used except to access the configuration interface of the modem.


    My modem is a D-Link DSL-2320B, it's IP address is 10.0.0.1 and the IP address created by the script on the WAN side of the RT-N16 connected to it is 10.0.0.2.


    Note #1: Many modems come configured to use the 192.168.1.x subnet. If you use the same subnet for your LAN, you need to either set the modem to use a different subnet or set the router's LAN to use a different subnet such as 192.168.2.x so that they're not using the same subnet.


    Note #2: With 100 mbps ports the vlan#ports variables typically appear like this:
    nvram show | grep vlan.ports
    vlan0ports=1 2 3 4 5*
    vlan1ports=0 5
    Unlike 100Mbit routers the Asus RT-N16 is a 1Gbit router. With the Asus RT-N16 the vlan#ports variables appear like this:
    nvram show | grep vlan.ports
    vlan1ports=4 3 2 1 8*
    vlan2ports=0 8
    So it is important to replace vlan1 (that would normally be used with a 100Mbit router) with vlan2 in the scripts above, or you can use $(nvram get wan_ifname) in place of vlan# and the script should work with all Tomato based routers.

    Such as the following scripts:
    Init:

    sleep 5
    ip addr add 10.0.0.2/24 dev $(nvram get wan_ifname) brd +

    Firewall:

    iptables -I POSTROUTING -t nat -o $(nvram get wan_ifname) -d 10.0.0.0/24 -j MASQUERADE



    In this example;
    Modem IP = 10.0.0.1
    Router IP (vlan2) = 10.0.0.2
    LAN subnet = 192.168.1.x/24
    Modem subnet = 10.0.0.x/24


    [​IMG]


    b.
     
  2. mstombs

    mstombs Network Guru Member

  3. bellamr

    bellamr Networkin' Nut Member

    Thanks for the info. Without reading posts from guys like you I'd be lost.:thumbup: I updated my scripts on my router and in the above post to reflect the version that looks up the correct name.
     
  4. dkirk

    dkirk Network Guru Member

    What software did you use to draw that network diagram?
     
  5. bellamr

    bellamr Networkin' Nut Member

  6. dkirk

    dkirk Network Guru Member

    Found it

    In case anybody else was curious about the software that made that diagram, check out http://www.networknotepad.com/ with the additional library download. With that free tool and library download I can replicate that diagram.
     
  7. lifeisfun

    lifeisfun LI Guru Member

    Guys, can you please give me hint what I'm doing wrong ?
    My modem IP 192.168.2.1 and is Router 192.168.1.1
    This is the script I use and it works great:
    Init:
    sleep 5
    ip addr add 192.168.2.0/24 dev vlan2 brd +

    Firewall:
    iptables -I POSTROUTING -t nat -o vlan2 -d 192.168.2.0/24 -j MASQUERADE

    However it causes problem that my SPA2102 Voip adapter 192.168.1.236 that is behind the Asus router
    will no longer register with my Voip provider. If I remove those modem scripts it works again fine.

    Any help would be appreciated.

    Thanks
     
  8. lifeisfun

    lifeisfun LI Guru Member

    Upgraded to the latest Tomato-Toastman build and now there is option to add you modem IP and access to the modem is working
    THANKS for the great firmware Toastman!
     

Share This Page