CentOS – Nic Bonding

I have a Dell R200 and it comes with 2 network ports, so I thought I’d play with a little NIC bonding, why not, it might improve networking a little bit. Here’s how I did it.

First I created a file called bonding.conf in /etc/modprobe.d with the following in it

alias bond0 bonding
options bond0 miimon=80 mode=5

I set it to mode 5 which is this

5 — Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave.

I then created a file in /etc/sysconfig/network-scripts called ifcfg-bond0 with this in it


DEVICE=bond0
IPADDR=x.x.x.x
NETMASK=x.x.x.x
NETWORK=x.x.x.x
BROADCAST=x.x.x.x
GATEWAY=x.x.x.x
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

Obviously replace the x’s with your networks IP’s

In the same folder ifcfg-eth0 was replaced with this


DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes

and ifcfg-eth1 was replaced with this


DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes

You can then restart networking or reboot the server and check that all is working with this

cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

Bonding Mode: transmit load balancing
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 80
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr:
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr:
Slave queue ID: 0

Result 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s