Linux under the two-card binding __linux

Source: Internet
Author: User

If the server has two fast network card can bind it to a virtual network card, if a network card is broken another piece can continue to work, increased redundancy and load, the specific practices are as follows:

Create a new virtual network card with the following command:

Iv/etc/sysconfig/network-scripts/ifcfg-bond0

Enter in the file:

Device=bond0
Bootproto=static
ipaddr=192.168.0.231
netmask=255.255.255.0
Onboot=yes
Type=ethernet

Exit after saving

Then modify Ifcfg-eth0 and ifcfg-eth1 two files

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Modified to:

Device=eth0
Bootproto=static
Slave=yes
Master=bond0
Onboot=yes
Type=ethernet

Vi/etc/sysconfig/network-scripts/ifcfg-eth1

Modified to:

Device=eth1
Bootproto=static
Slave=yes
Master=bond0
Onboot=yes
Type=ethernet

To configure the gateway:

Vi/etc/sysconfig/network

Modified to:

Networking=yes
Hostname=name
gateway=192.168.0.1

In/etc/modprobe.conf (in some versions, this file is modules.conf), add the following lines:

Alias Bond0 Bonding
Options Bond0 miimon=1000 model=0
Alias Eth0 e1000
Alias Eth1 e1000

Vi/etc/modprobe.conf

Modified to:

Alias Bond0 Bonding
Options Bond0 miimon=1000 model=0
Alias Eth0 e1000
Alias Eth1 e1000
Alias Scsi_hostadapter Mptbase
Alias Scsi_hostadapter1 Mptscsih
Alias Scsi_hostadapter2 MegaRAID
Alias Usb-controller USB-UHCI
Alias Usb-controller1 EHCI-HCD

Save exit and restart the network.

Service Network restart

After reboot, unplug a network cable or stop a NIC, and does not affect Internet services.

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.