#! /usr/bin/env bash # create the xml definitions. The br is prepended. # Add/remove interfaces if needed for interface in wan lan dmz do cat << EOF > br_$interface.xml br_$interface EOF done # uncomment this if you want to view your xml files but # not process them # exit # find all xml files and do the net-define for interface in `ls *.xml` do virsh net-define --file $interface done # since the bridge name is followed by xml, simply remove that # and set to autostart and start it for interface in `ls *.xml | cut -d'.' -f1` do virsh net-autostart $interface virsh net-start $interface done # show me the list of network names virsh net-list