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

Does Tomato have a routing table limit?

Discussion in 'Tomato Firmware' started by catbit, Feb 10, 2012.

  1. catbit

    catbit Networkin' Nut Member

    I want to add more than 1000 routes into Tomato using this command:
    Code:
    route add -net x.x.x.x/x 10.8.0.1
    But after I execute the script it seems it crashed the router. Does Tomato have a limit on this? If yes, can I increase it?

    TIA.
     
  2. Porter

    Porter LI Guru Member

    I don't know whether there is a limit. But depending on the router executing the script can take a while. Most of the time you can still access the router over http or ping it with some delay. What about adding only 100 routes and see how that goes?
     
  3. catbit

    catbit Networkin' Nut Member

    I tried your suggestion. I can add about 860 lines of routing information to Tomato, then my router crashes.

    BTW, the router I'm using is an ASUS WL-520GC modded with 8MB flash and 64MB memory.

    Any way I can expand such limit?
     
  4. KyleS

    KyleS Networkin' Nut Member

    Can you give some example routes?

    I'm finding it hard to believe you can't use summarization.
     
  5. catbit

    catbit Networkin' Nut Member

    Here they are:
    Code:
    route add -net 2.23.149.0/24 gw $1
    route add -net 4.28.128.0/24 gw $1
    route add -net 8.5.1.0/24 gw $1
    route add -net 8.6.19.0/24 gw $1
    route add -net 8.14.117.0/24 gw $1
    route add -net 8.17.172.0/24 gw $1
    route add -net 8.18.200.0/24 gw $1
    route add -net 8.23.224.0/24 gw $1
    route add -net 10.1.0.0/24 gw $1
    route add -net 12.69.32.0/24 gw $1
    route add -net 14.136.67.0/24 gw $1
    route add -net 14.199.45.0/24 gw $1
    route add -net 23.2.129.0/24 gw $1
    route add -net 23.15.1.0/24 gw $1
    route add -net 23.21.227.0/24 gw $1
    route add -net 23.21.238.0/24 gw $1
    route add -net 23.21.242.0/24 gw $1
    route add -net 23.21.253.0/24 gw $1
    route add -net 23.45.175.0/24 gw $1
    route add -net 27.98.194.0/24 gw $1
    route add -net 31.192.116.0/24 gw $1
    route add -net 38.99.68.0/24 gw $1
    route add -net 38.99.106.0/24 gw $1
    route add -net 38.101.213.0/24 gw $1
    route add -net 38.101.236.0/24 gw $1
    route add -net 38.103.23.0/24 gw $1
    route add -net 38.103.62.0/24 gw $1
    route add -net 38.113.1.0/24 gw $1
    route add -net 38.113.244.0/24 gw $1
     
  6. Porter

    Porter LI Guru Member

    That's what google told me:

    That's the value on my router:

     
  7. catbit

    catbit Networkin' Nut Member

    I have this:
    Code:
    # cat /proc/sys/net/ipv4/route/max_size
    16384
    Then I do:
    Code:
    echo 163840 > /proc/sys/net/ipv4/route/max_size
    But it still doesn't work. The router still crashes.
     
  8. mstombs

    mstombs Network Guru Member

    If you are building your own tomato k2.4 firmware I suggest you try removing a "speedmod patch" to

    tomato/release/src/linux/linux/net/ipv4/route.c

    Code:
        /* SpeedMod: Tuning */
    /*
        ipv4_dst_ops.gc_thresh = (rt_hash_mask + 1);
        ip_rt_max_size = (rt_hash_mask + 1) * 16;
    */
        ipv4_dst_ops.gc_thresh = (rt_hash_mask + 1);
        ip_rt_max_size = (rt_hash_mask + 1) * 2;
    which seems to reduce the default max_size by factor of 8.
    Not sure if changing the value from the proc interface works properly - but you may have to also change gc_thresh, and always use a power of 2?
    Your experiment above suggests that max_size/20 is the maximum No of routes - but the kernel shouldn't crash so maybe some other ratios of buffer sizes are wrong!

    This looks to be potentially a big problem:-

    Code:
    dmesg |grep "IP route"
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    Also wonder if the BusyBox "route" command failing, you could also try to add routes using the "ip" tool
    Code:
    ip route add 1.0.0.0/8 ...
     

Share This Page