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

Problems with Wireless Client, Possibly a subnet issue

Discussion in 'Tomato Firmware' started by krkeegan, Mar 10, 2009.

  1. krkeegan

    krkeegan Addicted to LI Member

    WAN Gateway in Different Subnet than WAN IP - SOLVED

    Background
    This has been revised to focus on the real problem, hopefully this will make searching for the solution easier.

    The Problem
    My WAN gateway is not on the same subnet as my WAN IP address. My DHCP data looks like:

    IP Address. . . . .: 208.94.34.35
    Subnet Mask . . .: 255.255.254.0
    Default Gateway : 208.94.32.18

    A Windows laptop works if connected directly to the WAN, but the router does not. When the router is connected if I try and ping anything I get "Destination net unreachable" errors.

    How can i setup my routing tables to reach a WAN gateway that is not in my subnet?

    Thanks ahead of time for your help.
     
  2. azeari

    azeari LI Guru Member

    for one, the WAN gateway and DNS servers might have blocked imap pings, which might explain why the router is not able to ping them.. perhaps you could try pinging a internet site instead?

    personally i haven't setup the tomato as a wireless client before, but i believe the subnetting shouldnt cause any issues.. basically the 255.255.254.0 subnet is probably required due to the large number of clients this network must serve..

    haha beyond this i'm not sure either >_< will need some experts to comment on it
     
  3. krkeegan

    krkeegan Addicted to LI Member

    Yes, I tried pinging my own webserver hosted on another network with no luck. I should have included that in the first post.
     
  4. krkeegan

    krkeegan Addicted to LI Member

    OK I revised my question above. In a closer inspection I noticed the real problem.

    The gateway on the WAN not on the same subnet as my IP

    Anyone know of a way to correctly route my traffic?
     
  5. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Code:
    route add -host `nvram get wan_gateway` dev `nvram get wan_ifname`
    That will pull your gateway out of nvram and force a route to it over the WAN interface.

    Placing that in your WAN-Up script is probably the best bet.
     
  6. krkeegan

    krkeegan Addicted to LI Member

    If that works I will be so excited.

    Thank you for your help, I will try it tonight when I get home.
     
  7. krkeegan

    krkeegan Addicted to LI Member

    SOLVED

    SgtPepperKSU - First, thank you for your help. You are very courteous and your efforts to design an automatic fix that could be scripted was much more than I have ever received posting in any forum.

    I discovered one step that was missed. You probably wouldn't catch this unless you had my issue. Unfortunately since routing is not my field of expertise this took an hour to figure out but I think I designed the right solution.

    You also need to add the default route. This is because the default route is unreachable when the router first connects, so it doesn't get added.

    The script should read:
    Code:
    route add -host `nvram get wan_gateway` dev `nvram get wan_ifname`
    route add default gw `nvram get wan_gateway` dev `nvram get wan_ifname`
    I am sure if you were in my shoes you would have noticed that in 10 seconds.

    That appears to make everything work perfectly. And putting it in the Wan_Up script is perfect.

    Again thanks for your help SgtPepperKSU and everyone else. This is a great and very helpful forum!
     
  8. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Ah, I didn't realize the default gateway wouldn't get added if it wasn't routable at the time, so I assumed it would be there already. I learned something new today, too!
     

Share This Page