Bind multiple NICs (Debian, Ubuntu, SuSE, Fedora, and RH) in Linux versions)

Source: Internet
Author: User
In Linux, you can easily bind multiple NICs to achieve load balancing and dual-line hot backup. Server Load balancer distributes the load evenly to any number of network adapters to achieve dual-line hot standby with overlapping bandwidth. That is, multiple network adapters are backed up to each other. The normal operation of the network can be ensured by any network adapter. Mode = 0Round-robin: sequential (polling load balancing, the most common) mode = 1Active-backup: onlyonemode = 2XOR: sameMA Linux can easily bind multiple network adapters, implements load balancing and dual-line hot standby.

Server Load balancer distributes the average load to any number of network adapters to overlay the bandwidth.

Dual-line Hot Standby means that multiple NICs are backed up to each other. Any one of them can work to ensure the normal operation of the network.

Binding types

Mode = 0 Round-robin: sequential (Round robin load balancing, most commonly used)

Mode = 1 Active-backup: only one

Mode = 2 XOR: same MAC same nic

Mode = 3 Broadcast: all

The major release editions are slightly different, basically divided into three types,

Debian and Ubuntu,

SUSE,

Mandriva, Fedora, and RH

-----------------------------------------------------------------------

Bind multiple NICs On Debian and Ubuntu

Experimental environment: Ubuntu 6.06 Dadder, kernel version 2.6.15-23 server

First install ifenslave

# Apt-get install ifenslave-2.6

Edit/etc/network/interfaces

Auto lo bond0 eth0 eth1

Iface bond0 inet static

Address 10.31.1.5

Netmask 255.255.255.0

Network 10.31.1.0

Gateway 10.31.1.254

Up/sbin/ifenslave bond0 eth0

Up/sbin/ifenslave bond0 eth1

Iface lo loopback

Iface eth0 inet static

Address 10.1.1.101

Netmask 255.255.255.0

Iface eth1 inet static

Address 10.1.1.102

Netmask 255.255.255.0

Edit/etc/modprobe. d/arch/i386

Add two rows:

Alias bond0 bonding

Options bonding mode = 0 miimon = 100

Restart the network.

/Etc/init. d/networking restart

-----------------------------------------------------------------------

SuSE, Mandriva, Fedora, and RH

1. edit/etc/modules. conf file (The SuSE system is/etc/modprobe. d/modprobe. cong. local), add the following line to make the system load the bonding module at startup, and the external virtual network interface device is bond0

Alias bond0 bonding

2. Edit the virtual network interface configuration file and specify the IP address of the NIC.

Vi/etc/sysconfig/network-scripts/ifcfg-bond0

(The SuSE system is/etc/sysconfig/network/ifcfg-bond0)

Writing of Fedora

DEVICE = bond0

IPADDR = 192.168.1.1

NETMASK = 255.255.255.0

NETWORK = 192.168.1.0

BROADCAST = 192.168.1.255

ONBOOT = yes

BOOTPROTO = none

USERCTL = no

SuSE statement

BOOTPROTO = 'static'

BROADCAST = '1970. 168.1.255'

ETHTOOL_OPTIONS =''

IPADDR = '192. 168.1.1'

MTU =''

NETMASK = '2017. 255.255.0'

NETWORK = '1970. 168.1.0'

STARTMODE = 'auto'

USERCONTROL = 'no'

3. Edit the physical network interface configuration file and point to the virtual network interface bond0.

Fedora:

The physical network interface configuration file is located in/etc/sysconfig/network-scripts,

The ifcfg-eth0 corresponds to the first Nic, And the ifcfg-eth1 corresponds to the second Gigabit Nic.

Ifcfg-eth0:

DEVICE = eth0

IPADDR = 11.0.0.1

NETMASK = 255.255.255.0

USERCTL = no

ONBOOT = yes

BOOTPROTO = none

Ifcfg-eth1:

DEVICE = eth1

IPADDR = 11.0.0.2

NETMASK = 255.255.255.0

USERCTL = no

ONBOOT = yes

BOOTPROTO = none

SuSE:

The physical network interface configuration file is located at/etc/sysconfig/network /,

Use ifcfg-eth-(mac) as the name

BOOTPROTO = 'static'

IPADDR = '10. 0.0.1'

NETMASK = '2017. 255.255.0'

STARTMODE = 'auto'

USERCONTROL = 'no'

Finally, edit/etc/rc. local (SuSE is/etc/rc. d/rc) or directly run

Ifenslave bond0 eth0 eth1 eth2 (write the names of several NICs when several NICs are bound)

No matter how the IP address of eth0 eth1 eth2 is set, the bind0 setting prevails after binding. The mac addresses of all NICs are the same.
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.