LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-05-2012, 11:25 PM   #1
San123
LQ Newbie
 
Registered: Nov 2011
Posts: 21

Rep: Reputation: Disabled
Ethernet bonding in ubuntu


Hi..

I want to try NIC bonding in ubuntu server provided with three different internet connections and also has 4 port NIC card. But I was bit confused how to configure IP address for the bonding driver as each service provider is assigned with static IP.
Which IP address should I use for bonding driver?

Will slave networks use bonding driver's IP for routing internet traffic or their respective static IP's assigned by ISP?

Can we set any IP for bonding driver or is it mandatory to use any one of the static IP's of slave networks?

I would be grateful if someone share their knowledge.

Thanking you...
 
Old 03-06-2012, 01:21 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

NIC bonding or link aggregation is mainly used to combine multiple network ports into a group and in doing so combine the bandwidth. In your setup, having three different internet providers, I don't understand quite what you're asking. If you have four NICs and want to setup a bonding using for example two of them, you could assign the IP of one of the providers to the bonding interface and assign two of the four NICs as slaves to that bonding interface. The other two NICs would remain with the IP from the other two providers assigned. If you want to have a bonding for all three connections you'll have to add extra NICs. AFAIK you cannot set an IP to a NIC that functions as slave for a bonding, the IP gets configured on the bonding interface.

How many NICs do you have in total on that machine?

Kind regards,

Eric
 
Old 03-06-2012, 02:24 AM   #3
San123
LQ Newbie
 
Registered: Nov 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
Hi Eric...

I have four port NIC card on the server in which three ports for connecting 3 ISP's and fourth port for connecting LAN.

I want to attach all the providers to the bonding interface. LAN traffic can be distributed over three network slaves connected to the bonding interface in balance-rr mode.

If we configure the IP address for bonding interface using any of the service providers, do all the slave networks use the bonding interface IP to route the traffic? I was stuck with this doubt.

Thanking you....
 
Old 03-06-2012, 02:50 AM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by San123 View Post
I have four port NIC card on the server in which three ports for connecting 3 ISP's and fourth port for connecting LAN.
This is not bonding. Bonding NIC ports involves all of them going in parallel from one machine to another machine (host, router, switch). They become a group that is usually identified as a single special interface. It's like a RAID array is for storage.

Quote:
Originally Posted by San123 View Post
I want to attach all the providers to the bonding interface. LAN traffic can be distributed over three network slaves connected to the bonding interface in balance-rr mode.
Bonding would be all 3 cables going to one other machine that also has 3 ports and is configured to bond them together.

Quote:
Originally Posted by San123 View Post
If we configure the IP address for bonding interface using any of the service providers, do all the slave networks use the bonding interface IP to route the traffic? I was stuck with this doubt.
You are getting 3 different IP addresses, 1 from each ISP. That or you are getting separate subnets. You CAN connect these all to the same machine via 3 NIC ports. But that is NOT bonding. It is just 3 separate networks connected (the connected network being the LAN or point-to-point that reaches each ISP ... regardless of the fact that you can get to the internet by each).

Once you have them connected, you must make a decision which one to target routing to. You could route the whole internet to one ISP. Or you can be selective and route part of the internet in different directions although that is likely to conflict with incoming traffic that addressed a particular IP address you got from one of the ISPs.

Real network redundancy involves a major routing effort (google for "BGP routing" or "BGP4 routing"). It would mean you need to get portable IP addresses (good luck if you can't justify a need for a large amount) and make your own routing announcements to the internet, which would then see 3 possible routes for your IP addresses. And not all ISPs even support customers doing this (the big ones do).

In short, if you have to ask how to begin with this, it is out of your league. Sorry, but that is the honest truth. If your business justifies the things that are needed, you could afford to hire a couple network engineers with CCIE certification.

Otherwise just run your internet servers on 3 separate NIC with separate IPs, and set up a firewall that can switch ISP, or 3 separate small firewalls you can turn on and off to select which ISP to use. Some redundancy is possible, but it's still getting into a very complex area you are not prepared for, and no easy-bake recipe exists for.
 
Old 03-06-2012, 09:01 AM   #5
San123
LQ Newbie
 
Registered: Nov 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
Someone please clear this doubt...

Bonding will sum up the bandwidths offered by each individual link and will have the same MAC address for all the slave networks.
If we configure IP for bonding interface using any one IP of the available ISP's (say 3), do all slave networks will use bonding device's IP or link IP given by service provider to route internet traffic?
 
Old 03-06-2012, 12:42 PM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by San123 View Post
Someone please clear this doubt...

Bonding will sum up the bandwidths offered by each individual link and will have the same MAC address for all the slave networks.
If we configure IP for bonding interface using any one IP of the available ISP's (say 3), do all slave networks will use bonding device's IP or link IP given by service provider to route internet traffic?
There is no gain for internet access with bonding, with one exception. If an ISP offers ethernet connected service (often called "ethernet handoff"), they MAY be able to provide even greater bandwidth by offering bonded ethernet. So if they offer you 1 gigabit service, and you want to upgrade to 3 gigabit service, maybe they can put in a router or switch that has 3 ports bonded.

If you have only 100 megabit links, it's probably more cost effective, and certainly easier to handle, to just upgrade to 1 gigabit links. It may in some cases be easier to upgrade to 10 gigabit links. Commodity off-the-shelf equipment at 1 gigabit is readily available and barely more expensive than 100 megabit (10 megabit is almost impossible to find). 10 gigabit is still quite expensive, including requiring expensive cables with expensive connectors, and is best done with fiber. So bonding only makes economic sense in most cases when going from 1 gigabit to 4 gigabit or so (though it can make sense at higher levels for facilities involving very large storage-area-networks ... SANs).

There are no protocols established for bonding across multiple ISPs. Bonding is at the link layer.

For better capacity and redundancy through multiple ISPs, as described before you need portable IP addresses (an IP address allocation directly from your address registry) which can be routed through ISPs, if such ISPs are equipped to handle the BGP route announcements from their customers (that's an extra step beyond them having portable IPs and BGP for their own network). But if you are really working at this scale, you probably want to connect directly to "core network providers", anyway.
 
1 members found this post helpful.
Old 03-07-2012, 02:44 AM   #7
San123
LQ Newbie
 
Registered: Nov 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thanks Skaperen for sharing your valuable knowledge...

All the three links are offered at 1Gbps bandwidth (different service providers). As of now resources are under-utilized as we are using one ISP and if link-outage occurs we are going for manual switch-over to other link.
Now I want to automate switch-over (fault tolerance) and also increase band-width by using bonding.
Each ISP is provided with default gateway(router).

Server specifications:- OS: Ubuntu Server Ed.,(11.04) , 4 port NIC card (3 ports for connecting 3 ISP's and other for connecting LAN).
I have gone through ubuntu bonding documentation but got confused with IP assignment for bonding interface.


auto bond0
iface bond0 inet static
address *.*.*.*
netmask 255.255.255.0
gateway *.*.*.*

Bonding will show the kernel as if it is a single physical device by having same MAC address(Layer-2).
IP address and gateway for bonding interface can be assigned with any one of the 3 service providers IP and gateway.
Internal LAN traffic can be distributed over 3 slave networks attached to the bonding interface by keeping the bond mode in balance-rr mode or mode 0.

All the traffic will have same MAC address because of bonding.

Network traffic will have which IP and gateway? (As bonding driver is configured with only one of the three available IP's and gateways).

I would be grateful for your help and suggestions.

Thanking you...
 
Old 03-07-2012, 12:17 PM   #8
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Bonding just can't function this way because there is more to it that needs to be done on the other end ... ONE other end. Since the 3 ISPs are providing 3 separate handoffs, the ISP ends won't know what to bond since from each of their perspective, this is only one ethernet to deal with.

Even if you did have 2 or 3 ethernets from the same ISP (for extra bandwidth, not for fallback on failure), they would have to configure the bonding on their end, too.

Bonding is something that has to be configured on BOTH ends of the multiple cable link, and all the cables have to go to a single machine on each end.

If all you want is automatic fallback, you can get that PARTIALLY by setting up a routing table with 3 different metric levels for each of the ISPs. But that will only catch failures that are apparent to the NIC (as in the ethernet fails). If the ISP fails to get to the internet, your computer with 4 NICs won't see that, so that type of failure won't be corrected. A smarter program is needed that constantly checks the 1st ISP for reachability to the internet, and upon persistent failure, changes the routing to go through another ISP.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Server - bonding ethernet and wireless fantasygoat Linux - Server 2 11-24-2010 11:06 AM
ethernet bonding aclhkaclhk Linux - Networking 2 02-22-2010 02:04 AM
Ethernet bonding jeetender Linux - Newbie 2 08-18-2008 11:09 PM
Infiniband Bonding and Ethernet Bonding edcrozer Linux - Networking 0 11-07-2007 03:57 PM
Ethernet bonding trycoon Linux - Networking 7 07-23-2002 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration