-
-
Save anonymous/e3080eb529675aba7c1a89f79dace060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set +x | |
set -e | |
cd /home/vagrant/devstack || { echo "cannot cd into devstack dir"; exit 1; } | |
source openrc admin admin | |
set -x | |
neutron net-list | |
# Create an ssh key, if there is not one yet | |
if [[ ! -f id_rsa_demo ]]; then | |
nova keypair-add demo > id_rsa_demo | |
chmod 600 id_rsa_demo | |
fi | |
DEF_SG=$( neutron security-group-list -f value -c id -c name | grep default | head -1 | awk '{print $1}') | |
neutron security-group-rule-create --direction ingress --protocol icmp --remote-ip-prefix '0.0.0.0/0' ${DEF_SG} | |
neutron security-group-rule-create --direction ingress --protocol tcp --remote-ip-prefix '0.0.0.0/0' ${DEF_SG} | |
neutron router-create rtr | |
neutron net-create net1 | |
neutron subnet-create net1 10.1.0.0/24 --name subnet1 | |
neutron router-interface-add rtr subnet1 | |
neutron net-create net2 | |
neutron subnet-create net2 10.2.0.0/24 --name subnet2 | |
neutron router-interface-add rtr subnet2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment