RedHatEnterpriseLinux6.X system dual Nic binding operation instance

Source: Internet
Author: User
RedHatEnterpriseLinux6.X system dual Nic binding operation instance first look at the general Nic IP Address Configuration, modify/etc/sysconfig/network-scripts/ifcfg-eth0 file content: DEVICE = eth0 & nbsp

RedHat Enterprise Linux 6.x system dual Nic binding operation instance

First look at the general Nic IP Address Configuration, modify the/etc/sysconfig/network-scripts/ifcfg-eth0 file content is:

DEVICE = eth0 # physical DEVICE name
HWADDR = 00: 0C: 29: 01: 98: 27 # MAC address
BOOTPROTO = static # static allocation
IPADDR = 192.168.1.103 # This is the static IP address you set.
NETMASK = 255.255.255.0 # Subnet Mask
GATEWAY = 192.168.1.1 # GATEWAY address
ONBOOT = yes # enable the device when the NIC service is booted or started

Bind the bond dual Nic In RHEL6
The procedure and precautions are as follows:
1. Notes:
First, confirm the two network ports to be bound to avoid binding the wrong Network Ports.
2. Description:
The following uses two Network Ports bound to eth0 and eth1 as an example.
The configuration files are all in the/etc/sysconfig/network-scripts/directory.
Procedure
Disable the NetworlManger service before binding. Otherwise, it will conflict with the bond Nic.
12 chkconfig NetworlMangeroff # Stop starting the service
Service NetworlManger stop # stop the NIC Management service. In the NIC configuration file, whether NM_CONTROLLED = yes // whether the device eth0 can be managed by the Network Manager graphical management tool can directly Delete this line.

1. Edit new ifcfg-bond0 File
Cd/etc/sysconfig/network-scripts/
Cp-rfifcfg-eth0ifcfg-bond0 # copy ifcfg-eth0 to ifcfg-bond0
Ls # view the file, you can see that there is a ifcfg-bond0 File
Add or modify the following content:

# Vi ifcfg-bond0
DEVICE = bond0
IPADDR = 192.168.1.155
NETMASK = 255.255.255.0
GATEWAY = 192.168.1.254 # this IP address is required by the customer.
ONBOOT = yes
BOOTPROTO = static
USERCTL = no
BONDING_OPTS = "mode = 0 miimon = 100 primary = eth0" # Set eth0 as the main communication network port. The specific information is subject to the on-site conditions.


Save and exit
2. Edit ifcfg-eth0 and ifcfg-eth1 files respectively

# Vi ifcfg-eth0
DEVICE = eth0
HWADDR = AB: CD: EF: 12: 34: 56 Note that the MAC address of eth0 should be retained. Do not delete or block
USERCTL = no
ONBOOT = yes
MASTER = bond0
SLAVE = yes
BOOTPROTO = none
# Vi ifcfg-eth1
HWADDR = AB: CD: EF: 12: 34: 57 Note that the MAC address of eth1 should be retained. Do not delete or block
DEVICE = eth1
USERCTL = no
ONBOOT = yes
MASTER = bond0
SLAVE = yes
BOOTPROTO = none


Note: If you do not need to set other network ports, you must disable or remove the IPADDRNETMASKNETWORKBROADCASTGATEWAY In the NIC configuration file. The MAC address must be retained. This prevents sequential Nic drift caused by hard disk Nic binding.
But don't worry. in linux, there is a table that records the correspondence between the eth device Nic name and MAC address.

3. Modify the/etc/modprobe. d/dist. conf file and add the following content:

Alias bond0 bonding
Options bond0 miimon = 100 mode = 0 # depending on the construction site requirements


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. There are four modes: 0, 1, and 2, which are commonly used: 0, 1. You need to select the mode available for the switch.
Mode = 0 indicates that loadbalancing (round-robin) is a load balancing method, 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 backed up.
※Note:
A. 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.
B. The set mode must be the same as that set by the vswitch.

RedHat Enterprise Linux AS 4 dual Nic Server Load balancerHttp://www.linuxidc.com/Linux/2010-06/26815.htm

For more details, refer to the highlights on the next page.: Http://www.linuxidc.com/Linux/2013-10/91891p2.htm

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.