Configure the nic bond in centos and load multiple NICs

Source: Internet
Author: User

Configure the nic bond in centos and load multiple NICs

Bind two bond, four Network Ports, two Network Ports and one bond.

Bond0 -- eth0 eth1 Internet

Bond1 -- eth2 eth3 Intranet

You need to modify three locations in total, and then you must restart the server reboot.


1. Add bond configuration files, modify configuration files such as ifcfg-eth0

Write the IP address to bond0,

Eth0 comment out the IP address, add master, slave

Note: Comment out all MAC addresses.


CD/etc/sysconfig/network-Scripts

CP ifcfg-eth0 ifcfg-bond0

VI ifcfg-bond0

# Intel Corporation i350 gigabit network connection

Device = bond0 # Change the name

# Hwaddr = 6C: AE: 8B: 1D: CC: B2

Onboot = Yes

Bootproto = static

Netmask = 255.255.255.255.128

Ipaddr = Public IP

Gateway = 192.168.0.1

Type = Ethernet


VI ifcfg-bond1

# Intel Corporation i350 gigabit network connection

Device = bond1 # Change the name

# Hwaddr = 6C: AE: 8B: 1D: CC: B2

Onboot = Yes

Bootproto = static

Netmask = 255.255.255.0

Ipaddr = Intranet IP Address

Type = Ethernet

VI ifcfg-eth0 # comment out IP

# Intel Corporation i350 gigabit network connection

Device = eth0

# Hwaddr = 6C: AE: 8B: 1D: CC: B2

Onboot = Yes

Bootproto = none

# Netmask = 255.255.255.255.128

# Ipaddr =

# Gateway =

Type = Ethernet

Master = bond0 # Add eth0 and 1 Write bond0, eth2 and 3 Write bond1

Slave = yes # Add


Cat ifcfg-eth3

# Intel Corporation i350 gigabit network connection

Device = eth3

# Hwaddr = 6C: AE: 8B: 1D: CC: B5

Onboot = No

Hotplug = No

Bootproto = none

Type = Ethernet

Master = bond1

Slave = Yes

2. Add the statement to the/etc/modprobe. conf file

VI/etc/modprobe. conf

Alias bond0 Bonding

Options bond0 miimon = 100 mode = 1

Alias bond1 Bonding

Options bond1 miimon = 100 mode = 1

If no modprobe. conf file exists, centos6 Modifies/etc/modprobe. d/Dist. conf file and adds



Parameter description:

Miimon is the unit of time interval for link monitoring. miimon = 100 means that the system checks whether the network adapter and the switch are connected every 100 milliseconds. Otherwise, other links are used.

Mode = 0 indicates the Server Load balancer mode. Both NICs work and must be supported by the switch.

Mode = 1 indicates the redundancy mode. Only one network adapter works. If one problem occurs, another one is enabled.

Mode = 6 indicates the Server Load balancer mode. Both NICs work and do not require support from vswitches.

3. Add the statement to the/etc/rc. Local file

VI/etc/rc. Local

Ifenslave bond0 eth0 eth1

Ifenslave bond1 eth2 eth3

Restart the server reboot. to load the module, restart the server.


View bond status

CAT/proc/NET/Bonding/bond0


Appendix:

Device = physical device name

Ipaddr = IP Address

Netmask = mask Value

Network = network address

Broadcast = broadcast address

Gateway = gateway address

Onboot = [Yes | no] (whether to activate the device during boot)

Userctl = [Yes | no] (whether non-root users can control the device)

Bootproto = [none | static | BOOTP | DHCP] (no protocol used during boot | static allocation | BOOTP protocol | DHCP protocol)

Hwaddr = Your MAC address


This article is from the "xficc" blog, please be sure to keep this source http://xficc.blog.51cto.com/1189288/1551403

Configure the nic bond in centos and load multiple NICs

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.