-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpost-configuration-openstack.sh
More file actions
66 lines (44 loc) · 1.54 KB
/
post-configuration-openstack.sh
File metadata and controls
66 lines (44 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
bgreen='\033[1;32m'
red='\033[0;31m'
nc='\033[0m'
bold="\033[1m"
blink="\033[5m"
echo -e "${bgreen}Configure Network in OpenStack ${nc} "
#Create OpenStack private Network.
openstack network create private
#Create subnet for private Network
openstack subnet create --network private \
--allocation-pool start=10.1.1.50,end=10.1.1.200 \
--dns-nameserver 8.8.8.8 --subnet-range 10.1.1.0/24 \
private_subnet
#Create a public network
openstack network create --provider-network-type flat \
--provider-physical-network extnet --external public
#Create subnet for public Network
echo -e "${bgreen}Create Subnet for Public Network ${nc} "
echo
read -p "LAN Network with CIDR (ex:192.168.x.x/24): " LAN_NETWORK
echo
read -p "DHCP-Pool Start IP: " START_IP
echo
read -p "DHCP-Pool End IP: " END_IP
echo
read -p "DNS Server: " DNS_SERVER
openstack subnet create --network public \
--allocation-pool start=$START_IP,end=$END_IP \
--no-dhcp --dns-nameserver $DNS_SERVER \
--subnet-range $LAN_NETWORK public_subnet
#Create a router and configure router interfaces
openstack router create --no-ha core-router
#Connect Interface with OpenStack Router
openstack router set --external-gateway public core-router
openstack router add subnet core-router private_subnet
ip netns show
#Upload Image on OpenStack Cloud
openstack image list
wget http://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
openstack image create --disk-format qcow2 \
--container-format bare --public \
--file jammy-server-cloudimg-amd64.img ubuntu
openstack image list