vino/tools/deployment/configure-bridges.sh
Kostiantyn Kalynovskyi 2a4e42a29a Change ViNO networking model
Now vino has one special network for pxe booting and provisioning
this network is not connected anywhere and requests for boot source
are proxied to a URL specified in ViNO CR.

Other networks can be directly connected to the physical interface
specified in ViNO CR.

Change-Id: I7a3d98bbfc17b1fad9b425dbbb9051a850237be0
2021-06-02 19:35:24 +00:00

30 lines
746 B
Bash
Executable File

#!/bin/bash
set -xe
function create_bridge () {
if ! sudo brctl show| grep -q "${1}"; then
sudo brctl addbr "${1}"
sudo ip link set "${1}" up
sudo ip addr add ${2} dev "${1}"
fi;
}
VM_INFRA_BRIDGE=${VM_INFRA_BRIDGE:-"vm-infra"}
VM_INFRA_BRIDGE_IP=${VM_INFRA_BRIDGE_IP:-"192.168.2.1/24"}
VM_PXE_BRIDGE=${VM_PXE_BRIDGE:-"ironic-bridge"}
VM_PXE_BRIDGE_IP=${VM_PXE_BRIDGE_IP:-"172.3.3.1/24"}
PXE_NET="172.3.3.0/24"
export DEBCONF_NONINTERACTIVE_SEEN=true
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get install -y bridge-utils
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
create_bridge ${VM_INFRA_BRIDGE} ${VM_INFRA_BRIDGE_IP}
create_bridge ${VM_PXE_BRIDGE} ${VM_PXE_BRIDGE_IP}