How to configure dual NICs in RedhatLinux

Source: Internet
Author: User
Prerequisites: Environment: RedHatLinux system 1. do not configure it on the virtual machine. Whether it's vm5 or vm6, I 've tried it multiple times and it seems to be successful each time, But I will find the truth when I use machine ping for a network disconnection test. 2. NICs of the same brand and model must be used. Two different NICs. After configuring according to the document, even if you ping the external address from the local machine, the network seems to have been completely disconnected. 3. Use servicenetworkrestart with caution. The configuration is complete. After the test is successful, do not run it on the dual-nic machine.

Prerequisites:

Environment: RedHat Linux

1. Do not configure it on the VM. Whether it's vm5 or vm6, I 've tried it multiple times and it seems to be successful each time, But I will find the truth when I use machine ping for a network disconnection test.

2. NICs of the same brand and model must be used. Two different NICs. After configuring according to the document, even if you ping the external address from the local machine, the network seems to have been completely disconnected.

3. Use service network restart with caution. After the configuration is complete, after the test is successful, avoid restarting the network on the dual Nic machine. Otherwise, you will find that the network is disconnected, even if you manually execute ifenslave eth0 eth1 again, you can only activate one network card.

The configuration is as follows:

1. Nic Configuration

# Cd/etc/sysconfig/network-scripts/

# Cp ifcfg-eth0 ifcfg-bond0

# Vi ifcfg-bond0

Change the first line to DEVICE = bond0

# Cat ifcfg-bond0

DEVICE = bond0

BOOTPROTO = static

IPADDR = 192.168.1.100

NETMASK = 255.255.255.0

BROADCAST = 192.168.1.255

ONBOOT = yes

TYPE = Ethernet

The configurations of other NICs are as follows:

# Cat ifcfg-eth0

DEVICE = eth0

ONBOOT = yes

BOOTPROTO = none

# Cat ifcfg-eth1

DEVICE = eth0

ONBOOT = yes

BOOTPROTO = none

2. module configuration

Edit the/etc/modules. conf or/etc/moprobe. conf file.

Add the following lines

Alias bond0 bonding

Options bond0 miimon = 100 mode = 1

3. Start Configuration

# Vi/etc/rc. d/rc. local

Join

Ifenslave bond0 eth0 eth1

After the machine is restarted, use ifconfig-a to view the NIC configuration information. If you find that the mac addresses and IP addresses of the three NICs bond0, eth0, and eth1 are the same, that's all done.

4. test and verification

Ping test is performed on a machine with the same external network segment. Manually unplug any network line (or use ifup eth0 & ifdown eth1) on the dual-nic machine. The terminal for ping should have no interruption information, or if a "timeout" is restored quickly, the test is successful.

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.