Oracle Linux 6.4 (BOND) Dual Nic binding practices-Additional instructions

Source: Internet
Author: User

Oracle Linux 6.4 (BOND) Dual Nic binding practices-Additional instructions

Operating Environment
Oracle Linux Server release 6.4
Kernel
Linux rac1 2.6.39-400.17.1.el6uek.x86 _ 64

[Root @ RAC-2 ~] # Vi/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE = bond0

BOOTPROTO = static

IPADDR = 192.168.254.2

NETMASK = 255.255.255.0

BROADCAST = 192.168.254.1

ONBOOT = yes

TYPE = Ethernet

GATEWAY = 192.168.254.1

USERCTL = no

"/Etc/sysconfig/network-scripts/ifcfg-bond0" [New] 17L, 163C written

[Root @ RAC-2 ~] # Cd/etc/sysconfig/network-scripts/

[Root @ RAC-2 network-scripts] # vi ifcfg-eth1

DEVICE = eth1

BOOTPROTO = none

ONBOOT = yes

USERCTL = no

MASTER = bond0

SLAVE = yes
~
"Ifcfg-eth1" 11L, 77C written
[Root @ RAC-2 network-scripts] # vi ifcfg-eth2
DEVICE = eth2

BOOTPROTO = none

ONBOOT = yes

USERCTL = no

MASTER = bond0

SLAVE = yes
~
"Ifcfg-eth2" 11L, 77C written
[Root @ RAC-2 network-scripts] # vi/etc/modprobe. d/modprobe. conf

Alias bond0 bonding

Options bond0 miimon = 100 mode = 1
~
~
"/Etc/modprobe. d/modprobe. conf" [New] 4L, 54C written
Note:
Miimon is used for link monitoring. For example: miimon = 100, The system monitors the link connection status every Ms. If one line fails, it is transferred to another line; the value of mode indicates the working mode. There are four modes: 0, 1, and 2, which are commonly used: 0, 1.
Mode = 0 indicates that the load balancing (round-robin) method is load balancing, and both NICs work.
Mode = 1 indicates that fault-tolerance (active-backup) provides redundancy, working in the active/standby mode. That is to say, by default, only one network card works and the other is used for backup.


[Root @ RAC-2 network-scripts] # vi/etc/rc. d/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
Ifenslave bond0 eth2 eth1
~
"/Etc/rc. d/rc. local" 8L, 246C written
[Root @ RAC-2 network-scripts] # ifconfig bond0 192.168.254.2 up

# [Root @ rac4 network-scripts] # ifenslave bond0 eth2 eth1
Illegal operation: The specified slave interface 'eth0' is already a slave


Restart the server:

[Root @ rac4 ~] # Reboot

The following BOND Nic has been started
[Root @ RAC-2 ~] # Ifconfig
Bond0 Link encap: Ethernet HWaddr 08: 00: 27: E7: 1F: 5D
Inet addr: 192.168.254.2 Bcast: 192.168.254.1 Mask: 255.255.255.0
Inet6 addr: fe80: a00: 27ff: fee7: 1f5d/64 Scope: Link
Up broadcast running master multicast mtu: 1500 Metric: 1
RX packets: 35 errors: 0 dropped: 15 overruns: 0 frame: 0
TX packets: 16 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 2498 (2.4 KiB) TX bytes: 1028 (1.0 KiB)

Eth1 Link encap: Ethernet HWaddr 08: 00: 27: E7: 1F: 5D
Inet addr: 192.168.254.2 Bcast: 192.168.254.255 Mask: 255.255.255.0
Up broadcast running slave multicast mtu: 1500 Metric: 1
RX packets: 87 errors: 0 dropped: 12 overruns: 0 frame: 0
TX packets: 4 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 6411 (6.2 KiB) TX bytes: 288 (288.0 B)

Eth2 Link encap: Ethernet HWaddr 08: 00: 27: 99: BE: CC
Inet addr: 192.168.254.2 Bcast: 192.168.254.255 Mask: 255.255.255.0
Up broadcast running slave multicast mtu: 1500 Metric: 1
RX packets: 73 errors: 0 dropped: 62 overruns: 0 frame: 0
TX packets: 12 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 4935 (4.8 KiB) TX bytes: 740 (740.0 B)

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: 4 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 4 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 240 (240.0 B) TX bytes: 240 (240.0 B)

The following figure shows the active network adapter ech1 in the starting status.
[Root @ RAC-2 ~] # Cat/proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (rjl 27,201 1)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
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: 08: 00: 27: e7: 1f: 5d
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 08: 00: 27: 99: be: cc
Slave queue ID: 0

Seven bond modes:
 
First mode: mod = 0, namely: (balance-rr) Round-robin policy (balanced Round robin policy)
 
Feature: the packet transmission sequence is Sequential transmission (that is, 1st packets go through eth0, And the next packet goes through eth1 .... This mode provides load balancing and fault tolerance capabilities, but we know that if a connection or session data packet is sent from different interfaces, when packets pass through different links in the middle, the client may encounter unordered data packets, and unordered data packets need to be sent again, so the network throughput will decrease.
 
Mode 2: mod = 1 (active-backup) Active-backup policy (master-backup policy)
 
Feature: Only one device is active. When one device goes down, the other device is immediately switched from backup to the master device. The mac address is externally visible. From the outside, bond's MAC address is unique to avoid confusion between switches. This mode only provides Fault Tolerance capabilities. It can be seen that this algorithm has the advantage of providing high network connection availability, but its resource utilization is low, and only one interface is working, when there are N network interfaces, the resource utilization rate is 1/N.

Mode 3: mod = 2, namely: (balance-xor) XOR policy (balance policy)
 
Feature: transmits data packets based on the specified transmission HASH policy. The default policy is (source MAC address XOR target MAC address) % slave number. Other transmission policies can be specified using the xmit_hash_policy option. This mode provides load balancing and fault tolerance capabilities.
 
Fourth mode: mod = 3, that is, broadcast (broadcast Policy)
 
Feature: each data packet is transmitted on each slave interface. This mode provides Fault Tolerance
 
Fifth mode: mod = 4 (802.3ad) IEEE 802.3 adDynamic link aggregation (IEEE 802.3ad dynamic link aggregation)
 
Feature: Create an aggregation group that shares the same rate and duplex settings. According to the 802.3ad specification, multiple slave instances work in the same active combination.
 
The outbound traffic slave election is based on the transmission hash policy, which can be changed from the default XOR policy to other policies through the xmit_hash_policy option. It should be noted that not all transmission policies are adapted to 802.3ad, especially considering the packet Disorder mentioned in chapter 43.2.4 of the 802.3ad standard. Different implementations may have different adaptability.
 
Prerequisites:
 
Condition 1: ethtool supports obtaining the rate and duplex settings for each slave.
 
Condition 2: The switch supports IEEE 802.3ad Dynamic link aggregation.

Condition 3: most switches must be configured to support the 802.3ad mode.
 
Mode 6: mod = 5 (balance-tlb) Adaptive transmit load balancing (adapter transfer load balancing)
 
Features: no special switch-supported channel bonding is required. Outbound traffic is allocated to each slave based on the current load (based on the speed. If the slave that is receiving data fails, the other slave takes over the MAC address of the failed slave.
 
Necessary Condition for this mode: ethtool supports obtaining the speed of each slave
 
Mode 7: mod = 6, namely: (balance-alb) Adaptive load balancing (adapter Adaptive load balancing)
 
Features: This mode includes the balance-tlb mode and the receive load balance (rlb) for IPV4 traffic, without the support of any switch. The received Server Load balancer is implemented through ARP negotiation. The bonding driver intercepts the ARP response sent by the Local Machine and changes the source hardware address to the unique hardware address of a server Load balancer in bond, so that different peer terminals can communicate with each other using different hardware addresses.

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.