Linux ·

Ubuntu 16.04双网卡主备配置

前面一篇讲解了Ubuntu14.04双网卡主备配置,没成想变化总是这么快,今日安装某软件,提示最匹配的Ubuntu版本是16.04,作为一个码农能有什么办法,只能不断去适应变化、拥抱变化。

首先16.04的安装与14.04大致相同,个别地方稍有区别,如时区的选择以及默认软件的安装等,安装时需要注意。而且16.04的网卡名称比较怪异,同样需要注意。

其双网卡主备配置方式也基本与14.04相同,唯一的区别在/etc/network/interfaces中,现在假设两块网卡的名称分别为enp130s0f0和enp130s0f1,则需要向/etc/network/interfaces文件中添加以下信息:

auto enp130s0f0
iface enp130s0f0 inet manual
bond-master bond0

auto enp130s0f1
iface enp130s0f1 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 172.17.0.101
netmask 255.255.255.0
gateway 172.17.0.254
dns-nameservers 114.114.114.114
bond-slaves enp130s0f0 enp130s0f1
bond-lacp-rate 1
bond-mode 1
bond-miimon 100

并且不需要再向/etc/modules中写入内容。重启服务器后即可,其他不变。

参与评论