Use bonding for dual NICs in RHEL5 servers

Source: Internet
Author: User
The so-called bonding means to bind multiple NICs to the same IP address to provide external services, which can achieve high availability or load balancing. Of course, it is impossible to directly set the same IP address for the two NICs. Through bonding, a virtual network card provides external connections, and the physical network card is changed to the same MAC address. Kernels2.4.12 and later versions both provide bonding modules. Previous versions can be implemented through patch. 1. Check your current Nic and check/etc/sysconfig/netwo

The so-called bonding means to bind multiple NICs to the same IP address to provide external services, which can achieve high availability or load balancing. Of course, it is impossible to directly set the same IP address for the two NICs. Through bonding, a virtual network card provides external connections, and the physical network card is changed to the same MAC address. Kernels 2.4.12 and later versions both provide bonding modules. Previous versions can be implemented through patch.


1. Check the network adapter you are currently using and check the files starting with ifcfg-in the/etc/sysconfig/network-scripts directory. They should be eth0, eth1...


2. Configure the virtual network card bond0

You can use DHCP or static IP. It is best to edit the configuration file through vi.

[Root @ server1 ~] # Cd/etc/sysconfig/network-scripts
[Root @ server1 network-scripts] # cat ifcfg-bond0
DEVICE = bond0
BOOTPROTO = none
ONBOOT = yes
NETWORK = 192.168.0.0
NETMASK = 255.255.255.0
IPADDR = 192.168.0.10
USERCTL = no
GATEWAY = 192.168.0.254
TYPE = Ethernet


3. Modify the eth0 and eth1 configuration files.

[Root @ server1 network-scripts] # ifcfg-eth0
DEVICE = eth0
BOOTPROTO = none
ONBOOT = yes
MASTER = bond0
SLAVE = yes
USERCTL = yes
[Root @ server1 network-scripts] # ifcfg-eth1
DEVICE = eth1
BOOTPROTO = none
ONBOOT = yes
MASTER = bond0
SLAVE = yes
USERCTL = yes

4. Add the newly added bond0 device to modprobe. conf for kernel recognition. Add the Setting Parameter. The value of miimon indicates the time when two NICs monitor each other, in ms. The mode value is work mode, which can be set to high availability or load balancing. 0 is high availability (default), 1 is Server Load balancer, and an XOR mode is also available.


Alias bond0 bonding

Options bond0 miimon = 100 mode = 1

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.