网卡阵列bond和team及网卡桥接配置

bond建立
 

nmcli connection show           ##查看存在的网卡
nmcli connection delete eth0    ##删除网卡
watch -n 1 cat /proc/net/bonding/bond0  ##监控
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.8.10/24                  ##绑定的是自己机器的IP
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 
nmcli connection show

##测试  用另一台机器ping你绑定的哪个ip ping通之后  执行ifconfig eth0 down 仍然畅通说明成功


在设置好之后先切换到另一台机器去ping  ping通之后在执行ifconfig eth0 down


team建立

watch -n 1 cat teamdctl team0 state   ##开启监控 
nmcli connection add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}' ip4 172.25.8.10/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
ping 刚才绑定的IP地址 ping通之后在IP对应的主机上执行ifconfig eth1 down如果还保持畅通表示成功 
ifconfig eth0 down
ifconfig eth0 up


网卡的桥接配置   真机IP: 172.25.8.250

 vim /etc/sysconfig/network-scripts/ifcfg-br0
 DEVICE=br0
 ONBOOT=yes
 BOOTPROTO=none
 TYPE=Bridge
 IPADDR=172.25.8.254
 NETMASK=255.255.255.0

 vim /etc/sysconfig/network-scripts/ifcfg-enp0s25
 DEVICE=enp0s25
 BOOTPROTO=none
 ONBOOT=yes
 BRIDGE=br0
 systemctl restart network

猜你喜欢

转载自blog.csdn.net/qq_41636653/article/details/81870173