bond配置与拆卸
bond配置
目的:配置链锯聚合bond目的-拓宽上联带宽,提升网速。
所需环境
一台有两张网卡(最少)的服务器
配置 bond0
vi /etc/sysconfig/network-scripts/ifcfg-bond0
配置bond0文件内为以下内容
DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.241.128
PREFIX=24
IPV6INIT=no
USERCTL=no
GATEWAY=192.168.241.2
# 配置bond0的ip为192.168.241.128
配置bond0聚合的网络eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0
配置bond0聚合的网络eth0为以下内容
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
MASTER=bond0
SLAVE=yes
#将eth0聚合到bond0
配置bond0聚合的网络eth1
vi /etc/sysconfig/network-scripts/ifcfg-eth1
配置bond0聚合的网络eth1为以下内容
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
MASTER=bond0
SLAVE=yes
#将eth1聚合到bond0
设置bonding参数
tail -2 /etc/modprobe.d/bond0.conf
添加以下内容到配置文件内
alias bond0 bonding
options bonding mode=0 miimon=100
重启网络服务
service network restart
bond拆卸
删除以下文件
rm -rf vi /etc/sysconfig/network-scripts/ifcfg-eth0
rm -rf /etc/modprobe.d/bond0.conf
修改eth0和eth1为所需要的静态/动态获取ip
重启网络服务
service network restart
重启服务器
reboot