LINUX-15 BONDING/NIC
TEAMING IN RHEL-6
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# cp ifcfg-Auto_eth1
org.ifcfg-Auto_eth1
[root@localhost network-scripts]# cp ifcfg-Auto_eth2
org.ifcfg-Auto_eth2
[root@localhost network-scripts]# cp ifcfg-Auto_eth3
org.ifcfg-Auto_eth3
[root@localhost network-scripts]# cp ifcfg-eth0
org.ifcfg-eth0
[root@localhost network-scripts]# mkdir eth-bkp
[root@localhost network-scripts]# mv org.ifcfg-Auto_eth1
org.ifcfg-Auto_eth2 org.ifcfg-Auto_eth3 org.ifcfg-eth0 eth-bkp
[root@localhost network-scripts]# vi ifcfg-bond0
#This is congiguration file for bond0.Using NIC eth1 & eth2
DEVICE=bond0
IPADDR=192.168.234.200
NETMASK=255.255.255.0
USRCTL=no
ONBOOT=yes
BOOTPRO=none
BONDING_OPTS="mode=0 miimon=100"
[root@localhost network-scripts]# vi ifcfg-eth1
DEVICE=eth1
HWADDR=00:0C:29:32:41:7C
BOOTPRO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
TYPE=Ethernet
[root@localhost network-scripts]# vi ifcfg-eth2
DEVICE=eth2
HWADDR=00:0C:29:32:41:72
BOOTPRO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
TYPE=Ethernet
[root@localhost network-scripts]# vi ifcfg-bond1
DEVICE=bond1
IPADDR=192.168.234.201
NETMASK=255.255.255.0
USRCTL=no
ONBOOT=yes
BOOTPRO=none
BONDING_OPTS="mode=0 miimon=100"
[root@localhost network-scripts]# vi ifcfg-eth3
DEVICE=eth3
BOOTPRO=none
ONBOOT=yes
MASTER=bond1
SLAVE=yes
USERCTL=no
TYPE=Ethernet
[root@localhost network-scripts]# vi ifcfg-eth4
DEVICE=eth4
BOOTPRO=none
ONBOOT=yes
MASTER=bond1
SLAVE=yes
USERCTL=no
TYPE=Ethernet
[root@localhost network-scripts]# service network restart
Shutting down
interface eth0: Device state: 3
(disconnected)
[ OK ]
Shutting down
interface eth1: Device state: 3
(disconnected)
[ OK ]
Shutting down
interface eth2: Device state: 3
(disconnected)
[ OK ]
Shutting down
interface eth3: Device state: 3
(disconnected)
[ OK ]
Shutting down
interface eth4: Device state: 3
(disconnected)
[ OK ]
Shutting down
loopback interface:
[ OK ]
Bringing up loopback
interface:
[ OK ]
Bringing up
interface bond0: Active connection
state: activated
Active connection
path: /org/freedesktop/NetworkManager/ActiveConnection/15
[ OK ]
Bringing up
interface bond1: Active connection
state: activated
Active connection
path: /org/freedesktop/NetworkManager/ActiveConnection/16
[ OK ]
Bringing up
interface eth0: Active connection state:
activating
Active connection
path: /org/freedesktop/NetworkManager/ActiveConnection/17
state: activated
Connection activated
[ OK ]
[root@localhost /]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:29:32:41:5E
inet addr:192.168.234.144 Bcast:192.168.234.255 Mask:255.255.255.0
inet6 addr:
fe80::20c:29ff:fe32:415e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
RX packets:1280 errors:0 dropped:0
overruns:0 frame:0
TX packets:610 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:114577 (111.8 KiB) TX bytes:95518 (93.2 KiB)
eth1 Link encap:Ethernet HWaddr 00:0C:29:32:41:7C
inet6 addr:
fe80::20c:29ff:fe32:417c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
RX packets:365 errors:0 dropped:0
overruns:0 frame:0
TX packets:23 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:36729 (35.8 KiB) TX bytes:2522 (2.4 KiB)
eth2 Link encap:Ethernet HWaddr 00:0C:29:32:41:72
inet6 addr:
fe80::20c:29ff:fe32:4172/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
RX packets:444 errors:0 dropped:0
overruns:0 frame:0
TX packets:75 errors:0 dropped:0 overruns:0
carrier:0
collisions:0 txqueuelen:1000
RX bytes:42616 (41.6 KiB) TX bytes:18396 (17.9 KiB)
eth3 Link encap:Ethernet HWaddr 00:0C:29:32:41:68
inet6 addr:
fe80::20c:29ff:fe32:4168/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
RX packets:373 errors:0 dropped:0
overruns:0 frame:0
TX packets:34 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:36751 (35.8 KiB) TX bytes:6760 (6.6 KiB)
eth4 Link encap:Ethernet HWaddr 00:0C:29:32:41:86
inet6 addr:
fe80::20c:29ff:fe32:4186/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
RX packets:439 errors:0 dropped:0
overruns:0 frame:0
TX packets:229 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:36388 (35.5 KiB) TX bytes:46186 (45.1 KiB)
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:12 errors:0 dropped:0
overruns:0 frame:0
TX packets:12 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:720 (720.0 b) TX bytes:720 (720.0 b)
pan0 Link encap:Ethernet HWaddr FE:2E:75:BD:71:5C
BROADCAST 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@localhost /]# netstat -nr
Kernel IP routing
table
Destination Gateway Genmask Flags
MSS Window irtt Iface
192.168.234.0 0.0.0.0 255.255.255.0 U
0 0 0 eth0
0.0.0.0 192.168.234.2 0.0.0.0 UG 0 0 0 eth0
[root@localhost ~]# vi /etc/modprobe.d/bonding.conf
alias bond0 bonding
alias bond1 bonding
[root@localhost ~]#modprobe bonding
[root@localhost ~]# service network restart
Shutting down
interface eth0: Device state: 3
(disconnected)
[ OK ]
Shutting down
interface eth1: Error: Device 'eth1'
(/org/freedesktop/NetworkManager/Devices/2) disconnecting failed: This device
is not active
[FAILED]
Shutting down
interface eth2: Error: Device 'eth2'
(/org/freedesktop/NetworkManager/Devices/3) disconnecting failed: This device
is not active
[FAILED]
Shutting down
interface eth3: Error: Device 'eth3'
(/org/freedesktop/NetworkManager/Devices/4) disconnecting failed: This device
is not active
[FAILED]
Shutting down
interface eth4: Error: Device 'eth4'
(/org/freedesktop/NetworkManager/Devices/1) disconnecting failed: This device
is not active
[FAILED]
Shutting down
loopback interface:
[ OK ]
Bringing up loopback
interface:
[ OK ]
Bringing up
interface bond0: Active connection
state: activated
Active connection
path: /org/freedesktop/NetworkManager/ActiveConnection/12
[ OK ]
Bringing up
interface bond1: Active connection
state: activated
Active connection
path: /org/freedesktop/NetworkManager/ActiveConnection/13
[ OK ]
Bringing up
interface eth0: Active connection state:
activating
Active connection
path: /org/freedesktop/NetworkManager/ActiveConnection/14
state: activated
Connection activated [
OK ]
[root@localhost ~]# service NetworkManager stop
Stopping NetworkManager daemon: [ OK ]
[root@localhost ~]# chkconfig NetworkManager off
[root@localhost ~]# chkconfig network on
[root@localhost ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface bond0: [ OK ]
Bringing up interface bond1: [ OK ]
Bringing up interface eth0: [ OK ]
[root@localhost ~]#
[root@localhost ~]# ifconfig -a
bond0 Link
encap:Ethernet HWaddr 00:0C:29:32:41:7C
inet addr:192.168.234.200 Bcast:192.168.234.255 Mask:255.255.255.0
inet6 addr:
fe80::20c:29ff:fe32:417c/64 Scope:Link
UP BROADCAST RUNNING MASTER
MULTICAST MTU:1500 Metric:1
RX packets:167 errors:0 dropped:0
overruns:0 frame:0
TX packets:40 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12556 (12.2 KiB) TX bytes:4156 (4.0 KiB)
bond1 Link encap:Ethernet HWaddr 00:0C:29:32:41:68
inet addr:192.168.234.201 Bcast:192.168.234.255 Mask:255.255.255.0
inet6 addr:
fe80::20c:29ff:fe32:4168/64 Scope:Link
UP BROADCAST RUNNING MASTER
MULTICAST MTU:1500 Metric:1
RX packets:136 errors:0 dropped:0
overruns:0 frame:0
TX packets:31 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:10307 (10.0 KiB) TX bytes:2788 (2.7 KiB)
eth0 Link encap:Ethernet HWaddr 00:0C:29:32:41:5E
inet addr:192.168.234.144 Bcast:192.168.234.255 Mask:255.255.255.0
inet6 addr:
fe80::20c:29ff:fe32:415e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
RX packets:1105 errors:0 dropped:0
overruns:0 frame:0
TX packets:678 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:96362 (94.1 KiB) TX bytes:103687 (101.2 KiB)
eth1 Link encap:Ethernet HWaddr 00:0C:29:32:41:7C
UP BROADCAST RUNNING SLAVE
MULTICAST MTU:1500 Metric:1
RX packets:101 errors:0 dropped:0
overruns:0 frame:0
TX packets:21 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7641 (7.4 KiB) TX bytes:2646 (2.5 KiB)
eth2 Link encap:Ethernet HWaddr 00:0C:29:32:41:7C
UP BROADCAST RUNNING SLAVE
MULTICAST MTU:1500 Metric:1
RX packets:67 errors:0 dropped:0
overruns:0 frame:0
TX packets:20 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4975 (4.8 KiB) TX bytes:1744 (1.7 KiB)
eth3 Link encap:Ethernet HWaddr 00:0C:29:32:41:68
UP BROADCAST RUNNING SLAVE
MULTICAST MTU:1500 Metric:1
RX packets:71 errors:0 dropped:0
overruns:0 frame:0
TX packets:18 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5424 (5.2 KiB) TX bytes:1380 (1.3 KiB)
eth4 Link encap:Ethernet HWaddr 00:0C:29:32:41:68
UP BROADCAST RUNNING SLAVE
MULTICAST MTU:1500 Metric:1
RX packets:65 errors:0 dropped:0
overruns:0 frame:0
TX packets:13 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4883 (4.7 KiB) TX bytes:1408 (1.3 KiB)
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:14 errors:0 dropped:0
overruns:0 frame:0
TX packets:14 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:944 (944.0 b) TX bytes:944 (944.0 b)
pan0 Link encap:Ethernet HWaddr 96:2C:FF:FC:1D:BA
BROADCAST 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@localhost ~]# netstat -nr
Kernel IP routing
table
Destination Gateway Genmask Flags
MSS Window irtt Iface
192.168.234.0 0.0.0.0 255.255.255.0 U
0 0 0 bond0
192.168.234.0 0.0.0.0 255.255.255.0 U
0 0 0 bond1
192.168.234.0 0.0.0.0 255.255.255.0 U
0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U
0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U
0 0 0 bond0
169.254.0.0 0.0.0.0 255.255.0.0 U
0 0 0 bond1
0.0.0.0 192.168.234.2 0.0.0.0 UG 0 0 0 bond0
[root@localhost ~]#
Verify the bonding…..
[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:32:41:7c
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:32:41:72
Slave queue ID: 0
[root@localhost ~]# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:32:41:68
Slave queue ID: 0
Slave Interface: eth4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:32:41:86
Slave queue ID: 0
[root@localhost ~]#
Current bonding mode…………..
[root@localhost ~]# cat /sys/class/net/bond0/bonding/mode
balance-rr 0
Configured bonding’s on system,
[root@localhost ~]# cat /sys/class/net/bonding_masters
bond0 bond1
Different Modes…………
balance-rr 0 Round-Robin
policy for fault tolerance
active-backup 1 Active-Backup policy for fault tolerance
balance-xor 2 Exclusive-OR policy for fault tolerance
broadcast 3 All
transmissions are sent on all slave interfaces.
802.3ad 4 Dynamic
link aggregation policy
balance-tlb 5 Transmit Load Balancing policy for fault
tolerance
balance-alb 6 Active Load Balancing policy for fault
tolerance
What is miimon in NICTeaming?
Specifies (in milliseconds) how often MII link monitoring occurs.
This is useful if high availability is
required because MII is used to verify that the NIC is active.
To verify that the driver for a particular NIC supports the MII tool,
type the following command as root:
[root@localhost ~]# ethtool bond0 | grep "Link
detected:"
Link detected: yes
[root@localhost ~]# ethtool bond1 | grep "Link
detected:"
Link detected: yes
[root@localhost ~]# ethtool eth0 | grep "Link
detected:"
Link detected: yes
No comments:
Post a Comment