Posts Tagged ‘bandwidth load balancing’

How to disable route cache instead of manually flush cache



mostly when you are using the load balancing router in Linux. the caching system of iproute2 causes some problem. therefore you can manually flush it by “ip route flush cache” command or changing /proc/sys/net/ipv4/route/flush file into 1.  So that  type “echo 1 > /proc/sys/net/ipv4/route/flush ” command in your Linux.
also you can configure these options

Maximum size of the routing cache. The old entries will be purged when the cache reaches this size.
/ proc/sys/net/ipv4/route/max_size

Waiting period to clear the routing cache.
/ proc/sys/net/ipv4/route/min_delay

thats it

if you have further question just let me know


How to use two bandwidth for your Linux server

when you connecting more that an IP and different gateway. its important to you to split your bandwidth into different routing tables.

the tools you should install is iproute2 which is install in most Linux by default.

first you should create the routing tables. for instance i am using two bandwidth.

echo ” 252        table1″   > > /etc/iproute2/rt_tables

echo ” 253        table2″   > > /etc/iproute2/rt_tables

now beside that you have default routing table,  two more routing table added to your Linux router. and you should specifies how your routing tables works.

ip route add default via $yourFirstgateway dev $firstdev table table1

ip route add default via $your2NDgateway dev $2nddev table table2

and also you shold specifies when these tables will be used. ” ip rule” is the tools by which you can specifiy how to each packet route based on their destinatio and source and …. . in this case we determin the linux router to route the packet based the souces IPs.

ip rule add from $yourSourceIP table table1

ip rule add from $your2NDIP table tabl2

thats it!!! its over. by entering these simple command you can be ensure that your server response each request to server by the called IP:).

     Copyrighted Mehdi Behamin , All Rights Reserved
Blog has been visited 204228 times