Configuring Network in OpenStack
* Open openstack dashboard and login
* After successful login as the user admin you will end up in the admin view of the OpenStack Dashboard Horizon
* Click on the Network Topology tab within the Project area
Initially the Network Topology is empty, so we have to create a network for the VM’s
Here’s what we need at a base level:
1.An external (sometimes also called public) network that corresponds to the physical network segment providing us external connectivity.
2.An internal network per tenant to which we can attach VMs. These per tenant VM can use this internal network to communicate with each other. But also we don’t necessarily want to connect every VM to the outside world.
3.In order for the VMs, connected to the internal network, to reach the outside world (e.g. Internet) we also need a router providing Source NAT (SNAT) capability between internal and external network
* Return to the Admin view, choose the Networks tab and click on Create Network as below
Give the new network a useful name such as Enetwork and tick the External Network box to designate it as an external network. You need to specify a project when you create a new network. Yet, an external network will be visible from all projects. It therefore doesn’t really matter which project you assign this network to. A good project to pick is the service project, as it is a core part of OpenStack
* Next click on the network name – here Enetwork – to configure additional settings such as the subnet
Within the Network Detail view, click on Create Subnet to associate a subnet with this network
Give the Subnet as External and network address as 10.9.8.0/24 and gateway 10.9.8.249. Click on subnet Detail for next view
Unselect the Enable DHCP checkbox as this is an external network which either already has an existing DHCP service available, or on which you don’t want OpenStack to supply DHCP capabilities. Specify the Allocation pools specific to your environment with an IP range that is not already in use within the selected subnet. Specify the DNS Name Servers and click Create to finalize the creation of the subnet
Verify that the external network has been successfully created and is in the UP state
Return to the tenant’s view and see how the previously created external network will look like. Choose the Project view, then click on the Network Topology tab. You can see the external network available to the tenant
Next we will create the internal network. This task will be completed by the tenant within a project. Therefore still within project view, click on the Create Networks button in the above image
Enter internal as the Network Name and click on the Subnet to specify additional information as shown below
Specify a Subnet Name as Internal along with the Network Address as 192.168.1.0/24 and Click on Subnet Detail for next view
Enter the value of the DNS Name Server and finish the dialog with a click on Create
The result is now an external network, which was created and is owned by the cloud administrator and an internal network, which was created and is owned by a project tenant. But we are not done yet: If we connect a workload to the internal network, it will obviously not have outbound connectivity as internal and external network are not connected. We can fix this by creating a router between the two. Click on Create Router to get started
Give the Router a useful Router Name and finish the creation of the router with a click on Create Router
Next we need to create the router’s interfaces on the two networks. Click on the router and choose view router details to get started
Now click on Add Interface to add the internal interface first, As the Subnet choose the internal network that you created in an earlier step and click on Add interface to finish your selection
Next we need to configure the external network as the upstream network. This is done by setting the gateway for the router.
Click on the Routers tab to leave the Router Detail view
Under Actions for the router click on Set Gateway
As the External Network chose the network that is provided by the cloud operator and confirm the selection by clicking on Set Gateway
Return to the Network Topology view to see the result
Creating and Deploying a Virtual Machine
* From the Network Topology tab click on the Launch Instance button
Give the instance name as FirstInstance, Flavour as m1.tiny, Instance count as 1, Instance Boot source as “Boot from Image” and Image name as “myFirstImage” and click on Networking for next view
Move the network Internal from the Available networks pool to the Selected networks, by either clicking on the plus icon or using drag-and-drop and Click on Launch to finalize the creation of your VM instance.
Wait for the new VM instance to be created and powered up. Once the Status indicates Active and the Power State shows running, The VM is up. Click on the name of the VM to see the Instance Detail.
We can see information about the running VM instance – such as the ID, the status or the IP address. Click on the Console tab to connect to the VM
Click on the Console tab to connect to the VM
Via the Console you can access your VM instance, login to the server
Ping the external network IP to verify the Network