Lai
July 13, 2010: 8:09 pm
Hi Angsuman, Is there a way to maintain failover feature but disable load balancing ? Meaning I only allow LAN users to use first internet line and failover to second line if first line down. I am thinking to increase the weight of first line to very high value (may be 100) so that almost all LAN users forced to use the first line .. My purpose is to eliminate frequent disconnect issues. Pls advise ..Thanks Lai

Ajayan
June 15, 2010: 4:04 pm
Very good Article..But when i am trying to download the Script ,its showing a new page with Script.I am not able to view the Script in proper manner...Any body having Exact copy Of the Script,Please upload it once again.....

jay
May 22, 2010: 5:53 am
Hello, i just wanted to merge the multiple(different ISP) bandwidth for my Internal LAN & the can able to use total bandwidth in a single pool. If you have a script & the solution for this please let me know, i will be ver thankfull to you thanks n regards, Jay Dixit

Gabriel
May 10, 2010: 7:41 pm
Congratulations for the great article, it helped me a lot!!! I'm having only one issue with the connection being load balanced. When I access a bank site, after the login, the page tells me that that session was closed and when I use applications like MSN, it connects and disconnects a lot of times. This happens when I'm using NAT or directly via a proxy on the same machine. I tought that the connections would be persistent after they started over a link. Could you shed some light over here? Thanks in advance.

JP
May 10, 2010: 8:34 am
If you want to look at a product-based approach there is Elfiq - https://www.elfiq.com - simpler to have a product deliver this in many scenarios

RichWalu
May 4, 2010: 1:21 pm
This is a great piece of work. I am newbie in Linux and my server is running Suse10. Please, can someone point out the equivalent of /etc/rc.local and /usr/sbin in Suse10 environment. Thanx

Jimmy
March 25, 2010: 7:15 am
Hi amitbiswa, What part do you mean? I've set up the load balancing and fail over just like the howto from Angusman. besides that i have shorewall running and used the tcrules from shorewall (just google tcrules + shorewall) to mark specific data, which is then routed through a specific internet connection. The only problem i see is that when you specify to many things in there you don't use the load balancing really optimal because i've set it up myself and the load balancer does all the not specified traffic.

amitbiswas
March 16, 2010: 6:00 am
Hi Angsuman, Great howto, perfect logic. Hi Jimmy, Could you please give me some details how you have deploy this into your ubuntu. Thanks in advance.

Jimmy
January 27, 2010: 8:33 am
Hello, Thanks for the great howto. I have set up a ubuntu server and used the howto to set up load balancing and fail over just like the howto. Everythig works great, except for one thing, when i use an internet radio or my accounting software with citrix or MSN messenger, the connection is lost every now and then (happens a couple of times an hour, totaly randomly) one day more then another. Because i have 1 slow ADSL connection and one fast cable broadband connection i have set the weight to 1 to 20, we have around the 14 computers connected to the lan. I als put a line in the tcrules from my shorewall firewall which ( i think) routes, for example, all the internet radio using port 8000 throug one specific internet connection. do you have any idea how i can fix this, or what the problem may cause?

Joe
January 26, 2010: 8:46 am
My Messenger keeps reconnecting after i did this solutions for fail-over, what should i do ?

M.Azath
January 19, 2010: 4:45 am
can you give me some pdf material which is very relevant to load balancing in internet.

Travis
January 14, 2010: 8:26 pm
Thank you for the above scripts, I've found them very useful. I do however have a problem. My staff made use of remote desktop from our LAN out the broadband services to the greater internet. When using the above script ever 600 seconds or so the remote desktop session drops out and re-connects? I read that I need to: echo “144000″ > /proc/sys/net/ipv4/route/secret_interval is this correct? whilst it resolved my drop out issue from ever 600 seconds to every 4 hours am I missing something or do you all experience the same problem? Thanks, Trav to set the
January 11, 2010: 8:36 am
came from google, your article is very helpful, thank you very much.

Fausto
December 14, 2009: 7:10 pm
Thank you very much for this! It was perfect with two dedicated links that I manage. Success for you!

Polleke
November 26, 2009: 11:25 am
I have used (a modified version) for a three-way connection.. it needed some hacking.. I will see if i can post it somewhere. Thnx for the script. It _would_ however be so much more configurable if it it was split up in a config file /etc/gwping/gwping.conf the script itself and forementioned init.d script.. I will rewrite my version next august and try to keep you guys posted

yermet
November 24, 2009: 3:19 am
Thank you for this post!! I needed to do this but for a unique installation in several computers for various environments from 1 to 5 WAN. I managed to create 2 scripts, one for the initial configuration of the interfaces and the second one modifying your script, so indicating the quantity of WAN available by parameter to the script it will balance over 2-5 WAN. Finally you only have to modify the file rc.local to configure the whole loadbalance and failover. nohup /usr/sbin/lbinit 3 & nohup /usr/sbin/gwping 3 & And it works!! ;) Thank you again!!

balaji
November 19, 2009: 11:48 pm
hi Is there a way wherein in can load balance two tata photon usb modem on linux pc?

Jaime
November 15, 2009: 4:10 pm
Thank you for this blog post. It really helped me a lot to setup load balancing and failover on my machine.

Gregorio
November 2, 2009: 7:45 am
Which linux distribution do you suggest to make this solution? Greg

Pravin Oza
September 29, 2009: 10:50 am
I have 10 mbps Internet Leased L. used in College. I want to divide bandwidth as 6:4 mbps in two building in the same campus. I have Cisco 2811 router. Which router and L2 switch configuration require for BW divide respectively in between 2 buildings.

Jan Marc Hoffmann
August 27, 2009: 1:21 pm
Heya! This guide is very nice, but its quite complicated. Why do you use so many interfaces and subnets? Its not necessary. Here is an easy setup: Router1: 192.168.0.2 (eth0) Router2: 192.168.0.3 (eth0) Balancer Gateway: 192.168.0.1 (eth0) Balancer Gateway Config: ip route add default scope global nexthop via 192.168.0.2 dev eth0 weight 1 nexthop via 192.168.0.3 dev eth0 weight 4 echo "1" > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE And add some dns proxy or some iptables rules for dns... Thats all. Works like a charm. You wont need tons of interfaces, nics or routing tables. greetings Jan Marc

zaw hkawng
August 12, 2009: 6:52 am
Hi Some 1 help me ! Pls I m linux beginner user. I want to test for internet share.I heard squid is very good for it,but I don't know how to do it, could you send me step by step configuration by mail.My email is here zawhkawng@gmail.com Thank u very much

zaw hkawng
August 12, 2009: 6:40 am
Hi Some 1 help me ! I m linux beginner user. I want to test for internet share.I heard squid is very good for it,but I don't know how to do it, could you send me step by step configuration by mail.My email is here zawhkawng@gmail.com Thank u very much

Thiha
July 1, 2009: 12:25 pm
Could you please tell me how to test whether our linux box is being as a load balancing server or not. Although i use traceroute command, the output do not show multiple path.

Walter
March 30, 2009: 8:16 pm
Hi, Excelent How To. I'm using it with shorewall and it works fine, buy I have one question.. if I have a service which is reached from the outside for example a security IP camera. How can I assure that this camera will be reached from only 1 of my 2 IP addresses. Thanks, Walter

Daniel
March 10, 2009: 2:05 am
Hey. I accomplished to setup a load balancing between two interfaces too, made firewall rules, etc. and it all works pretty fine, except of one fact, which I'd like to share with you to see if somebody had the same problem. So, i load-balance with the same ip route commands like Angsuman showed above, except that my ISP speeds are the same, so i use a 'weight 1' twice. Now, every once in a while it happens that a user (fyi: we have about 20-25 users) gets stuck while browsing the web. once you hit refresh the site will be loaded though. It's not bound to certain sites, it happens randomly. I suspect my DNS setup but the fact that i use a non-authoritative DNS (forward only) makes me think it's another problem. Did anybody experience similar problem s and if yes, how did you fix it ? Any help is very appreciated. Thanks, Daniel (and thanks angsuman for your contribution to this topic)

Bernardo Burnier
February 28, 2009: 6:18 pm
Who wants to mess with his kernel and deal with complex and poorly documented solutions, or even to fork out some big buck$ to solve this problem, when it can be done, as you presented here, with a smart little bash script on a linux box? After reading all the cluttter floating around the internet about how to LB (and there's a lot) I can only say that this is a simple yet powerfull solution. Thank you for showing the way.

Wilson
February 24, 2009: 4:53 am
Great job. I will like to implement it with 3 isp's. How can it be done? Thanks in advanced.

Martin Pusch
February 20, 2009: 5:30 pm
Thank you for sharing your experience with others. I am working in Africa, where the Internet connections are not always easy to manage, and your informations helped me a lot. Martin

Murali Krishna
February 18, 2009: 11:36 am
Hi Angsuman, "fail-over over multiple load balanced ADSL/Cable connections" (gwping) script you have given only about 2 ISP's. How can i change that script for 3 ISP's? can you pls help me out. Thanks in advance.

slashdotfx
February 18, 2009: 8:27 am
Hi, greetings, came from google, your article is very helpfull, thank you very much.

Jason
January 15, 2009: 5:31 pm
There are commercial solutions to this problem as well. I work for a company that makes a product that load balances up to 12 lines. It's not cheap but it is robust and intelligent as we've been at it for 10+ years now. Just want to throw that out there.

Roberto
December 18, 2008: 7:38 am
Also, if the first connection (eth1) is the only one UP, everything works with no problems at all. But if the second connection (eth2) is the only one up, the internet connection on LAN computers doesn't work, but in the server it does. Maybe there is something with dns also. In the /etc/resolv.conf I have to put "nameserver 192.168.252.254" for the BRT (eth2) connection to work and resolve names, otherwise it won't work (i tried opendns servers, and they work for the eth1 connection). I only use dnsmasq with the default configuration (i don't have bind9 installed). Just to mention, the connections are from two different ISPs, they are ADSL (1 Mega for eth1 and 2 Mega for eth2), and I am in Brazil. The modems are exactly the same model with the same configuration. The eth1 connection has dynamic ip while the eth2 connection has static ip. Any clues? Thanks!

December 17, 2008: 2:09 pm
Hi... I just followed the instructions here... and it works partially for me. After a few hours, or randomly, the computers connected to the LAN can't access the internet anymore, but the router can. I don't know what's happening... maybe something is wrong the first lines of the rc.local (ip forward and masquerade, shown below) Anyone can help me? Thanks in advance. My /etc/rc.local file: echo 1 > /proc/sys/net/ipv4/ip_forward /sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE /sbin/iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE ip route add 192.168.251.0/24 dev eth1 src 192.168.251.1 table GVT ip route add default via 192.168.251.254 table GVT ip route add 192.168.252.0/24 dev eth2 src 192.168.252.1 table BRT ip route add default via 192.168.252.254 table BRT ip rule add from 192.168.251.1 table GVT ip rule add from 192.168.252.1 table BRT ip route add default scope global nexthop via 192.168.251.254 dev eth1 weight 1 nexthop via 192.168.252.254 dev eth2 weight 2 nohup /usr/sbin/gwping & exit 0 And my /etc/network/interfaces file: # The loopback network interface auto lo iface lo inet loopback # LAN interface auto eth0 iface eth0 inet static address 192.168.1.99 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0 #GVT auto eth1 iface eth1 inet static address 192.168.251.1 netmask 255.255.255.0 broadcast 192.168.251.255 network 192.168.251.0 #BRASIL TELECOM auto eth2 iface eth2 inet static address 192.168.252.1 netmask 255.255.255.0 broadcast 192.168.252.255 network 192.168.252.0

Roberto
December 17, 2008: 2:01 pm
Hi... I just followed the instructions here... and it works partially for me. After a few hours, or randomly, the computers connected to the LAN can't access the internet anymore, but the router can. I don't know what's happening... maybe something is wrong the first lines of the rc.local (ip forward and masquerade, shown below) Anyone can help me? Thanks in advance. My /etc/rc.local file: echo 1 > /proc/sys/net/ipv4/ip_forward /sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE /sbin/iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE ip route add 192.168.251.0/24 dev eth1 src 192.168.251.1 table GVT ip route add default via 192.168.251.254 table GVT ip route add 192.168.252.0/24 dev eth2 src 192.168.252.1 table BRT ip route add default via 192.168.252.254 table BRT ip rule add from 192.168.251.1 table GVT ip rule add from 192.168.252.1 table BRT ip route add default scope global nexthop via 192.168.251.254 dev eth1 weight 1 nexthop via 192.168.252.254 dev eth2 weight 2 nohup /usr/sbin/gwping & exit 0 And my /etc/network/interfaces file: # The loopback network interface auto lo iface lo inet loopback # LAN interface auto eth0 iface eth0 inet static address 192.168.1.99 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0 #GVT auto eth1 iface eth1 inet static address 192.168.251.1 netmask 255.255.255.0 broadcast 192.168.251.255 network 192.168.251.0 #BRASIL TELECOM auto eth2 iface eth2 inet static address 192.168.252.1 netmask 255.255.255.0 broadcast 192.168.252.255 network 192.168.252.0

Please
December 11, 2008: 3:46 am
Hi My ISP deny icmp so can replace ping to tcping? Please help me Please

Sri
December 3, 2008: 3:35 pm
Hi Angsuman I have checked the above without gwping script. It is working fine. but the problem is the fail over time is much high( around one two min). but we are developing a mission critical system with a failover time in sub second. at least 1 sec. so is it posssible to get that
November 15, 2008: 7:34 pm
Adding a flush cache is fine

Sehat
November 15, 2008: 6:34 am
when I use gwping and the configuration described here, I notice that intermittenly my network will become so slow in responding request from client. Finally, I figure out that it's because, when linux, switching the line, seems that the cached route, is not switch, and thus will make the line become slow. To overcome this problem I add "ip route flush cache" at the end of the script where the default route is changed. Take a look at this snippet, and you'll know where I mean. if [[ $CLS1 -eq 0 || $CLS2 -eq 0 ]]; then if [[ $LLS1 -eq 1 && $LLS2 -eq 0 ]]; then echo `date +%x--%X`" >> "Switching to $NAME2 ip route replace default scope global via $GW2 dev $EXTIF2 elif [[ $LLS1 -eq 0 && $LLS2 -eq 1 ]]; then echo `date +%x--%X`" >> "Switching to $NAME1 ip route replace default scope global via $GW1 dev $EXTIF1 elif [[ $LLS1 -eq 0 && $LLS2 -eq 0 ]]; then echo `date +%x--%X`" >> "Restoring default load balancing ip route replace default scope global nexthop via $GW1 dev $EXTIF1 weight $W1 nexthop via $GW2 dev $EXTIF2 weight $W2 fi ip route flush cache fi @Angsuman: What do you think about my assumption? Is it possible? Because I'm still a Linux newbie.
November 11, 2008: 8:46 pm
Thanks Sehat for the tip.

Sehat
November 11, 2008: 3:22 am
Guys, you can add time in the output just add `date +%H:%M:%S'" >> " .... at every echo. So the original echo $NAME1 down will be like this `date +%H:%M:%S'" >> "%NAME1 down This way, you can know when the line was down. Hope this help.
November 5, 2008: 8:43 pm
Hi rc3, Thanks for sharing it with our readers. This is very useful.

rc3
November 5, 2008: 4:10 pm
Hi Angsuman, First of all, really nice howto on load balancing + failover. I have been doing almost the same thing for my ISP employer. I would like to share my experience. 1) I split the traffic based on destination ports, i.e. web traffic go through ISP2 and the rest through ISP1. For those who want to implement this, use iptables combined with ip: iptables -A PREROUTING -t mangle -i ${LAN_IFACE} -p tcp --dport 80 -j MARK --set-mark 2 iptables -A PREROUTING -t mangle -i ${LAN_IFACE} -p tcp --dport 443 -j MARK --set-mark 2 ip rule add from all fwmark 2 table ISP2 2) The router that I worked on comes with a lower version of ip package and certain ip commands such as "ip route replace" will not work therefore I had to manually flush the routing tables and add back whatever is needed when routes need to be changed: ( I wish I could upgrade the ip package but the system is old and there's not even space to install gcc ) ip route flush table ISP1 > /dev/null 2>&1 ip route flush table ISP2 > /dev/null 2>&1 ip route add ... ip route rull add ... 3)Network detection, I don't feel it's a good idea to ping the same ip address every 40 seconds, therefore I use a pool of fix ips (all google's plus one from yahoo) and ping them randomly. 4)I also wrap up the ping operation in a function like this: #!/bin/bash #check_net $count $interval $timeout $ip check_net() { ping -c $1 -i $2 -w $3 $4 > /dev/null 2>&1 return `test $? == 0` } #usage examples: check_net 1 1 1 123.123.123.123 && echo "123.123.123.123 ping good" || echo "123.123.123.123 ping failed" check_net 1 1 1 127.0.0.1 && echo "127.0.0.1 ping good" || echo "127.0.0.1 ping failed" The reason I'm doing this is I can use check_net like this check_net 1 1 1 $ip_to_check || check_net 5 2 10 $ip_to_check || { do_something; do_another_thing; } Basically it reads: I just try to ping $ip_to_check 1 package with 1 sec interval and 1 sec timeout, if it's good, carry on, if not, increase the count to 5 and interval to 2 sec, timeout to 10 secs, if still not good, run the scripts inside { }

Panagiotis Palias
October 31, 2008: 7:39 am
Hello Angsuman, got here from google link and found your script useful. I also added the DNS and the mail servers of each provider in the custom tables, cause usually the providers don't lookup recursively the dns queries if the IP doesn't belong to them, as well as they don't relay mails from IPs other than their. ip route add to 194.219.227.2/32 via $P1 table $T1

Cristiano
October 28, 2008: 7:28 am
Why? ip route add default scope global nexthop via 192.168.1.1 dev eth1 weight 1 nexthop via 192.168.2.1 dev eth2 weight 1 Erro "RTNETLINK answers: Invalid argument"

Kamran
October 27, 2008: 3:17 am
Hi, Does Load Balancing/Fail over scripts work on proxy enabled host?
October 21, 2008: 9:15 am
Marc, That is correct. I don't face the problem because I run a local caching DNS server (named service on Linux). BTW: I use IP address of one of my dedicated server. We can also load-balance the IP for better reliability.

marc
October 21, 2008: 9:13 am
Hello, I set up a site with this config and it works perfectly with two different providers. The only thing I needed to change is the TESTIP address, when using a domain name as www.yahoo.com, I realized that when you ping you control the interface for the ICMP message but not for the DNS query. That is a problem since you might end up with a non response even when your interface is working. Anyhow, easy fix, use IP address instead of the domain name.

Pradeep Manjunath Prasad
October 21, 2008: 8:23 am
Hi, [........] # Do not change anything below this line LLS1=1 LLS2=1 # Last ping status. Don't change these values. LPS1=1 LPS2=1 .......... if [[ $CLS1 -eq 0 || $CLS2 -eq 0 ]]; then if [[ $LLS1 -eq 1 && $LLS2 -eq 0 ]]; then echo Switching to $NAME2 ip route replace default scope global via $GW2 dev $EXTIF2 ........ fi sleep $SLEEPTIME done [.............] Kindly please let me know how the variable CLS1,CLS2,LPS1,LPS2.etc values are changing in scrip......
October 17, 2008: 7:59 pm
Please refer to routing documentation for details.

nishith
October 17, 2008: 5:46 am
sorry I didnot quite understand the implication of the following line in the load balancing part ip route add default scope global nexthop via 192.168.1.1 dev eth1 weight 1 nexthop via 192.168.0.1 dev eth2 weight 4 I understand it is doing the load balancing - but which table do these entry go into - the main route table ? what does scope global and nexthop do ? and what does src imply in the above commands ? thanks in advance

Biojerk
October 16, 2008: 9:39 pm
How can i share the connection locally. I also have 2 ISP and 3 NICs I want to share the connection in our LAN side could you provide a different procedure for that. Thanks in advance.
October 13, 2008: 6:58 pm
Daniel, You can just hardcode routes for certain destination ip addresses using ip route.

Daniel Nelo
October 13, 2008: 7:55 am
Great Script Angsuman, great work! I have one issue tough, whenever some clients try to access online banking they get disconected because the internet IP has changed. I read that you have another script for preferential routing, could you provide it to us? Or give me some light of what to do in this case. Thanks in advance.
October 7, 2008: 8:26 am
[...] instalei dois links + rede interna usando esse tutorial aqui: How To: Load Balancing & Failover With Dual/ Multi WAN / ADSL / Cable Connections on Linux Funcionou perfeitamente e nem precisa de regras [...]
September 24, 2008: 12:36 pm
3 Cards - 2 for different wan / internet connections and one for intranet.

Devil
September 24, 2008: 4:37 am
hi, i have a question hows many Network Cards do you have in computer. in your code u only mentioned 2 Interfaces on which u r getting the Internet but what about the other LAN Computers how they will get internet. waiting for your reply. thanks in advance.
September 21, 2008: 9:38 pm
[...] currently have 1Mbps connection from Tata Indicom & 256Kbps connection from BSNL, both broadband connections are load balanced with fail-over for reliability and greater effective bandwid.... I am planning to add a third connection, preferably Airtel [...]
September 19, 2008: 1:38 am
I want something like this. 10.0.0.0/24 10.1.0.0/24 10.2.0.0/24 go from gateway 1 and 10.3.0.0/24 10.4.0.0/24 10.5.0.0/24 go from gateway 2 What extra entries i need to add please tell.

ajay vajpai
September 12, 2008: 7:46 am
we installed a peplink with our company and it did not help with voip because the bandwidth was very slow.. we are looking at other load balancing and failover for voip and internet. plese could you let me know about xroad network xrio ubm ande lfiq thank you for any asistance

Krishna Mohan
August 11, 2008: 5:39 am
Excellent article, which explains LB and Failover using iproute2 commands.

alexpapajim
August 3, 2008: 11:05 pm
how i'm supposed to link this load ballancer with my network and what settings i have to do to the client pcs.....? please help new in linux

alexpapajim
August 3, 2008: 11:03 pm
please help, new in linux...... how i'm supposed to link this load ballancer with my network? and what are the settings i have to do to the client pcs?

alexpapajim
August 3, 2008: 11:01 pm
sorry for the question i'm a new in linux and i can't figure out how i'm supposed to link this load ballancer with my network in order to work? do i need an extra ethernet ? and what i'm going to set up in the client pcs? please hepl me.....
July 25, 2008: 8:58 pm
I have provided the full script in the article above.

Rashid
July 25, 2008: 6:29 am
can any one provide script that ping the www.yahoo.com and set values (variables) or can anyone provide complete script that is working somewhere. thanks in advance
July 11, 2008: 7:13 pm
The routes are stored in the server. It does the load balancing for all. You can also assign specific routes to particular client machines or for particular target machines on the load balancing server or even assign particular load balancing strategies. > What would you recomend to obtain fail-over plus load balancing? As I used - shorewall with script based load balancing and failover on a Linux system as I explained above.

Marc
July 11, 2008: 9:04 am
Where are routes stored really? In clients computers or in the server acting as a load-balancing router? In case routes are stored on client machines, route based load balancing would help much in case one of the lines fails right? What would you recomend to obtain fail-over plus load balancing? Thank's for your great script, it's well written and easy to understand.
June 24, 2008: 2:44 am
[...] 4250 for over 1 Mbps download and 512 Kbps upload bandwidth. I have used the two connections to get reliable broadband at a fraction of the cost of leased [...]

Elwin
May 29, 2008: 1:10 pm
Hi.... i've come know this website through google My question is How can i add two gateways in Local LAN settings???? As in first Gateway is my Internet Gateway and second my exchange server.

Theuns
May 7, 2008: 10:22 pm
Hi! Hope you can help. I need to load-balance 8 x ADSL lines with fail-over(if a line goes dead, the route needs to be disabled & enabled again when it comes back on) I also need to be notified via email if a line goes down. How can I di that? I`m new to linux, and have no scripting experience. Thanks in advance Regards Theuns
May 6, 2008: 7:52 am
[...] read the original article - How To: Load Balancing & Failover With Dual/ Multi WAN / ADSL / Cable Connections on Linux. It contains detailed information with a sample script. Viliam Kočinský modified my script to [...]

veena Nandakumar
May 6, 2008: 3:58 am
Hai Thankyou for the script mine one question- Presently we are using TATA,If it goes down It has to change into BSNL automaticaly,What changes I need to make for that script and How can I check From which connection It is working. I am new for this field, Please help me out in this Please Thanks in advance Regards Veena

Eduardo
April 11, 2008: 11:45 am
hehe.. I fogot global $EMAILTO :) EMAILTO="youremail@yourdomain.com"

Eduardo
April 11, 2008: 11:43 am
This work like a charm! Also I made an improvement to scritp to have email notification where an interface is up or down. The comman that I use 3 times before \"ip route replace...bla..bla\" is: printf \"WAN Conection $NAME1 is UP!\" | mail -r linux-host@localdomain.com -s \"WAN $NAME1 is UP!\" $EMAILTO Regards from Argentina! P.D: You can use a flag to avoid notification when script run for fist time ;)

Rajjayswal
March 19, 2008: 7:10 am
hiii iam rajjayswal form mumbai how to setup loadblace with internet cash in inux pls help me ...
January 11, 2008: 7:49 am
Antonio, You could use fwmark for this purpose with some trickering at the routing tables. https://lartc.org/ might point you out how to use packet marking with the routing tables; Specifically this page: https://lartc.org/howto/lartc.netfilter.html Hope it helps you

Aatif Ali
January 9, 2008: 12:43 am
Excellent work Angsuman, You did really well but I feel there is need to mention how to check wheather its working or not. I mean can you please describe the way through which we check load balancing is working or not. Thanks A lot Regards, Aatif
January 2, 2008: 12:00 pm
Hey, great article. I've been looking for something that describes a current linux distro and all the other guides I've found so far are from 2004 or before or guides that only describe theory. Great if you want to pass a test, waste of time if you're just trying to get something working. Thanks a ton!
November 18, 2007: 9:10 pm
Yes, I use a script to do preferential routing. The script is tied to this script. It uses preferably one network when available. Otherwise it is forced to switch to the other.
October 25, 2007: 8:30 am
You can use Shorewall Firewall to do preferential routing.

Antonio
October 25, 2007: 5:59 am
Hello, I came here from Google. I'm trying to do something like this here in my office. The load balance and the fail over are OK, but there's something that gonna make me crazy! Here, we use Skype a lot, and other programs that need a continuos connection, such VPN's and SSH, and a ERP called Microsiga (We have other office in other city, about 40 Km (25 miles). Do you have some script that force traffic from such ports to go out ALWAYS with eth2 (like email, skype, our ERP) and use the eth0 for other traffic (http, ftp, etc). Thanks in advance