Ubuntu 16.04 双网卡bing
服务器经常有多个网卡,为了保证网络冗余性,一个网卡出现故障时,另外一张卡可以顶住,不导致网络服务中断。
1,安装依赖模块
sudo apt-get install ifenslave
echo "bonding" >>/etc/modules
2,修改网络配置
vim /etc/network/interfaces
auto bond0
iface bond0 inet static
address 192.168.3.121
netmask 255.255.255.0
bond-slaves none
bond-mode active-backup
bond-miimon 100
auto enp96s0f0
iface enp96s0f0 inet manual
bond-master bond0
bond-primary enp96s0f0 enp96s0f1
auto enp96s0f1
iface enp96s0f1 inet manual
bond-master bond0
bond-primary enp96s0f0 enp96s0f1
重启网卡或者重启服务器
/etc/init.d/networking restart
##测试 ,分别断开网卡,网络是否会中断