Files
microstack/snap-overlay/bin/setup-br-ex
Pete Vander Giessen 95efd789b4 Added snap configuration.
Moved openstack env variables out of snapcraft.yaml, and into a
"microtack.rc".

Made openstack-wrapper, which auto sources microstack.rc.

Key off of revised snap.openstack, which supports snapctl config
values in templates. Moved a lot of the overlay into
snap-overlay/templates, and added config values to them. Also writes
templates just once, when you run snap-openstack setup.

Change-Id: Ib0f2e3fc97f491d9ed9dfbafc61dc8e27a8a2b48
2019-07-25 16:37:51 +00:00

24 lines
615 B
Bash
Executable File

#!/bin/bash
#
# Oneshot daemon which creates a networking bridge.
#
# Creates br-ex, and sets up an ip address for it. We put this in a
# oneshot so that the ip address persists after reboot, without
# needing to add networking entries to the host system. (We want this
# to work well when we turn off classic confinement.)
set -ex
extcidr=$(snapctl get extcidr)
# Create external integration bridge
ovs-vsctl --retry --may-exist add-br br-ex
# Configure br-ex
ip address add $extcidr dev br-ex || :
ip link set br-ex up || :
sudo iptables -t nat -A POSTROUTING -s $extcidr ! -d $extcidr -j MASQUERADE
exit 0