CentOS7多网卡手动绑定

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7多网卡手动绑定相关的知识,希望对你有一定的参考价值。

关闭NetworkManager:

systemctl stop NetworkManager


一、(mode0)轮询模式:

[[email protected] network-scripts]# vi ifcfg-bond0 
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
BONDING_OPTS="mode=0 miimon=100"
BONDING_MASTER=yes
[[email protected] network-scripts]# vi ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes


[[email protected] network-scripts]# vi ifcfg-eth1

DEVICE=eth1

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

MASTER=bond0

SLAVE=yes


二、(mode1)主备模式:

[[email protected] network-scripts]# vi ifcfg-bond0 

DEVICE=bond0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

BONDING_OPTS="mode=1 miimon=100"

BONDING_MASTER=yes


[[email protected] network-scripts]# vi ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

MASTER=bond0

SLAVE=yes


[[email protected] network-scripts]# vi ifcfg-eth1

DEVICE=eth1

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

MASTER=bond0

SLAVE=yes


三、(mode2)802.3ad,LACP模式:


华为交换机侧配置:

interface gigabit0/1

   eth-trunk 14

interface gigabit0/1

   eth-trunk 14


interface Eth-Trunk14

 description link-to-centos-server-bond0

 port default vlan 10

 mode lacp


服务器侧配置:

[[email protected] network-scripts]# vi ifcfg-bond0 

DEVICE=bond0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

BONDING_OPTS="mode=802.3ad miimon=100 lacp_rate=fast"

BONDING_MASTER=yes


[[email protected] network-scripts]# vi ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

MASTER=bond0

SLAVE=yes


[[email protected] network-scripts]# vi ifcfg-eth1

DEVICE=eth1

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

MASTER=bond0

SLAVE=yes


检查bond状态:

cat /proc/net/bonding/bond0


以上是关于CentOS7多网卡手动绑定的主要内容,如果未能解决你的问题,请参考以下文章

linux 7 网卡绑定

Centos7多网卡绑定bond快速实践

centos7-bond多网卡绑定

CentOS7多网卡绑定之team

服务器设置多网卡绑定!!!

centos7.2的双网卡怎么绑定