RedHatEnterpriseLinuxAS4 dual Nic Load Balancing

Source: Internet
Author: User
Configuration and Description: the operating system of the experiment is the prerequisite for binding RedHatEnterpriseLinuxAS4: the chipset model is the same, and the NIC should have its own BIOS chip. 1. Edit the virtual network interface configuration file, specify the network adapter ingress I/etc/sysconfig/network-scripts/ifcfg-bond0 [root @ rhas-13root] # cp/etc/sysconfig/network

The configuration and description are as follows:
The operating system of the experiment is RedHat Enterprise Linux AS 4.
Prerequisites: the chipset model is the same, and the NIC should have its own independent BIOS chip.

1. Edit the virtual network interface configuration file and specify the nic ip Address
Vi/etc/sysconfig/network-scripts/ifcfg-bond0
[Root @ rhas-13 root] # cp/etc/sysconfig/network-scripts/ifcfg-eth0 ifcfg-bond0

2 # vi ifcfg-bond0
Change the first line to DEVICE = bond0
# Cat ifcfg-bond0
DEVICE = bond0
BOOTPROTO = static
IPADDR = 172.31.0.13
NETMASK = 255.255.252.0
BROADCAST = 172.31.3.254
ONBOOT = yes
TYPE = Ethernet
Do not specify the IP address, subnet mask, or Nic ID of a single Nic. Specify the above information to the virtual adapter (bonding.
[Root @ rhas-13 network-scripts] # cat ifcfg-eth0
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = dhcp
[Root @ rhas-13 network-scripts] # cat ifcfg-eth1
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = dhcp

3 # vi/etc/modules. conf
Edit the/etc/modules. conf file and add the following line to enable the system to load the bonding module at startup. The external virtual network interface device is bond0.
 
Add the following two rows
Alias bond0 bonding
Options bond0 miimon = 100 mode = 1
Note: miimon is used for link monitoring. For example: miimon = 100, The system monitors the link connection status every Ms. If one line fails, it is transferred to another line. The value of mode indicates the working mode, which has a total, two or three modes, commonly used: 0, 1.
Mode = 0 indicates that the load balancing (round-robin) method is load balancing, and both NICs work.
Mode = 1 indicates that fault-tolerance (active-backup) provides redundancy, working in the active/standby mode. That is to say, by default, only one network card works and the other is used for backup.
Bonding can only provide link monitoring, that is, whether the link from the host to the switch is connected. If the external link of the switch is down and the switch is not faulty, bonding considers that the link is correct and continues to be used.

4 # vi/etc/rc. d/rc. local
Add two rows
Ifenslave bond0 eth0 eth1
Route add-net 172.31.3.254 netmask limit 255.255.0 bond0

After the configuration is complete, restart the machine.
The following information is displayed after restart, indicating that the configuration is successful.
................
Bringing up interface bond0 OK
Bringing up interface eth0 OK
Bringing up interface eth1 OK
................

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.