链路聚合,就是将两个网口的功能合并,比如eth0和eth1两个网口,合并之后,本来只有使用eth0才能实现的功能,使用eth1后也可以,他们的网速也会变成eth0的网速+eth1的网速;
#!/bin/bash
name=/etc/netplan/01-network-manager-all.yaml
#ip_netmask=$(grep addresses $name | grep /)
#gateway4=$(grep gateway4:$name)
bond=$(cat $name | grep "bonds")
bond_status=$?
#echo $bond_status
dhcp4=$(cat $name | grep "ethernets" -A 2 | grep "dhcp")
ip_netmask=$(cat $name | grepaddress | grep /)
gateway4=$(cat $name | grep gateway4)
gat_addresses=$(cat $name | grep "nameservers" -A 1 | grep "addresses")
name_1=$(cat $name | grep "interfaces" -A 1 | grep "-" | cut -d "-" -f 2 | cut -d " " -f 2)
name_2=$(cat $name | grep "parameters" -B 1 | grep "-" | cut -d "-" -f 2 | cut -d " " -f 2)
echo $name_1
echo $name_2
if [[ $name_1 = eno1 ]] && [[ $name_2 =