#!/usr/bin/bash < /etc/sysconfig/network-scripts/ifcfg-br0 </{print $2}' | awk -F'/' '{print $1}') GATEWAY=$(ip r show dev ${INTERFACE_NAME} | awk '/default/{print $3}') PREFIX=$(ip a show dev ${INTERFACE_NAME} | awk '/\/{print $2}' | awk -F'/' '{print $2}') DNS1=114.114.114.114 DNS2=8.8.8.8 EOF cat > /etc/sysconfig/network-scripts/ifcfg-${INTERFACE_NAME} <> /etc/sysctl.conf && sysctl -p systemctl enable libvirtd --now brctl stp br0 on color Success "安装并启动完成" systemctl restart network } main