A better DevStack network fix
diff --git a/xos/configurations/devel/Makefile b/xos/configurations/devel/Makefile
index cc2c1d9..eb5802a 100644
--- a/xos/configurations/devel/Makefile
+++ b/xos/configurations/devel/Makefile
@@ -4,7 +4,7 @@
cloudlab: common_cloudlab xos
-devstack: common_devstack devstack_net_fix xos
+devstack: upgrade_pkgs common_devstack devstack_net_fix xos
xos:
rm ../../xos_configuration/*
@@ -31,5 +31,8 @@
sudo docker exec -t -i $(RUNNING_CONTAINER) bash
devstack_net_fix:
- sudo bash -c "iptables -C nova-compute-sg-fallback -j ACCEPT || iptables -I nova-compute-sg-fallback 1 -j ACCEPT"
- sudo bash -c "iptables -t nat -C POSTROUTING -o eth0 -s 172.24.0.0/16 -j MASQUERADE || iptables -t nat -I POSTROUTING 1 -o eth0 -s 172.24.0.0/16 -j MASQUERADE"
+ sudo ../devstack/net-fix.sh
+ sudo bash -c "source ../common/admin-openrc.sh; neutron subnet-update private-subnet --dns-nameservers list=true 8.8.8.8 8.8.4.4"
+
+upgrade_pkgs:
+ sudo pip install httpie --upgrade
diff --git a/xos/configurations/devstack/local.conf b/xos/configurations/devstack/local.conf
index 946d16e..dfcf07b 100644
--- a/xos/configurations/devstack/local.conf
+++ b/xos/configurations/devstack/local.conf
@@ -3,6 +3,7 @@
DOWNLOAD_DEFAULT_IMAGES=false
IMAGE_URLS="http://www.planet-lab.org/cord/trusty-server-multi-nic.img"
+LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
disable_service n-net
enable_service q-svc
diff --git a/xos/configurations/devstack/net-fix.sh b/xos/configurations/devstack/net-fix.sh
new file mode 100755
index 0000000..5b486bd
--- /dev/null
+++ b/xos/configurations/devstack/net-fix.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+PRIMARY=$( route | grep default | awk '{print $NF}' )
+RULE="POSTROUTING -t nat -o $PRIMARY -s 172.24.4.0/24 -j MASQUERADE"
+
+iptables -C $RULE || iptables -A $RULE