TipsAndTricks/BondingInterfaces - CentOS Wiki
cat /etc/redhat-release
CentOS release 6.4 (Final)
vi /etc/ips
vi /etc/resolv.conf
vi /etc/modprobe.d/bonding.conf
vi /etc/sysconfig/network-scripts/ifcfg-lo
vi /etc/sysconfig/network-scripts/ifcfg-bond0
vi /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth1
cat /proc/net/bonding/bond0
service network restart
service ipaliases restart
Following is done in WHM
Home » Server Configuration » Basic cPanel & WHM Setup
It should be currently only one there.
Save Changes
Home » Account Functions » Change Site’s IP Address
Put main shared IP to all dedicated IPs temporarily to be able to remove them from interfaces.
Home » IP Functions » Rebuild the IP Address Pool
Click Proceed to mark previously taken dedicated IP addresses as Free IPs
Home » IP Functions » Show or Delete Current IP Addresses
You have list of IP addresses as
Delete eth0:cp1, eth0:cp2.. etc because they are attached to wrong interface.
Home » IP Functions » Add a New IP Address
Your IP addresses here
Your subnet mask here, use subnet-calculator.com if not sure.
Go check back at
Home » IP Functions » Show or Delete Current IP Addresses
You shuld now have list of IP addresses as
Home » IP Functions » Change a Site’s IP Address
Change back sites dedicated IP addresses and your done.
Just for checking reasons or reboot is rec
service network restart
service ipaliases restart
Additional info on mode,
cat /etc/redhat-release
CentOS release 6.4 (Final)
vi /etc/ips
Code:
194.204.54.42:255.255.255.248:194.204.54.47
194.204.54.43:255.255.255.248:194.204.54.47
194.204.54.44:255.255.255.248:194.204.54.47
194.204.54.45:255.255.255.248:194.204.54.47
Code:
nameserver 8.8.4.4
nameserver 8.8.8.8
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 4.2.2.3
nameserver 4.2.2.4
Code:
alias bond0 bonding
options bond0 miimon=80 mode=6
Code:
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
Code:
DEVICE=bond0
IPADDR=194.204.54.41
NETMASK=255.255.255.248
NETWORK=194.204.54.40
BROADCAST=194.204.54.47
GATEWAY=194.204.54.46
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
Code:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
Code:
DEVICE=eth1
ONNBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
service network restart
service ipaliases restart
Following is done in WHM
Home » Server Configuration » Basic cPanel & WHM Setup
Pick bond0 from dropdown list.The ethernet device onto which new IP addresses are added. Devices detected with at least one IP are listed in the drop-down, or you may specify another device.
Examples: eth0:3, eth1, eth2 venet0:0 (virtuozzo servers)
It should be currently only one there.
Save Changes
Home » Account Functions » Change Site’s IP Address
Put main shared IP to all dedicated IPs temporarily to be able to remove them from interfaces.
Home » IP Functions » Rebuild the IP Address Pool
Click Proceed to mark previously taken dedicated IP addresses as Free IPs
Home » IP Functions » Show or Delete Current IP Addresses
You have list of IP addresses as
Code:
194.204.54.41 bond0
194.204.54.42 eth0:cp1
194.204.54.43 eth0:cp2
194.204.54.44 eth0:cp3
194.204.54.45 eth0:cp4
...
Home » IP Functions » Add a New IP Address
Code:
194.204.54.40/29
Code:
255.255.255.248
Go check back at
Home » IP Functions » Show or Delete Current IP Addresses
You shuld now have list of IP addresses as
Code:
194.204.54.41 bond0
194.204.54.42 bond0:cp1
194.204.54.43 bond0:cp2
194.204.54.44 bond0:cp3
194.204.54.45 bond0:cp4
...
Change back sites dedicated IP addresses and your done.
Just for checking reasons or reboot is rec
service network restart
service ipaliases restart
Additional info on mode,
Additional info on miimon,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.
Pre-requisites:
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.
Specifies the MII link monitoring frequency in milliseconds. This determines how often the link state of each slave is inspected for link failures. A value of zero disables MII link monitoring. A value of 100 is a good starting point.
miimon=100 means the link is going to be checked every 100 milliseconds