Skip to content

Instantly share code, notes, and snippets.

@jhershberg
Last active September 20, 2016 01:56
Show Gist options
  • Save jhershberg/ebbc4e3b63cae7a01c7981c4f4a919db to your computer and use it in GitHub Desktop.
Save jhershberg/ebbc4e3b63cae7a01c7981c4f4a919db to your computer and use it in GitHub Desktop.
for provider post. script for creating external provider network
echo create the external network...
neutron net-create --provider:network_type flat --provider:physical_network joshnet --router:external EXTNET
echo create the external network's subnet including this subnet's gateway...
neutron subnet-create EXTNET --name EXTSUB --allocation-pool start=10.11.12.20,end=10.11.12.30 10.11.12.0/24 --gateway 10.11.12.1
echo create the internal network...
neutron net-create INTNET
echo create the internal network's subnet
neutron subnet-create INTNET --name S1 --allocation-pool start=192.168.2.100,end=192.168.2.120 192.168.2.0/24
echo create the router...
neutron router-create ROUTER
echo define the router's gateway as the external network...
neutron router-gateway-set ROUTER EXTNET
echo add a leg for the internal network to the router...
neutron router-interface-add ROUTER S1
echo create add a VM on the internal network...
nova boot --image cirros-0.3.4-x86_64-uec --nic net-id=$(neutron net-list | awk "/INTNET/ {print \$2}") --flavor m1.nano vm_left --availability-zone nova:control
echo add a floating IP for the VM
nova floating-ip-create EXTNET
nova floating-ip-associate vm_left $(nova floating-ip-list | awk '/EXTNET/ {print $4}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment