一、链路聚合
设置备用网卡,当其中一块损坏时,能保证服务器正常上网。
bond方式(支持2块)
nmcli connection delate eth0
配置两块网卡,删除ip
nmcli connection add con-name bond0 ifname bond0 type bond ip4 172.25.254.109/24
nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0
nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0
watch -n 1 'cat /proc/net/bonding/bond0'
team方式(最多支持8块)
nmcli connection add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.109/24
nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
nmcli connection add con-name eth1 ifname eth1 type team-slave master team0
watch -n 1 teamdctl team0 state
二、桥接
文件模式编辑
vim /etc/sysconfig/network-scripts/ifcfg-br0
DEVIECE=enp0s25
ONBOOT=yes
BOOTROTO=none
BRIDGE=br0
vim /etc/sysconfig/network-scripts/ifcfg-enp0s25
DEVICE=br0
ONBOOT=yes
BOOTROTO=none
TYPE=Bridge
IPADDR=172.25.254.9
PREFIX=24
命令模式编辑
brctl addbr br0
ifconfig br0 172.25.254.100 netmask 255.255.255.0
ping 172.25.254.250
brctl addif br0 eth0
brctl show
删除桥接
ifconfig br0 down
brctl delif br0 eth0
brctl delbr br0
brctl show