Koozali.org: home of the SME Server

Dual WAN / Multi-bonding

enigma

Dual WAN / Multi-bonding
« on: October 27, 2002, 07:11:54 PM »
HAs anyone out there any experience of successfully or even at all configuring the mitel server to run 2 wan interfaces.

one to one isp and another to another or the same and bonding the 2 channels, heck it mught even be possible to set to failover to each other as well

Heres hoping

Enigma :)

Kelvin

Re: Dual WAN / Multi-bonding
« Reply #1 on: October 27, 2002, 11:32:29 PM »
Darrel May was asking for expressions of interests on this very thing over in Devinfo a little while back (although I think he was more concerned with failover than increasing your bandwidth through bonding). I did read somewhere that most RH distros can be configured to use multiple WAN links and just "round-robin" the interfaces to sort of spread out the load - not elegant or perfect but sort of works.

Kelvin

Nathan Fowler

Re: Dual WAN / Multi-bonding
« Reply #2 on: October 28, 2002, 12:14:24 AM »
I've done it before, there is also a kernel patch that allows for load balancing across those two WAN interfaces.  It's not OSPF or BGP, but a utilization based load balancing.  Combined with round-robin DNS, you would have the best of both worlds.

I'll see if I can dig up that link for the kernel patch.

Nathan

Mariano Luna

Re: Dual WAN / Multi-bonding
« Reply #3 on: October 30, 2002, 11:30:14 PM »
I want to do the same thing, but so far i couldn't acomplish anythng...

Any help would be appreciated.

---- This was my post
http://forums.contribs.org/index.php?topic=15444.msg59341#msg59341

Kelvin

Re: Dual WAN / Multi-bonding
« Reply #4 on: November 05, 2002, 05:43:24 AM »
Hi Nathan,

Can you provide me details on how to configure a secondary WAN interface into SME (baby steps please) ? I'm more interested in failover than load balancing.

Here, we can get very basic ADSL accounts (with no bundled traffic) at relatively low monthly fees. These accounts would be ideal for a backup WAN account. However, as any traffic used is charged at premium rates, load balancing with this sort of account would be expensive.

TIA !

Kelvin

Nathan Fowler

Re: Dual WAN / Multi-bonding
« Reply #5 on: November 05, 2002, 04:30:50 PM »
Here's an idea, if you want fail-over support.

Install the secondary NIC, create the necessary ifcfg scripts.  Lets stay it's called ifcfg-eth2.

Create a cron script to ping your secondary hop every 2 or 3 minutes, 3 pings.  If 100% packet loss, then ifdown-eth0 (Assuming this is external) and ifup-eth2 (Your backup).  Then, signal another event to check the status of eth0's route periodically to see if you need to reverse it.

Kelvin

Re: Dual WAN / Multi-bonding
« Reply #6 on: November 05, 2002, 11:17:09 PM »
Hi Nathan,

Here's a snippet of a prior discussion I was having with Darrell May on a similar subject. Note : Stay Alive script mentioned below written by Brian K. High.

Begin Excerpt
==========
What I had in mind by extending on the Stay Alive script was to do a similar thing but with a third NIC (say eth2) interface as a WAN side connection. Then if the primary WAN link fails (eth1), we somehow rename eth2 as eth1 and vice versa (so as to avoid breaking all SME scripts which assumes eth1 as the WAN interface) and then bring up the link. Meanwhile, periodically try to bring up eth2 and see if it has come back alive. If it has, switch them back around again. And if we want to get really fancy (read as complicated), if both eth1 and eth2 does not work, fall back to dial up.

My problem basically boils down to lack of knowledge on many fronts (having been a Windows person for too many years and Linux experience is still fairly much in the Growing Pains stage). For example :-
1. Don't know if it is possible to configure another NIC into SME as a WAN side NIC
2. If possible, how.
3. Don't know if Linux allows us to rename an interface (ie swap eth1 and eth2 around).
4. If possible, how and can it be done without needing a server reboot.
5. Not enough experience with bash and perl programming (learning but still infantile - have full time job still supporting Windows environment).

=========
End Excerp

However, if I understand your post correctly, I'm assuming we do not need to rename the interfaces in order for the second WAN interface to work ? If so, will all firewalling rules, etc. still automatically apply to the secondary WAN interface ?

Kelvin

Nathan Fowler

Re: Dual WAN / Multi-bonding
« Reply #7 on: November 05, 2002, 11:33:39 PM »
It's definatley possible.  I don't believe (4.1.2 doesn't, based on /etc/rc.d/init.d/masq) the MASQ rules reference the interface directly, so as long as your default routes are correct you shouldn't need to re-init MASQ.  I've done similar things like this before in the past, however, it would be rather difficult for me to test at home because I don't have dual interfaces and my SME box sits about 45 minutes away from me. :)

Basically, you could:
1) Create new ifcfg scripts for eth2
2) Create a Cron job to check if the route for eth0 is accessible, by using ping -I
3) If eth0 is down (100% packet loss), ifdown eth0, ifup eth2, start eth0 monitoring perl program.

The problem would be detecting when eth0 was accessible again, but you can use ping -I to specify an interface, so the same script that brought up eth2 would need to trigger a perl script to periodically bring up eth0, ping the second or third hop using the eth0 interface, and if everything was back up it would drop eth2, if it was still down it would re-test again in X minutes.

This isn't something outside of my scope, but I just don't have the environment for testing.

Hope this helped,
Nathan

enigma

Re: Dual WAN / Multi-bonding
« Reply #8 on: November 07, 2002, 10:06:25 PM »
Hi Nathan,

i have the necesary equipment and ethernet presentation accounts if you want to give it a go - i am a relative newbie (in terms of experience) to linux but am willing to give this some work.

??interested in giving it a go??

Nathan Fowler

Re: Dual WAN / Multi-bonding
« Reply #9 on: November 07, 2002, 10:42:50 PM »
Sure, there would be a trust issue though, since I would need your root password.  Are you wanting to do backup routing, or load balancing?

Nathan

Mariano Luna

Re: Dual WAN / Multi-bonding
« Reply #10 on: November 07, 2002, 11:40:51 PM »
I'm gathering up a test linux box to do this for load balancing.
 My knowledge in linux is not that good so i'll be probably posting my problems here soon.

Mariano Luna

Re: Dual WAN / Multi-bonding
« Reply #11 on: November 07, 2002, 11:40:53 PM »
I'm gathering up a test linux box to do this for load balancing.
 My knowledge in linux is not that good so i'll be probably posting my problems here soon.

enigma

Re: Dual WAN / Multi-bonding
« Reply #12 on: November 10, 2002, 02:15:50 PM »
Kelvin, Nathan, Mariano,

If you fellas would like to email me off list. I think we can get going on this project.......

And then maybe present a howto back to the community....

Looking forward to your contact

Enigma

Mariano Luna

Re: Dual WAN / Multi-bonding
« Reply #13 on: November 11, 2002, 05:39:43 PM »
Hi you all,

I'm finishing setting up the new sme 5.5 for testing purposes.
I think it will be up by tomorrow. I keep you informed.
I prefer you to send mails to this e-mail address is the one I read most.

Regards,

MarianoL
BIXHF WBP
marianol_AT_unestilo.com
--------------------------
   )
 (
[_]? www.unestilo.com

Nathan Fowler

Re: Dual WAN / Multi-bonding
« Reply #14 on: November 11, 2002, 10:43:26 PM »
http://www.hlinstruments.com/brian/stayalive/

Found this while digging through the Wish List.  Looks like the base script already exists.