Summary of dual network card configuration practice under Linux system

  
                  

Prerequisite:

1. Do not configure on the virtual machine. Whether it is vm5 or vm6, I have tried it many times, every time it seems to be successful, but when I use the machine ping to do the network test, I will find the truth;


2. Must use the same brand with the same model Network card. Two different network cards, after the configuration of the document, even if you ping the external address from the machine, you will find that the network seems to be completely broken;


3. Use service network restart with caution. After the configuration is complete, after the test is successful, avoid performing network restart on the dual NIC machine. Otherwise, you will find that the network is unreachable. Even if you manually execute ifenslave eth0 eth1 again, only one NIC can be activated.


Let's talk about the configuration:


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 configuration of other network cards is as follows:

# cat ifcfg-eth0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=none

# cat ifcfg-eth1

DEVICE=eth0

ONBOOT=yes

BOOTPROTO =none


2.Module configuration

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

Add the following line

alias bond0 bonding

options bond0 miimon=100 mode=1


3. Startup configuration

# vi /etc/rc.d/rc.local < Br>

Join

ifenslave bond0 eth0 eth1


After restarting the machine, use ifconfig -a to view the NIC configuration information, if you find bond0, eth0, eth1 three NIC mac Ground And ip addresses are the same, then that good.


4.Test Verification


Use a machine on the same network segment to do ping test. Manually unplug any network cable (or use) on the dual NIC machine. Ifup eth0&&ifdown eth1), the terminal of the ping machine should have no interrupt information, or if there is a "timeout" and then recover quickly, the test is successful

Copyright © Windows knowledge All Rights Reserved