Archive for October, 2009

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 186954 times