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 ip link add dev provisioning type bridge
14 sudo ip addr add dev provisioning 172.22.0.1/24
15 sudo ip link set provisioning up
17 # Need to pass the provision interface for bare metal
18 if [ "$PRO_IF" ]; then
19 sudo ip link set dev "$PRO_IF" master provisioning
23 if [ "$MANAGE_INT_BRIDGE" == "y" ]; then
24 # Create the baremetal bridge
25 if ! [[ $(ip a show baremetal) ]]; then
26 sudo ip link add dev baremetal type bridge
27 sudo ip addr add dev baremetal 192.168.111.1/24
28 sudo ip link set baremetal up
31 # Add the internal interface to it if requests, this may also be the interface providing
32 # external access so we need to make sure we maintain dhcp config if its available
33 if [ "$INT_IF" ]; then
34 sudo ip link set dev "$INT_IF" master baremetal
38 # restart the libvirt network so it applies an ip to the bridge
39 if [ "$MANAGE_BR_BRIDGE" == "y" ] ; then
40 sudo virsh net-destroy baremetal
41 sudo virsh net-start baremetal
42 if [ "$INT_IF" ]; then #Need to bring UP the NIC after destroying the libvirt network
43 sudo ip link set dev "$INT_IF" up