Link to home
Start Free TrialLog in
Avatar of lolaferrari
lolaferrariFlag for United Kingdom of Great Britain and Northern Ireland

asked on

what is the maximum number of static routes allowed in a routing table on a Redhat 6.9 server?

I am running Redhat 6.9 and i am investgating an intermittent connectivity problem with a health checking ping between an F5 loadbalancer and a vmware virtual server running Redhat 6.9

The server is showing in the vmware log vmsvc that the max number of static routes 100 has been reached. However, the max_size for the routing cache is 8388608. Do you know if this kernel setting for the max size in the routing table is the same as the max. routes in the routing table?  I have googled the vmsvc error and apparently upgrading to a later version of the package gets rid of the errors but I'd also like to understand the setting for the maximum number of static routes allowed on a Redhat server.

cat /proc/sys/net/ipv4/route/max_size
8388608

Thanks for any assistance with this.
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

That setting is the "Maximum size of the routing cache. Old entries will be purged once the cache reached has this size."  Therefore, it is not the same as maximum number of static routes.
Likely what you're looking to set will be these...

net16 # sysctl -a 2>/dev/null | grep route.max_size
net.ipv4.route.max_size = 2147483647
net.ipv6.route.max_size = 4096

Open in new window


You'll just have to bump up the ipv4 or ipv6 count to effect this.

Likely doubling the number will allow close to 200 routes... generally... as routing table entries are roughly all the same size.
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skullnobrains
skullnobrains

Do you know if this kernel setting for the max size in the routing table is the same as the max. routes in the routing table?

the routing table and the cache are 2 different things. the cache merely allows faster lookups. afaik ( not sure i remember correctly ) the cache stores ips rather than network/mask so that maximises the number of hosts you can chat with simultaneously efficiently.

the max_size setting is in bytes. the above mentionned size should be able to hold much more than 100 routes. ipv4 routes require 4 bytes for the address, 4 bytes for the destination assiming hosts and next hop couples are stored.

the routes themselves require an additional 4 bytes for the mask ( hopefully 5 bits, not bytes with a proper implementation ) and a few bits for the metric and other flags

ipv6 routes are much larger. i guess you can do a similar math to guess a likely required size.

the linux routing algorithm consists in reading routes one by one until one matching route is found. without tweaks and hacks such as using multiple routing tables for parts of the internet, linux behaves poorly with hundreds of routes, and catastrophically poorly if you do bgp with over 50k routes. that should rather be done on bsd hosts which uses indexes and djikstra algorithm to find the best route arguably much more efficiently.

anyway that's not the issue here. i merely mention it because having more than 100 routes on a lan seems way too many

the routing might be the issue, but that would probably impact other hosts on the same physical server. so i'm mildly skeptical. if the server is busy and receives outside connections from all over the internet, you probably have more problems than ping check failures from the f5. maybe you use double attachment and forgot a vlan on one of the interfaces ? you may want to better describe the connectivity issue so we can pinpoint the actual issue more easily.