配置ubuntu 18 bonding
最近买了一台dell R510 二手服务器。发现后面有两个网口,只插一个有点浪费于是乎各种百度,Google。
终于让我找到了一个名词 “多网卡负载均衡”
Linux双网卡绑定实现就是使用两块网卡虚拟成为一块网卡,通俗点讲就是两块网卡具有相同的IP地址而并行链接聚合成一个逻辑链路工作。
操作步骤:
查看有没有bonding kernel module
modinfo bonding | head -n 3
内核加载bonding module
modprobe bonding
开机启动时加载bonding module
echo bonding > /etc/modules
配置/etc/network/interfaces
vi /etc/network/interfaces # 增加配置 auto eno1 iface eno1 inet manual bond-master bond0 bond-primary eno1 bond-mode 6 auto eno2 iface eno2 inet manual bond-master bond0 bond-primary eno2 bond-mode 6 auto bond0 iface bond0 inet static address 192.168.1.253 netmask 255.255.255.0 gateway 192.168.1.1 #broadcast 192.168.1.255 slaves eno1 eno2 bond-mode 6 bond-miimon 100 bond-downdelay 200 bond-updelay 200
- 增加
/etc/modprobe.d/aliases.conf
配置文件
alias bond0 bonding
options bonding mode=6 arp_interval=2000 arp_ip_target=192.168.1.1
重启网卡
/etc/init.d/networking restart
引用
1. https://www.kernel.org/doc/Documentation/networking/bonding.txt