1. 程式人生 > >CentOS7多網卡手動綁定

CentOS7多網卡手動綁定

lac nag 服務 bootp mct ethernet font bonding white

關閉NetworkManager:

systemctl stop NetworkManager


一、(mode0)輪詢模式:

[root@centos7 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
[root@centos7 network-scripts]# vi ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes


[root@centos7 network-scripts]# vi ifcfg-eth1

DEVICE=eth1

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

MASTER=bond0

SLAVE=yes


二、(mode1)主備模式:

[root@centos7 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


[root@centos7 network-scripts]# vi ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

MASTER=bond0

SLAVE=yes


[root@centos7 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


服務器側配置:

[root@centos7 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


[root@centos7 network-scripts]# vi ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

MASTER=bond0

SLAVE=yes


[root@centos7 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多網卡手動綁定