Linux Bonds Management

ensla# modprobe -v bonding mode=0 arp_interval=100 arp_ip_target=192.168.1.254, 192.168.1.12
# tail -f /var/log/messages
# ifconfig bond0

#### To Add a Bond without restarting the Network #####
ifenslave bond0 eth2
echo "+bond0" >  /sys/class/net/bonding_masters
echo "+eth0" > /sys/class/net/bond0/bonding/slaves
echo "+eth1" > /sys/class/net/bond0/bonding/slaves

#### To remve a Bond #######
# ifenslave -d bond0 eth1
Or
# echo -eth1 > /sys/class/net/bond0/bonding/slaves

# ifconfig bond0 down
# echo "-eth0" > /sys/class/net/bond0/bonding/slaves
# echo "-eth1" > /sys/class/net/bond0/bonding/slaves
# echo "-bond0" > /sys/class/net/bonding_masters
# echo -bond0 > /sys/class/net/bonding_masters
# rmmod bonding


Configuring ifcfg-bond0 and ifcfg-bond1 interface on RHEL5

/etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

ONBOOT=yes

IPADDR=192.168.0.1

NETMASK=255.255.255.0

TYPE=Ethernet

BONDING_OPTS="mode=1 miimon=100 downdelay=100 updelay=100 "

/etc/sysconfig/network-scripts/ifcfg-bond1

DEVICE=bond1

ONBOOT=yes

IPADDR=192.168.0.2

NETMASK=255.255.255.0

TYPE=Ethernet

BONDING_OPTS="mode=1 miimon=100 downdelay=100 updelay=100 "

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
===================================================================
To configure bond0 for balance-alb mode:
# ifconfig bond0 down
# echo 6 > /sys/class/net/bond0/bonding/mode
 - or -
# echo balance-alb > /sys/class/net/bond0/bonding/mode
 NOTE: The bond interface must be down before the mode can be
changed.
 
To enable MII monitoring on bond0 with a 1 second interval:
# echo 1000 > /sys/class/net/bond0/bonding/miimon
 NOTE: If ARP monitoring is enabled, it will disabled when MII
monitoring is enabled, and vice-versa.
 
To add ARP targets:
# echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
# echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
 NOTE:  up to 16 target addresses may be specified.
 
To remove an ARP target:
# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
 
To configure the interval between learning packet transmits:
# echo 12 > /sys/class/net/bond0/bonding/lp_interval
 NOTE: the lp_inteval is the number of seconds between instances where
the bonding driver sends learning packets to each slaves peer switch.  The
default interval is 1 second.

ONBOOT=yes

MASTER=bond0

SLAVE=yes

TYPE=Ethernet

/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1

ONBOOT=yes

MASTER=bond1

SLAVE=yes

TYPE=Ethernet

/etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2

ONBOOT=yes

MASTER=bond0

SLAVE=yes

TYPE=Ethernet

/etc/sysconfig/network-scripts/ifcfg-eth3

DEVICE=eth3

ONBOOT=yes

MASTER=bond1

SLAVE=yes

TYPE=Ethernet

Add the following lines to /etc/modprobe.conf

alias bond0 bonding

alias bond1 bonding

Then run the following command to activate the bond0 interface.

# modprobe bonding

But while adding a new Bond1 interface after bond0 we need to run the following command.

# echo +bond1 > /sys/class/net/bonding_masters

If we want to remove the bond interface we need to run the following command

# echo -bond1 > /sys/class/net/bonding_masters

Restart the network service and check if everything is operating smoothly.

Comments

Popular posts from this blog

Push command for NetWorker Client Upgrade

Factors Affecting Users’ Sense of Security and Trust in Integrating Electronic health record to the cloud

Basic Elastic Cloud Storage Troubleshooting Commands