Skip to content

Commit dc7d1a8

Browse files
author
scrungus
committed
VM internet connectivity
1 parent fc6798e commit dc7d1a8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

etc/kayobe/ansible/scripts/aio-init.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,9 @@ if ! $KOLLA_OPENSTACK_COMMAND flavor list | grep -q m1.tiny; then
139139
$KOLLA_OPENSTACK_COMMAND flavor create --id 5 --ram 16384 --disk 160 --vcpus 8 m1.xlarge
140140
fi
141141

142+
# Configure IP routing and NAT to allow VMs to reach the outside world
143+
iface=$(ip route | awk '$1 == "default" {print $5; exit}')
144+
sudo iptables -A POSTROUTING -t nat -o $iface -j MASQUERADE
145+
sudo sysctl -w net.ipv4.conf.all.forwarding=1
146+
142147
touch /tmp/.init-runonce

0 commit comments

Comments
 (0)