1、查看环境

ip a |grep -v lo

2、加载bonding模块

modprobe bonding

3、开机自动加载模块到内核

echo 'modprobe bonding &> /dev/null' >> /etc/rc.local

4、创建虚拟网卡配置

vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.10.3.231
BROADCAST=10.10.3.255
NETMASK=255.255.255.0
GATEWAY=10.10.3.1
TYPE=Ethernet

5、修改真实网卡配置

vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
TYPE=Ethernet

6、编辑模块载入配置文件,让系统支持bonding

vi /etc/modprobe.d/bonding.conf
alias bond0 bonding
options bond0 miimon=100 mode=6

7、编辑/etc/rc.local文件,加入如下内容,在系统启动时将虚拟网卡和两张物理网卡相绑定

vi /etc/rc.local
ifenslave bond0 eth0 eth1

8、重启network

service network restart
ip a |grep -v lo

 


 

相关文章:

  • 2019-08-01
  • 2021-08-13
  • 2021-07-07
  • 2021-08-31
  • 2021-11-09
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
猜你喜欢
  • 2021-10-06
  • 2021-08-25
  • 2022-12-23
  • 2021-12-02
  • 2021-10-31
  • 2021-06-21
  • 2021-09-29
相关资源
相似解决方案