Record the two-card bindings for CentOS once

Source: Internet
Author: User

Ready to do a KVM virtual session, the physical machine with dual NIC configuration, plan to bind the dual network adapter and then configure the bridge.

1. Under/etc/sysconfig/network-scripts/, create the file ifcfg-bond0, config file:


Device=bond0

Bootproto=none

Onboot=yes

netmask=255.255.255.0

ipaddr=192.168.2.227

Userctl=no

2.Bond0 binds two NICs eth0 and eth1, the original configuration needs to make some modifications

Eth0 IP and mask before annotations

Device=eth0

hwaddr=00:0c:29:f4:02:4e

Type=ethernet

uuid=3c639811-445b-4b1c-b6f8-e4179ff1701e

Onboot=yes

Nm_controlled=yes

Bootproto=none

#IPADDR =192.168.2.225

#NETMASK =255.255.255.0

Master=bond0

Slave=yes

Userctl=no

Eth1 the same comment off the IP and mask

Device=eth1

Hwaddr=00:0c:29:f4:02:44

Type=ethernet

uuid=42534ee0-abc2-4816-a643-ff7deba98d8d

Onboot=yes

Nm_controlled=yes

Bootproto=none

#IPADDR =192.168.2.226

#NETMASK =255.255.255.0

Master=bond0

Slave=yes

Userctl=no

3. Module Loading editor /etc/modprobe.d/dist.conf

Alias Bond0 Bonding

Options Bond0 miimon=100 mode=0 max_bonds=2

4. Restart the network
Note:

Miimon is used for link monitoring. For example: miimon=100, the Unit is MS (MS) this side of 100, is 100ms, that is, 0.1 seconds then the system every 100MS monitoring link connection status, if there is a line does not pass to another line; Mode value indicates the mode of operation, he has 0,1,2,3 four modes, Commonly used is 0, 12 kinds.

Mode There are seven types (0~6), which explain two common options.

mode=0 : Indicates that load balancing (round-robin) is balanced, and both NICs are working.

mode=1 Span style= "padding:0px;margin:0px;font-family: ' The song Body '; Color:rgb (77,109,243); font-size:12px;" >: fault-tolerance  (active-backup) provides redundancy, working in a way that the primary and standby work, where a network card is working (if the eth0 is broken), then automatically switch to another block network card (eth1 do Backup).

Bonding link monitoring can only be provided, 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.


Record the two-card bindings for CentOS once

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.