22 lines
598 B
Bash
Executable File
22 lines
598 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
|
|
|
|
# Create external integration bridge
|
|
ovs-vsctl --retry --may-exist add-br br-ex
|
|
|
|
# Configure br-ex
|
|
ip address add 10.20.20.1/24 dev br-ex || :
|
|
ip link set br-ex up || :
|
|
|
|
sudo iptables -t nat -A POSTROUTING -s 10.20.20.1/24 ! -d 10.20.20.1/24 -j MASQUERADE
|
|
|
|
exit 0
|