How to integrate dual NICs with "1" in Linux

Source: Internet
Author: User
Article Title: How to enable dual NICs to be used together in Linux. Linux is a technology channel of the IT lab in China. The network connectivity of some basic classification servers, such as desktop applications, Linux system management, kernel research, embedded systems, and open source, directly affects the availability of servers. the dual-NIC binding technology is used, server Nic failure protection and load balancing can improve network performance and ensure high server availability (see ).


Network topology after dual-Nic binding

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=bond0BOOTPROTO=staticIPADDR=172.31.0.13NETMASK=255.255.252.0BROADCAST=172.31.3.255ONBOOT=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.

[1] [2] Next page

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.