In Linux, dual NICs are used together for "1"

Source: Internet
Author: User
In Linux, dual NICs are used together with "1"-Linux Enterprise Application-Linux server application information. The following is a detailed description. The network connectivity of the server directly affects the availability of the server. Using the dual NIC (NIC) binding technology, the failure protection and load balancing of the server NIC can be realized, which helps improve network performance, this ensures the high availability of the server.

Dual Nic Binding Technology

The dual-nic binding is to virtualize two physical NICs into one logical Nic so that they have the same IP address and combine them into one logical link for work. This technology already exists in Sun and Cisco devices. It is called Trunking and Etherchannel respectively. In Linux, this technology is called Bonding. Bonding was first applied to the cluster Beowulf to improve data transmission efficiency between cluster nodes.

Bonding runs in Promisc mode and modifies the MAC addresses of the two NICs to the same. In hybrid mode, the NIC no longer only receives data frames whose destination hardware address is its MAC address, but can receive all frames on the network. The prerequisite for configuring dual-nic binding using Bonding technology is that the two NICs have the same chipset model and have independent BIOS chips.

Configuration method

1. Specify the nic ip Address

Create and modify the ifcfg-bond0 file, and specify the IP address, subnet mask, Nic ID and other information to the virtual NIC (bond0. Note: do not specify this information for a single Nic.

# Cp/etc/sysconfig/network-scripts/ifcfg-eth0 ifcfg-bond0
# Vi/etc/sysconfig/network-scripts/ifcfg-bond0

Modify the ifcfg-bond0 file to the following:

DEVICE = bond0
BOOTPROTO = static
IPADDR = 172.31.0.13
NETMASK = 255.255.252.0
BROADCAST = 172.31.3.255
ONBOOT = yes
TYPE = Ethernet

Enter the IP address and broadcast address as required.

In addition, you also need to set the configuration file ifcfg-eth0 of the two NICs and the "BOOTPROTO" in the ifcfg-eth1 to "dhcp ", delete the settings for "IPADDR", "NETMASK", and "BROADCAST.

2. Modify the/etc/modules. conf file.

Edit the/etc/modules. conf file and add the following content so that the system can load the Bonding module at startup.

Alias bond0 bonding
Options bond0 miimon = 100 mode = 1

"Miimon = 100" indicates that the system monitors the link connection status every Ms. If one line is detected to be disconnected, it is transferred to another line.

The value of "mode" indicates the working mode. There are four modes: 0, 1, 2, and 3. commonly used are 0 and 1.
Related Article

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.