Centos&Redhat6 and NIC Bonding

Today i learned that on Centos6 and of course on Redhat6 also i can say Oracle Linux6 modprobe config is changed

Part 1 

Lets quick configure the bonding

its same like before you have to create a ifcfg-bond0 and  configure nics which will join the bonding

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

DEVICE=bond0
IPADDR=your.ip.add.ress
NETWORK=your.net.work.0
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes

Then configure nics which will join the bonding

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

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

same for other nics which will be slave of  bond0

Now, we arrived modprobe config. Old versions of Centos/Redhat bonding configurations should be set with /etc/modprobe.conf but with Centos6 its little different. You have to get in /etc/modprobe.d folder and create a file  like below

vi /etc/modprobe.d/bonding.conf

alias bond0 bonding
options bond0 mode=balance-alb miimon=100

Be sure that cables are connected to nics

You can find on some articles like modprobe bonding and restart the service network, these are not worked for me , pls try to restart server

Related commands will help you for see everything

cat /proc/net/bonding/bond0
ifconfig

For balancing mode pls check this article http://www.cyberciti.biz/howto/question/static/linux-ethernet-bonding-driver-howto.php

Part 2

This is update after over this article

Pls be sure that NetworkManager service is closed

chkconfig NetworkManager off

Second , its very important that move options line from /etc/modprobe.d/bonding.conf to /etc/sysconfig/network-scripts/ifcfg-bond0 like below

[root@kahin02-11g ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
IPADDR=10.79.79.2
NETWORK=10.79.79.0
NETMASK=255.255.255.0
USERCTL=no
ONBOOT=yes
BONDING_OPTS=”mode=6 miimon=100″

Also if you disable NetworkManager you have to care about DNS like below

DEVICE=bond0
IPADDR=xxx.yyy.zzz.ttt
NETWORK=xxx.yyy.zzz.ttt
NETMASK=255.255.255.0
USERCTL=no
ONBOOT=yes
DNS2=8.8.8.8
DNS1=8.8.4.4
BONDING_OPTS=”mode=6 miimon=100″

And one more , i couldn’t fix the default gw issue to solve this added such line in rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don’t
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
route add default dev bond0 gw you.gateway.ip.address

Also i would like to add such out, if you see this think that you have a mistake, you should not see xxx.yyy.ttt.fff everywhere , just only under of bonding interfaces.

bond0 Link encap:Ethernet HWaddr E4:1F:13:68:6E:20
inet addr:xxx.yyy.ttt.fff Bcast:81.21.160.255 Mask:255.255.255.0
inet6 addr: fe80::e61f:13ff:fe68:6e20/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:359 errors:0 dropped:0 overruns:0 frame:0
TX packets:520 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:55635 (54.3 KiB) TX bytes:37727 (36.8 KiB)

bond1 Link encap:Ethernet HWaddr 00:15:17:CF:7F:A0
inet addr:10.79.79.2 Bcast:10.79.79.255 Mask:255.255.255.0
inet6 addr: fe80::215:17ff:fecf:7fa0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:256 errors:0 dropped:1 overruns:0 frame:0
TX packets:410 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20137 (19.6 KiB) TX bytes:26388 (25.7 KiB)

eth0 Link encap:Ethernet HWaddr E4:1F:13:68:6E:20
inet addr:xxx.yyy.ttt.fff Bcast:81.21.160.255 Mask:255.255.255.0
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:359 errors:0 dropped:0 overruns:0 frame:0
TX packets:520 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:55635 (54.3 KiB) TX bytes:37727 (36.8 KiB)

eth1 Link encap:Ethernet HWaddr E4:1F:13:68:6E:22
UP BROADCAST SLAVE MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

eth2 Link encap:Ethernet HWaddr 00:15:17:CF:7F:A1
UP BROADCAST SLAVE MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:26 Memory:97c60000-97c80000

eth3 Link encap:Ethernet HWaddr 00:15:17:CF:7F:A0
inet addr:xxx.yyy.ttt.fff Bcast:81.21.160.255 Mask:255.255.255.0
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:256 errors:0 dropped:0 overruns:0 frame:0
TX packets:410 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20137 (19.6 KiB) TX bytes:26388 (25.7 KiB)
Interrupt:25 Memory:97c20000-97c40000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2028 (1.9 KiB) TX bytes:2028 (1.9 KiB)

usb0 Link encap:Ethernet HWaddr E6:1F:13:5A:6E:23
inet addr:xxx.yyy.ttt.fff Bcast:81.21.160.255 Mask:255.255.255.0
inet6 addr: fe80::e41f:13ff:fe5a:6e23/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3640 (3.5 KiB) TX bytes:468 (468.0 b)

VM

Posted on 09/02/2013, in Linux and tagged , , , , , , , . Bookmark the permalink. Leave a comment.

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

%d bloggers like this: