LINUX6/CENTOS6 Aggregation Link

Source: Internet
Author: User
Tags switches

Brief introduction

Link aggregation (link Aggregation), refers to a number of physical ports bundled together to become a logical port to achieve the load sharing of the outgoing/incoming traffic in each member port, the switch based on the user-configured port load sharing strategy determines which member port from which the message is sent to the peer switch. When the switch detects a link failure in one of the member ports, it stops sending a paper message on this port and recalculates the port on the remaining link based on the load sharing policy, and then recalculates the message sending port again after the failed port resumes. Link aggregation is an important technique in increasing the bandwidth of links, realizing the elasticity and redundancy of link transmission.
If each link to the aggregation follows a different physical path, the aggregation link also provides redundancy and fault tolerance. By aggregating modem links or digital lines, link aggregation can be used to improve access to the public network. Link aggregation can also be used in enterprise networks to build multigig backbone links between Gigabit Ethernet switches

Principle

The bandwidth of the logical link increases by about (n-1) times, where n is the number of aggregations. In addition, after aggregation, the reliability is greatly improved because, as long as one of the n links works properly, the link works. In addition, link aggregation can achieve load balancing. Because, through the link aggregation of two (or more) switches connected together (or other network devices), through internal control, it is also reasonable to allocate data on the converged connected devices, to achieve load sharing.
Because traffic loads are distributed across multiple links, link aggregation is sometimes referred to as load balancing. However, load balancing, as a data center technology, can be used to distribute requests from clients to two or more servers. Aggregations are sometimes referred to as repeated use or Imux. If multiplexing is the aggregation of multiple low-speed channels into a single, high-speed link, reuse is the "scatter" of data across multiple links. It allows the fractional bandwidth to be configured at some incremental scale to meet bandwidth requirements. Link aggregation is also known as trunking.
On-demand bandwidth or combination is the ability to add lines as needed to increase bandwidth. In this scenario, the lines are automatically connected as required by the bandwidth. Aggregations are usually accompanied by ISDN connections. The basic rate interface supports two 64kbit/s links. One can be used for phone calls, while the other can be used for data links at the same time. These two links can be combined to establish a L28KBIT/S data link.
Link aggregation has the following advantages:
1. Increase network bandwidth
Link aggregation can bundle multiple links into a single logical link, and the bundled link bandwidth is the sum of the bandwidth of each independent link.
2, improve the reliability of network connection
Multiple links in a link aggregation are backed up, and when one link is broken, the traffic is automatically redistributed across the remaining links.
There are two main ways to link aggregation:
1. Static Trunk
Static trunk joins multiple physical links directly into the trunk group, forming a logical link.
2. Dynamic LACP
LACP (link Aggregation control Protocol, Link Aggregation protocol) is a protocol for dynamic aggregation of links. The LACP protocol interacts with the peer through LACPDU (link Aggregation control Protocol data Unit, Link Aggregation Controls protocol data units).
When the LACP protocol for a port is activated, the port advertises its own system priority, System MAC address, port priority, and port number by sending LACPDU to the peer. After the peer receives this information, it compares the information to its own property, selects the ports that can be aggregated, so that both sides can agree on the port join or exit a dynamic aggregation group.
Link aggregation is often used between two important nodes or busy nodes, which can increase the interconnection bandwidth and provide the reliability of the connection.

Here's how to configure the aggregation link for LINUX6/CENTOS6

1. Create a new network card configuration

Linux6 system in the name of the network card eth0, eth1 such a way to name, we create a new network card, called Bond0, with Bond0, eth0 and eth1 network card configuration do not appear in the IP name, the following is the operation process

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

Device=bond0

Onboot=yes

Bootproto=none

Type=ethernet

Userctl=no

ipaddr=192.168.1.3

netmask=255.255.255.0

2 Modifying the Eth0 file

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

Device=eth0

Onboot=yes

Bootproto=none

Type=ethernet

Master=bond0

Slave=yes

Userctl=no

3. Modify the Eth1 file

Vim/etc/sysconfig/network-scripts/ifcfg-eth1

Device=eth1

Onboot=yes

Bootproto=none

Type=ethernet

Master=bond0

Slave=yes

Userctl=no

2. Load Bonding Module

vi/etc/modprobe.d/bonding.conf add at the end of the file

Alias Bond0 Bonding

Options Bond0 mode=1 miimon=100

Parameter explanation:

The Miimon is used for link monitoring. For example: miimon=100, then the system every 100MS monitoring link connection status, if one line is not connected to another line.

The value of mode indicates the mode of operation, and the typical working mode is 0, 12 kinds.

Mode=0 means that loadbalancing (round-robin) is load balanced and both NICs work.

Mode=1 indicates that fault-tolerance (active-backup) provides redundancy, working in a way that the master is working, meaning that only one NIC works by default. Another piece to do the backup. Bonding can only provide link monitoring, i.e. whether the link from the host to the switch is connected. If only the switch's external link is down, and the switch itself does not fail, then bonding will assume that the link is not a problem and continue to use it.

3, set the bond0 to boot automatically load

Writing/etc/rc.d/rc.local

In line 2nd, add a sentence

Ifenslave bond0 eth0 eth1

4. Restart the network card

Execute the command/etc/init.d/network restart (or service network restart) as the two commands mean. If not, restart the system to try reboot or Init 6.

5. Verify that the NIC binding is successful

Enter Ifconfig to see if the MAC address of the Bond0,eth0,eth1 three Nic is the same, and if it is consistent, you can basically determine that the dual NIC binding is in effect.

Then, view the/proc/net/bonding/bond0 file, or you can determine whether the NIC binding is successful.

If you have any questions about this article, please add the following discussion

LINUX6/CENTOS6 Aggregation Link

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.