Hello All,
I would like to have a backup internet connection to maintain a 100% up-time of the Internet.
We want to achieve this by automatically switching between the internet links if it fails (i.e for eg. if the BSNL link goes off, it has to take the AIRTEL link and once the BSNL link is ready, it has to switch automatically to it.)
Can anyone throw some guidance on achieving the same.
Thanks & Regards, George John.
We want to achieve this by automatically switching between the internet links if it fails (i.e for eg. if the BSNL link goes off, it has to take the AIRTEL link and once the BSNL link is ready, it has to switch automatically to it.)
BSNL and Airtel will give you two separate DSL lines with two distinct DSL modems to dial in, and hence, you'll end up with two distinct IP addresses. The only plausible solution that I can think of is to have a gateway box with two distinct ethernet interfaces. Unless you do something really clever, I'm not really sure how you'd really "switch" between them*. You'd effectively be using both simultaneously and you'd have 100% uptime unless both of them go down at the same time.
* Switching requires that you run a daemon that keeps pinging the ISP's gateway to check if the link is up. When the link goes down, it should automatically take the current ethernet interface down and bring up the other interface. I'm not sure it's worth the trouble.
On Monday 04 May 2009 11:38:33 Ramkumar R wrote:
- Switching requires that you run a daemon that keeps pinging the
ISP's gateway to check if the link is up. When the link goes down, it should automatically take the current ethernet interface down and bring up the other interface. I'm not sure it's worth the trouble.
my experience with bsnl/airtel is that even if you can ping the gateway, the line may still be down further up the chain. You need to be able to ping something like google.com through the relevant ethernet card.
my experience with bsnl/airtel is that even if you can ping the gateway, the line may still be down further up the chain. You need to be able to ping something like google.com through the relevant ethernet card.
There's no reliable way to assert if a link is "working" then. Pinging the gateway will only tell you if the link is technically up. There are scenarios where you can access some websites but not others.
On Monday 04 May 2009 11:58:06 Ramkumar R wrote:
my experience with bsnl/airtel is that even if you can ping the gateway, the line may still be down further up the chain. You need to be able to ping something like google.com through the relevant ethernet card.
There's no reliable way to assert if a link is "working" then. Pinging the gateway will only tell you if the link is technically up. There are scenarios where you can access some websites but not others.
true - I was admin of a server where we had 4 ISPs - and went by the rule of thumb that if I could ping google.com, *then* it is technically up. At least that way I could tell users: ok, *I* can ping google so as far as I am concerned the link is up.
Kenneth Gonsalves wrote:
On Monday 04 May 2009 11:38:33 Ramkumar R wrote:
- Switching requires that you run a daemon that keeps pinging the
ISP's gateway to check if the link is up. When the link goes down, it should automatically take the current ethernet interface down and bring up the other interface. I'm not sure it's worth the trouble.
my experience with bsnl/airtel is that even if you can ping the gateway, the line may still be down further up the chain. You need to be able to ping something like google.com through the relevant ethernet card.
True. Mostly it is the DNS servers that don't come up properly.
On Tuesday 05 May 2009, Rony wrote:
Kenneth Gonsalves wrote:
On Monday 04 May 2009 11:38:33 Ramkumar R wrote:
- Switching requires that you run a daemon that keeps pinging the
ISP's gateway to check if the link is up. When the link goes down, it should automatically take the current ethernet interface down and bring up the other interface. I'm not sure it's worth the trouble.
my experience with bsnl/airtel is that even if you can ping the gateway, the line may still be down further up the chain. You need to be able to ping something like google.com through the relevant ethernet card.
True. Mostly it is the DNS servers that don't come up properly.
This can be solved by using opendns or installing bind and running it as a caching NS; unless there are ISPs that block recursive queries going out of your network to the root servers/TLDs and the domain SOAs. MTNL and AirTel do not; Reliance/TataIndicom/BSNL ?
On Tuesday 05 May 2009 20:36:21 Arun Khan wrote:
True. Mostly it is the DNS servers that don't come up properly.
This can be solved by using opendns or installing bind and running it as a caching NS;
nope - it is not the DNS servers as such going down, but some link between the gateway and the internet - so even using opendns and running one's own cacheing NS doesnt work. Although it is better than using BSNL/AIRTEL nameservers
On Monday 04 May 2009, george@annamsoft.com wrote:
Hello All,
I would like to have a backup internet connection to maintain a 100% up-time of the Internet.
We want to achieve this by automatically switching between the internet links if it fails (i.e for eg. if the BSNL link goes off, it has to take the AIRTEL link and once the BSNL link is ready, it has to switch automatically to it.)
Can anyone throw some guidance on achieving the same.
Alternate 1.
1. Write a script to check traffic through both links and to switch the "default route" to the iface that is up. 2. Test the script with all possible scenarios. 3. Run it as a cron job.
Alternate 2. Google key words "linux router project" gives a whole bunch of projects.
I found this particular one interesting (from my old notes) but have not had the chance to evaluate it mainly because I do not have multiple ISP connection http://www.easylivecd.com/english/cdrouter/
Please do post your experience.
HTH
On Monday 04 May 2009, george@annamsoft.com wrote:
I would like to have a backup internet connection to maintain a 100% up-time of the Internet.
We want to achieve this by automatically switching between the internet links if it fails (i.e for eg. if the BSNL link goes off, it has to take the AIRTEL link and once the BSNL link is ready, it has to switch automatically to it.)
What is the equipment terminating the line?
If these are DSL lines, you can set up a Linux box that runs PPPoE for all your links directly. Then it's trivial to be able to determine if the link is up or not: if the PPP process of the link is up, you can route through it. Run a small script that checks the link status every minute and sets the default route according to which link is up. NAT-ing on this Linux box will allow the rest of your LAN to access the 'net.
If you're running proper routers for each link, you'll need to write a slightly longer script that will check transmission through each router and set the default gateway depending on which router is letting transmissions through. Again, NAT your LAN traffic through the Linux box that does this.
You can also load balance between multiple links using Linux if you're feeling adventurous.
Regards,
-- Raju
Hi Raju,
The equipment terminating the 2 Internet lines are DSL modem/router.
I am planning to set up UNTANGLE as the gateway to the Internet. Is it possible to set more the one Internet line on UNTANGLE.
Can you tell me the script that will check the link status every minute and sets the default route to the link which is up.
Regards, George John
What is the equipment terminating the line?
If these are DSL lines, you can set up a Linux box that runs PPPoE for all your links directly. Then it's trivial to be able to determine if the link is up or not: if the PPP process of the link is up, you can route through it. Run a small script that checks the link status every minute and sets the default route according to which link is up. NAT-ing on this Linux box will allow the rest of your LAN to access the 'net.
If you're running proper routers for each link, you'll need to write a slightly longer script that will check transmission through each router and set the default gateway depending on which router is letting transmissions through. Again, NAT your LAN traffic through the Linux box that does this.
You can also load balance between multiple links using Linux if you're feeling adventurous.
Regards,
-- Raju
Raj Mathur raju@kandalaya.org http://kandalaya.org/ GPG: 78D4 FC67 367F 40E2 0DD5 0FEF C968 D0EF CC68 D17F PsyTrance & Chill: http://schizoid.in/ || It is the mind that moves -- http://mm.glug-bom.org/mailman/listinfo/linuxers
On Monday 04 May 2009, george@annamsoft.com wrote:
Hi Raju,
The equipment terminating the 2 Internet lines are DSL modem/router.
Just put both routers in bridge mode and run PPPoE on a Linux server then. The script would be something like this (may need tweaking):
while : do for iface in 0 1 do if ifconfig ppp$iface > /dev/null 2>&1 then /sbin/route delete default /sbin/route add default dev ppp$iface fi done done
I am planning to set up UNTANGLE as the gateway to the Internet. Is it possible to set more the one Internet line on UNTANGLE.
Sorry, no clue what untangle is.
Can you tell me the script that will check the link status every minute and sets the default route to the link which is up.
Regards,
-- Raju
Can you pl. explain me the below line from your while...do loop.
if ifconfig ppp$iface > /dev/null 2>&1
Rgds, George
On Monday 04 May 2009, george@annamsoft.com wrote:
Hi Raju,
The equipment terminating the 2 Internet lines are DSL modem/router.
Just put both routers in bridge mode and run PPPoE on a Linux server then. The script would be something like this (may need tweaking):
while : do for iface in 0 1 do if ifconfig ppp$iface > /dev/null 2>&1 then /sbin/route delete default /sbin/route add default dev ppp$iface fi done done
I am planning to set up UNTANGLE as the gateway to the Internet. Is it possible to set more the one Internet line on UNTANGLE.
Sorry, no clue what untangle is.
Can you tell me the script that will check the link status every minute and sets the default route to the link which is up.
Regards,
-- Raju
Raj Mathur raju@kandalaya.org http://kandalaya.org/ GPG: 78D4 FC67 367F 40E2 0DD5 0FEF C968 D0EF CC68 D17F PsyTrance & Chill: http://schizoid.in/ || It is the mind that moves -- http://mm.glug-bom.org/mailman/listinfo/linuxers
On Tuesday 05 May 2009, george@annamsoft.com wrote:
Can you pl. explain me the below line from your while...do loop.
if ifconfig ppp$iface > /dev/null 2>&1
$iface is 0 or 1 or whatever. ppp$iface is ppp0 or ppp1...
ifconfig ppp0 > /dev/null 2>&1 will try to get the status of interface ppp0. We discard the output of ifconfig since we're not interested in it by sending it to /dev/null.
ifconfig exits with 0 (true) or non-zero (false) depending on whether it could get that status of the specified interface or not. We check the exit value in the if and perform tasks accordingly.
help if man ifconfig man sh (look at the REDIRECTION and Parameter Expansion sections)
Regards,
-- Raju
while : do for iface in 0 1 do if ifconfig ppp$iface > /dev/null 2>&1 then /sbin/route delete default /sbin/route add default dev ppp$iface fi done done