How to bind Linux dual network card configuration on VMware virtual machine

Share a detailed steps about using VMware virtual machine Linux dual network card binding configuration

1. Add a network adapter to the VMware virtual machine.

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machineHow to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machineHow to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machineHow to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

Choose the type of mode you need

2. Start the virtual machine and configure the network card

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

Configured according to the original configuration of the network card (the ip address, default gateway and network card name cannot be the same as the original one)

Restart all network cards (service network restart) and check the network cards

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

Three, test the new network card environment

Close the original network card and check whether the new network card can be connected to the external network

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

After pinging the external network, it prompts that the device cannot be recognized (unknown host baido.com), indicating that there is no DNS domain name resolution service.

Four, solve the problem

1. Check the network card configuration (cat /etc/sysconfig/network-scripts/ifcfg-eth1)

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

If dns is configured, it may be (/etc/resolv.conf) that this path is not assigned to it by default by the Linux system when reinstalling , so you can configure it manually

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

Configure boot-up onboot=yes, the minimal installation is not boot-up by default

#After configuring the dual network cards, you can bind the dual network cards

mode is the working status of ifenslave (binding mode)

Mode 0: Balanced cyclic strategy: The sequence of transmission data packets is transmitted sequentially until the last transmission is completed. This mode provides load balancing and fault tolerance

Mode 1: Primary-Backup Strategy: Only one device is active. One is down and the other is immediately converted from backup to master. The MAC address is externally visible. This mode provides fault tolerance.

Mode 2: Balance strategy: Transmission selects equipment based on the boolean value of the original address. This mode provides load balancing and fault tolerance.

Mode 3: Broadcast strategy: All data packets are transmitted to all interfaces. This mode provides fault tolerance.

Mode 4: IEEE 802.3ad dynamic link aggregation: Create aggregation groups that share the same speed and duplex equipment. (Please explain to the boss)

Mode 5: Adapter transmission load balancing: There is no special strategy. If the first device fails to communicate, another device will take over the MAC address of the first device to help the previous transmission.

Mode 6: Adapter transmission load balancing: Help mode5 and bonding driver intercept the ARP request sent by the local system, and use one of the hardware addresses to cover the original address of the slave device. It's like using different hardware addresses for different devices on the server.

Step 1: Back up the original network card

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

cp /etc/sysconfig/network-scripts/ifcfg-{eth0,eth0.old}
cp /etc/sysconfig/network-scripts/ifcfg-{eth1,eth1.old}

Step 2: Create a new network card file /etc/sysconfig/network-scripts/ifcfg-bond0

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

Step 3: Delete unused files in /etc/sysconfig/network-scripts/ifcfg-{eth0,eth1}

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machineHow to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

Step 4: Add a file to the /etc/modules.conf text, if not, create one

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

The last step: append to /etc/rc.local (modprobe bonding miimon=100 mode=0)

How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine
After the setting is complete, restart the network card (/etc/init.d/network restart), if the following is displayed, the configuration is successful (ip r)How to bind Linux dual network card configuration on VMware virtual machine How to bind Linux dual network card configuration on VMware virtual machine

This article address: https://www.linuxprobe.com/vmware-linux-binding.html

Guess you like

Origin blog.csdn.net/u014389734/article/details/107949400