If we have two network interfaces, eth0 and eth1 and we want it to be shown in a single bond as bond0, we need to first create a config file with the name bond0. The network configuration in Linux stores files in etc/sysconfig/network-scripts/ directory.
The work parameters must be set as follows:
#vi /etc/sysconfig/network-scripts/bond0
DEVICE=bond0
IPADDR=192.168.1.20
NETWORK=192.168.1.0
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
The IP address must be replaced with your actual setup.
Open eth0 and eth1 configuration files
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
Modify the parameters as follows:
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
Save and close the file.
Now load the bond driver/module when the channel bonding interface is brought up. The kernel configuration files are also modified using # vi /etc/modprobe.conf
Add these lines :
alias bond0 bonding
options bond0 mode=balance-alb miimon=100
Test configuration using these two steps:
Firstly, load the bonding module:
# modprobe bonding
Restart the network to see bond0 interface:
# service network restart
Both Nic's should now be working as one
No comments:
Post a Comment