Centos6.5 multi-Nic binding

Source: Internet
Author: User
Through the network port binding (bond) technology, you can easily achieve network port redundancy and load balancing to achieve high-availability load balancing. [Root @ localho

Through the network port binding (bond) technology, you can easily achieve network port redundancy and load balancing to achieve high-availability load balancing.

[Root @ localhost ~] # Cat/etc/issue
CentOS release 6.5 (Final)
Kernel \ r on an \ m

[Root @ localhost ~] # Echo "alias netdev-bond0 bonding">/etc/modprobe. d/bonding. conf

Run this command before binding the NIC to add the modules loaded when the server starts.

Modify the bond0 configuration file bound to the new NIC

[Root @ localhost ~] # Vim/etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE = bond0
TYPE = Ethernet
ONBOOT = yes
BOOTPROTO = static
USERCTL = no
PEERDNS = yes
IPV6INIT = no
IPADDR = 112.25.xx.xx
NETMASK = 255.255.255.255.192
BROADCAST = 112.25.xx.xx
GATEWAY = 112.25.xx.xx
BONDING_OPTS = "miimon = 80 mode = 6"

Miimon is the unit of time interval for link monitoring. miimon = 80 means to monitor the link connection status every 80 ms. if one line fails, it is transferred to another line.

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.

Here I am binding four NICs, and the server is dell R720. the default Nic name is em1 -- em4. when the NIC is bound, the configurations of the four NICs are similar, the master must be set to bond0, and the four NICs are slave

 

 

Restart the server

Then, view the Nic binding information.

 

 

[Root @ localhost ~] # Ifconfig
Bond0 Link encap: Ethernet HWaddr F8: BC: 12: 38: BF: 04
Inet addr: 112.25.xx.17 Bcast: 112.25.xx.63 Mask: invalid bandwidth limit 192
Up broadcast running master multicast mtu: 1500 Metric: 1
RX packets: 198948 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 374418 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 20792024 (19.8 MiB) TX bytes: 29577760 (28.2 MiB)


Em1 Link encap: Ethernet HWaddr F8: BC: 12: 38: BF: 04
Up broadcast running slave multicast mtu: 1500 Metric: 1
RX packets: 36838 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 123885 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 fig: 1000
RX bytes: 3250190 (3.0 MiB) TX bytes: 12842300 (12.2 MiB)
Interrupt: 35


Em2 Link encap: Ethernet HWaddr F8: BC: 12: 38: BF: 05
Up broadcast running slave multicast mtu: 1500 Metric: 1
RX packets: 88178 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 87303 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 fig: 1000
RX bytes: 11017650 (10.5 MiB) TX bytes: 6243968 (5.9 MiB)
Interrupt: 38


Em3 Link encap: Ethernet HWaddr F8: BC: 12: 38: BF: 06
Up broadcast running slave multicast mtu: 1500 Metric: 1
RX packets: 37044 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 81803 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 fig: 1000
RX bytes: 3274966 (3.1 MiB) TX bytes: 5272322 (5.0 MiB)
Interrupt: 34


Em4 Link encap: Ethernet HWaddr F8: BC: 12: 38: BF: 07
Up broadcast running slave multicast mtu: 1500 Metric: 1
RX packets: 36888 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 81427 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 fig: 1000
RX bytes: 3249218 (3.0 MiB) TX bytes: 5219170 (4.9 MiB)
Interrupt: 36


Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Up loopback running mtu: 16436 Metric: 1
RX packets: 1 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 1 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 99 (99.0 B) TX bytes: 99 (99.0 B)

 

 

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.