We are trying to load balance a couple of servers, but want to give the servers full NIC speed communication between the frontend and backend servers. To accomplish this I am multihoming my frontend servers so that one interface can communicate to the backend servers bypassing the loadbalancer and the other interface is used only for the load balanced web traffic.
I have been reading the “Linux Advanced Routing & Traffic Control HOWTO” and know that this is possible, but I am hoping to do it through the standard SuSE configuration files.
It appears from the documentation that the configuration is for forwarding traffic through the linux box as a router whereas all I want is for my linux box to forward internal processes to the correct interface. For example, if someone hits the webserver on port 80 using the servers address I want it routed directly to the client. Likewise, if the request is sent to the load balancer cluster and is forwarded to the loadbalancer interface on the server I want the traffic sent back to the loadbalancer as the gateway. I will never need traffic forwarded from the internal network to the load balancer network.
Does anyone have any suggestions as to where the proper place for this configuration is on a linux server? I could put some of the information in the ifroute-XX files, but where do the route rules go?
Would I be better of writing if-up and if-down scripts to add and remove these routes as the interfaces are brought up and down?
Thanks,
Chad
LOADBALANCED ROUTING TABLE
ip route add $LOADBALANCE_NET dev $LOADBALANCE_DEV src $LOADBALANCE_IP table T1
ip route add default via $LOADBALANCE_GATEWAY table T1
INTERNAL ROUTING TABLE
ip route add $INTERNAL_NET dev $INTERNAL_DEV src $INTERNAL_IP table T2
ip route add default via $INTERNAL_GATEWAY table T2
MAIN ROUTING TABLE
ip route add $LOADBALANCE_NET dev $LOADBALANCE_DEV src $LOADBALANCE_IP
ip route add $INTERNAL_NET dev $INTERNAL_DEV src $INTERNAL_IP
ip route add default via $INTERNAL_GATEWAY
ROUTING RULES
ip rule add from $IP1 table T1
ip rule add from $IP2 table T2