配置bond接口文件
注意:做bond之前先将网卡配置文件备份
网卡: 2块
a.去到配置文件目录
1 | [root@ela2 ~]# cd /etc/sysconfig/network-scripts/
2 | [root@ela2 network-scripts]# vim ifcfg-bond0
DEVICE=bond0
TYPE=Ethernet0
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=x.x.x.x
PREFIX=24
IPV6INIT=no
USERCTL=no
GATEWAY=x.x.x.1
3 | [root@ela2 network-scripts]# vim ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
MASTER=bond0
SLAVE=yes
4 | [root@ela2 network-scripts]# vim ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
MASTER=bond0
SLAVE=yes
2.bonding 参数
[root@ela2 ~]# vim /etc/modprobe.d/bond0.conf
alias bond0 bonding
options bonding mode=0 miimon=100
3.重启网络服务
[root@ela2 ~]# systemctl restart network
4.查看网卡的速率
1 | ethtool bond0
Settings for bond0:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 2000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes
5、解除Bond0
a.删除bondind参数
1 | cd/etc/modprobe.d/
2 | rm -rf bond0.conf
b.删除bond的配置文件
1 | cd /etc/sysconfig/network-scripts/
2 | rm -rf ifcfg-bond0
c.还原网卡的配置文件
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
NAME=“eth0”