4 # shellcheck disable=SC1091
6 # shellcheck disable=SC1091
9 if [ "$MANAGE_PRO_BRIDGE" == "y" ]; then
10 # Adding an IP address in the libvirt definition for this network results in
11 # dnsmasq being run, we don't want that as we have our own dnsmasq, so set
13 sudo brctl addbr provisioning
14 # sudo ifconfig provisioning 172.22.0.1 netmask 255.255.255.0 up
15 # Use ip command. ifconfig commands are deprecated now.
16 sudo ip addr add dev provisioning 172.22.0.1/24
17 sudo ip link set provisioning up
19 # Need to pass the provision interface for bare metal
20 if [ "$PRO_IF" ]; then
21 sudo brctl addif provisioning "$PRO_IF"
25 if [ "$MANAGE_INT_BRIDGE" == "y" ]; then
26 # Create the baremetal bridge
27 if ! [[ $(ip a show baremetal) ]]; then
28 sudo brctl addbr baremetal
29 # sudo ifconfig baremetal 192.168.111.1 netmask 255.255.255.0 up
30 # Use ip command. ifconfig commands are deprecated now.
31 sudo ip addr add dev baremetal 192.168.111.1/24
32 sudo ip link set baremetal up
35 # Add the internal interface to it if requests, this may also be the interface providing
36 # external access so we need to make sure we maintain dhcp config if its available
37 if [ "$INT_IF" ]; then
38 sudo brctl addif "$INT_IF"
42 # restart the libvirt network so it applies an ip to the bridge
43 if [ "$MANAGE_BR_BRIDGE" == "y" ] ; then
44 sudo virsh net-destroy baremetal
45 sudo virsh net-start baremetal
46 if [ "$INT_IF" ]; then #Need to bring UP the NIC after destroying the libvirt network