Kylin操作系统双网卡bonding配置

绑定步骤:
1、安装ifenslave;
dpkg -i ifenslave_2.7kord1_all.deb

2
、在/etc/modules文件末行加入bonding,设置bonding模块开机自动加载

3、创建/etc/modprobe.d/bonding.conf, 命令vim /etc/modprobe.d/bonding.conf,内容如下:
options bonding mode=1 miimon=100
其中mode=1,表示主-备策略

4、加载bonding模块;
命令:sudo modprobe bonding
查看下是否加载成功
lsmod|grep bonding
配置bond0使用的网络接口
ifenslave bond0 enp1s0f0 enp1s0f1
5
、写入配置文件,可以直接替换interfaces文件,修改IP地址即可
vim /etc/network/interfaces
文件内容如下:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto enp1s0f0
iface enp1s0f0 inet manual
bond-master bond0

auto enp1s0f1
iface enp1s0f1 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 192.168.1.22
netmask 255.255.255.0
gateway 192.168.1.1
bond-slaves enp1s0f0 enp1s0f1
bond-mode 1
bond-miimon 100

auto enp1s0f2
iface enp1s0f2 inet static
address 192.168.1.111
netmask 255.255.255.128
gateway 192.168.1.1
# The primary network interface
8
、禁用图形化界面网卡
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service

7
、重启
命令reboot

你可能感兴趣的:(Kylin,linux,kylin,操作系统,网络,ethernet,负载均衡)