Centos7 multiple network card binding method

888u

Last update at :2024-07-08,Edit by888u

Recently, I encountered the need for dual network card binding at work, and found a lot of problems during the binding, so this article mainly introduces you to the dual network card binding and related problems in Centos 7. Friends who need it can refer to the relevant information. Let’s learn with the editor below.

1. Network card binding can be used as master and backup, and can be used for load balancing.

Second, the configuration process is to change the configuration files of the two network cards to be bound, create a new binding file bond, and set (or generate) the /etc/modprobe.d/bond.conf file

1. Change the configuration files of the two network cards #vim /etc/sysconfig/network-scripts/ifcfg-em1
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=em1
MASTER=bond0
SLAVE=yes
# vim /etc/sysconfig/network-scripts/ifcfg-em2
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=em2
MASTER=bond0
SLAVE=yes

2. Create a new ifcfg-bond0 file # vim /etc/sysconfig/network-scripts/ifcfg-bond0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=bond0
IPADDR=192.168.1.138
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
NM_CONTROLLED=no

3. Set up the /etc/modprobe.d/bond.conf file # vim /etc/modprobe.d/bond.conf
alias bond0 bonding
options bond0 miimon=100 mode=6

Note: After the setting was completed, I found an error when restarting the network card: "Job for network.service failed. See 'systemctl status network.service' and .... Finally, I found that a service NetworkManager service was not closed, so I closed the service. After systemctl stops NetworkManager, the network card can start normally.

Plug and unplug the network cables of the two network ports respectively and find that the network can be connected normally.

Recommended site searches: app server rental, free personal website server, high-defense server rental, Japanese proxy server IP, registration-free space, me domain name, website registration time, Korean cheap server, website IP address query, free website application domain name,

Centos7 multiple network card binding method

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码