ubuntu之双网卡绑定bonding

1.系统版本

cat /etc/issue
Ubuntu 14.04.5 LTS \n \l

2.安装ifenslave软件

sudo  vim /etc/apt/sources.list
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
sudo  apt-get update
sudo apt-get install ifenslave

3.改配置文件

sudo vim /etc/modules
bonding mode=6 miimon=100
sudo modprobe bonding

4.更改interfaces

sudo vim /etc/network/interfaces
auto bond0
iface bond0 inet static
address 192.168.160.131
netmask 255.255.255.0
gateway 192.168.160.2
dns-nameservers 8.8.8.8

post-up ifenslave bond0 eth0 eth1
pre-down ifenslave -d bond0 eth0 eth1

5.重启服务器

sudo  reboot

6.查看结果

cat /proc/net/bonding/bond0

7.开启关闭bond

ifup bond0
ifdown bond0

参考:
https://help.ubuntu.com/community/UbuntuBonding

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: