LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-28-2015, 02:15 AM   #1
akmsayeed
LQ Newbie
 
Registered: Jun 2015
Posts: 2

Rep: Reputation: Disabled
Internet Link Redundancy with Linux Server


I have a Linux Server (CentOS) running in my DC, I also have two dedicated internet link. I want to configure failover link for this server as If the link1 goes down the server will be connected with link2 and vice versa.

Please help giving advice and suggestions.
 
Old 06-29-2015, 05:53 PM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Search in Google for "linux network failover bonding".
 
Old 06-29-2015, 07:27 PM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Pearlseattle View Post
Search in Google for "linux network failover bonding".
Or, if it's Centos 7, search for "teaming".
 
Old 07-09-2015, 02:16 AM   #4
Vernicronz
Member
 
Registered: Jul 2014
Distribution: Redhat,Centos,Ubuntu
Posts: 55

Rep: Reputation: Disabled
Hi akmsayeed ,

The following steps are for Centos/Redhat . It's pretty straight forward. In this case I have given my own example for

Step 1
====
Prepare the interface files at /etc/sysconfig/network-scripts/

[root@m132 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
IPADDR=10.0.0.132
GATEWAY=10.0.0.24
NETMASK=255.255.255.0
USERCTL=no
ONBOOT=yes
BOOTPRO=none
BONDING_OPTS="mode=4 miimon=1000"

[root@m132 network-scripts]# cat ifcfg-eth0
DEVICE=eth0
HWADDR=xx.xx.xx.xx.xx.xx
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

[root@m132 network-scripts]# cat ifcfg-eth1
DEVICE=eth1
HWADDR=xx.xx.xx.xx.xx.xx
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none



Step 2
====
add these lines to /etc/modprobe.conf

[root@m132 network-scripts]# cat /etc/modprobe.conf
alias bond0 bonding

Step 3
====
Restart the network service : only on console

#service network restart

then verify your bonding status with

#cat /proc/net/bonding/bond0
#cat /sys/class/net/bond0/bonding/mode
#ifconfig -a ((you should be able to see 3 interface bond0 , eth0 and eth1
#tail -f /var/log/messages OR dmesg

verify by plugging off each interface manually to see if bonding works




Below are the bonding modes
==================

mode=1 (active-backup)
Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.

mode=2 (balance-xor)
XOR policy: Transmit based on [(source MAC address XOR'd with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.

mode=3 (broadcast)
Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.

mode=4 (802.3ad)
IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.
Prerequisites:
Ethtool support in the base drivers for retrieving the speed and duplex of each slave.
A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.

mode=5 (balance-tlb)
Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave. Prerequisite: Ethtool support in the base drivers for retrieving the speed of each slave.

mode=6 (balance-alb)
Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.
Also you can use multiple bond interface but for that you must load the bonding module as many as you need.


For your case you have to choose the mode you need .... my example was mode 4
 
1 members found this post helpful.
  


Reply



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
Redundancy technique for WAN link San123 Linux - Networking 0 12-12-2011 03:22 AM
Dual internet connection, two offices, semi redundancy KhipuX Linux - Networking 3 10-10-2008 09:29 PM
Internet switch redundancy for high availability cluster charrois Linux - Networking 6 06-17-2008 03:06 PM
Simple H/A (redundancy) solution for a Linux internet gateway aliamiri Linux - Networking 1 03-17-2008 10:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:28 PM.

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