Andy Bavier | 8cca347 | 2015-04-15 16:55:38 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Andy Bavier | 8d51c6c | 2015-04-01 11:40:22 -0400 | [diff] [blame] | 2 | |
Andy Bavier | 8cca347 | 2015-04-15 16:55:38 -0400 | [diff] [blame] | 3 | source ~/admin-openrc.sh |
Andy Bavier | 8d51c6c | 2015-04-01 11:40:22 -0400 | [diff] [blame] | 4 | |
| 5 | # Create nat-net network |
Andy Bavier | 8cca347 | 2015-04-15 16:55:38 -0400 | [diff] [blame] | 6 | neutron net-show nat-net 2>&1 > /dev/null |
Andy Bavier | 8d51c6c | 2015-04-01 11:40:22 -0400 | [diff] [blame] | 7 | if [ "$?" -ne 0 ] |
| 8 | then |
| 9 | neutron net-create --provider:physical_network=nat --provider:network_type=flat --shared nat-net |
| 10 | fi |
| 11 | |
| 12 | # Create nat-net subnet |
Andy Bavier | 8cca347 | 2015-04-15 16:55:38 -0400 | [diff] [blame] | 13 | neutron subnet-show nat-net 2>&1 > /dev/null |
Andy Bavier | 8d51c6c | 2015-04-01 11:40:22 -0400 | [diff] [blame] | 14 | if [ "$?" -ne 0 ] |
| 15 | then |
| 16 | neutron subnet-create nat-net --name nat-net 172.16.0.0/16 --gateway=172.16.0.1 --enable-dhcp=false |
| 17 | fi |
| 18 | |
| 19 | # Create nat-net network |
Andy Bavier | 8cca347 | 2015-04-15 16:55:38 -0400 | [diff] [blame] | 20 | neutron net-show ext-net 2>&1 > /dev/null |
Andy Bavier | 8d51c6c | 2015-04-01 11:40:22 -0400 | [diff] [blame] | 21 | if [ "$?" -ne 0 ] |
| 22 | then |
| 23 | neutron net-create --provider:physical_network=ext --provider:network_type=flat --shared ext-net |
| 24 | fi |
| 25 | |
| 26 | |