NIC or Network Bonding in Centos 5.6

Hello Friends,

I am going to share post of NIC Bonding, By Using NIC bonding We can ‘bond’ two (or more) physical ethernet interfaces together to look and act as a single interface under Linux.

In My Case :- I have two Lan Card eth0 and eth1

20061002131919

First We need to create virtual lan file as bond0 using ip 192.168.11.20 :-

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

DEVICE=bond0
IPADDR=192.168.11.20
NETWORK=192.168.11.0
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes

:wq!

Save and Quit

Configure eth0 :-

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

#Device name=eth0
DEVICE=eth0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

USERCTL=no

:wq!

Save and Quit

Configure eth1 :-

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

#Device name=eth0

DEVICE=eth1

BOOTPROTO=none
USERCTL=no

ONBOOT=yes
MASTER=bond0
SLAVE=yes
wq!

Save and Quit

Configure Gateway:-

#vim /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=linux.sahil.com

GATEWAY=192.168.11.1 ##My Gateway for all interface

wq!

Save and Quit

Make some changes kernel modules configuration file:-

#vi /etc/modprobe.conf

alias bond0 bonding

options bond0 mode=balance-alb miimon=100

wq!

Save and Quit

Now Load bond module

# modprobe bonding

Now check loaded Module

#lsmod | grep bonding

Now Restart the network service:-

#/etc/init.d/network restart or service network restart

Now Check everything is working fine :-

# cat /proc/net/bonding/bond0

Bonding Mode: load balancing (round-robin)

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 200

Down Delay (ms): 200

Slave Interface: eth0

MII Status: up

Link Failure Count: 0

Permanent HW addr: 00:09:0f:2e:c4:ce

Slave Interface: eth1

MII Status: up

Link Failure Count: 0

Permanent HW addr: 00:a0:d1:61:41:9d

Thats it … Now If One Network Card or Ethernet is down then No harm in Network We can work from other 🙂

🙂 Enjoy Linux-Ing 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top