Many computers now have more than one network card, but one network card fails and the entire network is interrupted. But in Linux systems, as long as you create a Linux virtual network card, you will not encounter this kind of trouble. This article will introduce the skills of setting up multiple network cards into multiple virtual network cards under Linux.
to eth0 and eth1 to become virtual bond0 example: Prerequisites ------ binding: the same chipset model, but the card should have its own independent BIOS chips.
Setting Method
1. Create a virtual network interface configuration file ifcfg-bond0 and specify the network card IP: vi /etc/sysconfig/network-scripts/ifcfg-bond0
Cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
IPADDR=10.0.11.10
NETMASK= 255.255.252.0
GATWAY=10.0.11.1
ONBOOT=yes
USERCTL=no
TYPE=Ethernet
2 Modify ifcfg-eth0 and ifcfg-eth1----- can not set information about IP, gateway, subnet mask and so on.
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
cat /etc/sysconfig/network-scripts/ifcfg- Eth1
DEVICE=eth1
BOOTPROTO=dhcp
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
3, install module
Because the virtual network card is implemented in the kernel module, you need to install the module, in /etc/Add the following in modules.conf to enable the system to load the bonding module at startup. The external virtual network interface device is bond0.
Add the following two lines
alias bond0 bonding
options bond0 miimon=100 mode=0 --- 0 means that the two physical NICs are running in load balancing mode.
Note: miimon is used for link monitoring. For example: miimon=100, then the system monitors the link connection status every 100ms. If one line fails, it will transfer to another line; the mode value indicates the working mode. He has 0, 1, 2, 3 modes. The number is 0, 1 two.
mode=0 indicates that load balancing (round-robin) is the load balancing mode, and both network cards are in the active state.
mode=1 means that fault-tolerance (active-backup) provides redundancy, which means that by default only one NIC is active and the other is backed up.
If this mode is used: options bond0 miimon=100 mode=1 primary=eth0--- indicates that eth0 is in the active state and eth1 is in the standby state.
Bonding can only provide link monitoring, that is, whether the link from the host to the switch is connected. If only the external link of the switch is down, and the switch itself is not faulty, then bonding will continue to use the link without any problems.
4. Add the following command to /etc/rc.local.
cat /etc/rc.local
modprobe bonding miimon=100 mode=0
The configuration is complete and the host is rebooted.
Bringing up interface bond0 OK
Bringing up interface eth0 OK
Bringing up interface eth1 OK
The above is how many NICs are set up under Linux The skills of a virtual network card, so after the setup is complete, as long as a virtual network card can still be used, the virtual network card can work normally, it will not break the network.
Linux whereis command and find command are a bit similar, whereis command finds faster, but can only
Linux rdate command is mainly used to display the date and time of other hosts, to achieve time sync
I think the default font of Linux system is not good, want to change style? Want to increase the typ
Many Linux users like to use the mongodb database, a handy database. However, some
Linux method for building pipe pipeline functions
Detailed examples of Linux dynamic library generation
Ways to debug network performance using tools under Linux
What should I do if I restart the card on the logo screen after installing Ubuntu 11.10?
Usage of Linux global variable jiffies
Linux operation example summary of the history command
Linux system to find ways to replace non-UTF-8 encoded files
Red Flag Linux6.0 system supports Ntfs partitioning skills
Fedora system ifconfig and netstat command can not find a solution
What should I do if there are garbled characters in Linux Chinese characters?
How to use the tar command correctly under Linux system
Win10 system's most comprehensive and detailed optimization settings
Win10 system boot must be restarted to enter the power-on password, what should I do?
Win10 preview version of the virtual desktop use and operation skills graphic introduction
Intel: Ivy Bridge plus Win8, will open a new hybrid era
Win10 new feature Continuum get started demo video: consistent experience
9 solutions for forgetting Windows XP login password (2)
Solve IIS can not display Chinese name image problem
Win7 printer driver can not be installed how to do
This copy appears in the lower right corner of the computer is not genuine, how to remove it