1.bond
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.124/24 ##添加主动备份模式的bond0,ip4为172.25.254.124
nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0
watch -n 1 cat /proc/net/bonding/bond0
然后 ifconfig eth0 down ##断开eth0
eth1会接替eth0,并且网络始终没有断开
2.team
1).team也是链路聚合的一种方式,最多支持8块网卡
支持模式
broadcast 广播容错
roundrobin 轮询
activebackup 主备
loadbalance 负载均衡
2).配置
nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.124/24 ##建立team网络接口
nmcli connection add con-name eth0 ifname eth0 type team-slave master team0 ##建立网卡eth0
nmcli connection add con-name eth1 ifname eth1 type team-slave master team0 ##建立网卡eth1
3).测试
watch -n 1 teamdctl team0 stat
ifconfig
ifconfig eth0 up
3.网络桥接
root权限下
cd /etc/sysconfig/network-scripts/
mv ifcfg-enp0s25 ifcfg-br0 /mnt ##备份
DEVICE=enp0s25
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.25.254.24
NETMASK=255.255.255.0
systemctl stop NetworkManager.service
systemctl restart network
配置方式
vim /etc/sysconfig/network-scripts/ifcfg-enp0s25
DEVICE=enp0s25 ##设备名称
ONBOOT=yes ##开启服务设备自动激活
BOOTPROTO=none ##网卡工作状态
BRIDGE=br0 ##网卡开启的网络接口
vim /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.25.254.24
NETMASK=255.255.255.0
TYPE=Bridge ##网络接口类型是桥接
systemctl stop NetworkManager.service
systemctl restart network
systemctl start NetworkManager
ifconfig查看可以看到br0,然后安装虚拟机速度加快
4.命令管理方式
1).添加
systemctl stop NetworkManager
brctl show
brctl addbr br0 ##添加网桥br0
brctl addif br0 eth0 ##给网桥添加网卡eth0
ifconfig eth0 up ##开启网卡eth0
ifconfig br0 172.25.254.124 netmask 255.255.255.0
brctl show ##查看网桥配置
ping 172.25.254.24
ifconfig br0 down ##关闭网桥
brctl delif br0 eth0 ##删除br0网桥重的eth0网卡
brctl delbr br0 ##删除网桥br0
brctl show