当前位置: 首页 > 工具软件 > Bond > 使用案例 >

服务器做bond的方法

尹超
2023-12-01

# 服务器做bond

## 假如eth1、eth2、eth0做bond0.配置如下

### salve子接口配置

#### /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE="eth1"
USERCTL="no"
MASTER="bond0"
SLAVE="yes"
ONBOOT="yes"
NM_CONTROLLED="no"
HWADDR="e8:61:1f:24:a4:9d"
TYPE="Ethernet"

#### /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE="eth2"
USERCTL="no"
MASTER="bond0"
SLAVE="yes"
ONBOOT="yes"
NM_CONTROLLED="no"
HWADDR="e8:61:1f:24:a4:87"
TYPE="Ethernet"

#### /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
USERCTL="no"
MASTER="bond0"
SLAVE="yes"
ONBOOT="yes"
NM_CONTROLLED="no"
HWADDR="e8:61:1f:24:a4:86"
TYPE="Ethernet"

### bond接口配置

#### /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE="bond0"
BOOTPROTO="static"
IPADDR="10.21.10.17"
NETMASK="255.255.254.0"
MTU="1500"
ONBOOT="yes"
NM_CONTROLLED="no"
USERCTL="no"
BONDING_OPTS="mode=0 miimon=1000"

### 路由配置

#### /etc/sysconfig/network-scripts/route-bond0

ADDRESS0="10.0.0.0"
NETMASK0="255.0.0.0"
GATEWAY0="10.21.11.254"

##### 请注意如果是外网做bond直接把GATEWAY=x.x.x.x写到ifcfg-bond0下就可以了,不用再建立route-bond0了

### 依赖相关

##### 请注意如果是centos6.x的系统做bond需注销/etc/modprobe.d/modprobe.conf中的ipv6那一行,可用如下命令

sed -i -e '/install ipv6/d'  /etc/modprobe.d/modprobe.conf 

##### 如果是centos7.x的系统做bond需关闭NetworkManager  可用如下命令

chkconfig NetworkManager off
service NetworkManager stop

### 重启网络加载bond

modprobe bonding& service network restart  

 类似资料: