Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure dual network cards in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will share with you the relevant knowledge points about how to configure dual network cards in Linux. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.

Add a network adapter to the VMware virtual machine.

Choose the type of pattern you need

Start the virtual machine and configure the network card

Configure it in the same way as the original Nic (ip address, default gateway and Nic name cannot be the same as before)

Check the network card after rebooting all network cards (service network restart)

Third, test the new network card environment

Close the previous network card and check whether the new network card can be linked to the external network.

The ping indicates that the device (unknown host baido.com) cannot be identified after the public network, indicating that there is no dns domain name resolution service.

Fourth, solve the problem

1. Check the Nic configuration (cat / etc/sysconfig/network-scripts/ifcfg-eth2)

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

Configure boot boot onboot=yes to minimize installation without default boot boot

After configuring dual network cards, you can bind dual network cards.

Mode is the working state of ifenslave (binding mode)

Mode 0: balance cycle strategy: the packet transmission order is transmitted sequentially until the last transmission is completed. This mode provides load balancing and fault tolerance.

Mode 1: master-backup policy: only one device is active. One is down and the other is immediately switched to the primary device by backup. The MAC address is externally visible. This mode provides fault tolerance.

Mode 2: balance strategy: the transmission selects the device according to the Boolean value of the original address. This mode provides load balancing and fault tolerance.

Mode 3: broadcast policy: all 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 devices. (ask the boss to explain)

Mode 5: adapter transmission load balancing: without a special strategy, if the first device cannot get through, another device will take over the MAC address of the first device to assist the previous transmission.

Mode 6: adapter transmission load balancing: help mode5 and bonding drivers to intercept requests sent by ARP to the local system and mask the original address of the slave device with the hardware address of one of them. It's like using different hardware addresses on different devices on the server.

Step 1: back up the original network card

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

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

Step 3: delete the file Nic that is not used in / etc/sysconfig/network-scripts/ifcfg- {eth0,eth2}

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

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

Restart the network card (/ etc/init.d/network restart) after the configuration is completed. If the following is shown, the configuration is successful (ip r).

These are all the contents of the article "how to configure dual network cards in Linux". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report