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

Linux about host server dual network card bond configuration

2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In the actual implementation of the project, a host has two network cards to achieve double connection. At this time, it is necessary to configure the two network cards of the host with bond, which is virtualized as a network card and works in an active and standby way to ensure the high availability of the system.

I. configuration requirements of bond

The two network card chips bound must be of the same model and have independent BIOS chips.

Second, the configuration process of bond

Take the bond configuration of eth0 and eth2 network cards as an example to explain the operation steps. The following operations are done under the root user.

1. Create a virtual network interface profile / etc/sysconfig/network-scripts/ifcfg-bond0 with the following contents:

DEVICE=bond0

BOOTPROTO=none

TYPE=Ethernet

ONBOOT=yes

IPADDR=192.168.31.100

NETMASK=255.255.255.0

GATEWAY=192.168.31.1

Note: the red part is the system IP address and gateway address, which needs to be modified according to the actual deployment.

two。 Edit the ifcfg-eth0 network card configuration file

Execute the command vi / etc/sysconfig/network-scripts/ifcfg-eth0, and modify the configuration file of the eth0 Nic in the following format:

DEVICE=eth0

USERCTL=no

ONBOOT=yes

MASTER=bond0

SLAVE=yes

BOOTPROTO=none

3. Edit the ifcfg-eth2 network card configuration file

Execute the command vi / etc/sysconfig/network-scripts/ifcfg-eth2, and modify the configuration file of the eth2 Nic in the following format:

DEVICE=eth2

USERCTL=no

ONBOOT=yes

MASTER=bond0

SLAVE=yes

BOOTPROTO=none

4. Modify configuration file / etc/modprobe.conf

Add the following to the configuration file:

Installbond0 / sbin/modprobe-an eth0 eth2 & & / sbin/modprobe bonding

Optionsbonding mode=1 miimon=100

5. Modify configuration file / etc/rc.d/rc.local

Add the following to the configuration file:

Ifenslavebond0 eth0 eth2

6. Execute the / etc/init.d/network restart command to restart the network for the configuration to take effect

7. Check whether the configuration is successful

Log in to the system as a root user and execute the command ifconfig to check whether there is a bond0 network card in the network card information, whether the eth0 and eth2 status are normal, and whether eth0, eth2 and bond0 use the same ip address.

Summary: after the dual network card is bound, be sure to check whether the switch connected by the dual network card has made aggregation. If the aggregation is not done, it will not be successful.

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

Servers

Wechat

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

12
Report