From f035708c778e94ecbb76e4374c158c742e0e1df1 Mon Sep 17 00:00:00 2001
From: John-Paul Robinson <jpr@uab.edu>
Date: Mon, 10 Jun 2019 10:03:58 -0500
Subject: [PATCH] Add network create and delete scripts for openstack project

These scripts create standard dmz and cluster networks for
hosting the development cluster.
---
 network_create | 21 +++++++++++++++++++++
 network_delete | 14 ++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100755 network_create
 create mode 100755 network_delete

diff --git a/network_create b/network_create
new file mode 100755
index 0000000..c1af293
--- /dev/null
+++ b/network_create
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Create the dmz and cluster networks as the external and
+# internal networks of the ohpc cluster
+
+# create the dmz network for the head node to attach 
+openstack network create dmznet
+
+openstack subnet create --subnet-range 192.168.100.0/24 --dns-nameserver 8.8.8.8 --network dmznet dmzsubnet
+
+# connect dmz to the internet
+openstack router create borderrouter
+
+openstack router set borderrouter --external-gateway bright-external-flat-externalnet
+
+openstack router add subnet borderrouter dmzsubnet
+
+# create the cluster network for the compute nodes
+openstack network create clusternet
+
+openstack subnet create --subnet-range 10.1.1.0/24 --no-dhcp --network clusternet clustersubnet
diff --git a/network_delete b/network_delete
new file mode 100755
index 0000000..b6b62c4
--- /dev/null
+++ b/network_delete
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# delete the dmz and cluster networks as the external and
+# internal networks of the ohpc cluster
+
+# delete the dmz network for the head node to attach 
+openstack router remove subnet borderrouter dmzsubnet
+openstack network delete dmznet
+
+# remove connect dmz to the internet
+openstack router delete borderrouter
+
+# delete the cluster network for the compute nodes
+openstack network delete clusternet
-- 
GitLab