Managing Networks 1528412461
Managing Networks 1528412461
Managing Networks
Contents
Scenario 1 1
Scenario 2 9
Review 11
Managing Networks Linux Academy + Cloud Assessments
For this lab, we are an OpenStack Administrator for the Acme Company. We are tasked with
creating a new external shared network. To make it, we will create a project called corporate
with a network named acme-int. Once created, we will attach a subnet named acme-int-subnet,
give it an IP range of 192.168.1.0/24, the name server 8.8.8.8, an allocation pool between
192.168.1.50 and 192.168.1.100, and the gateway 192.168.1.1. Finally, we will attach it to the
acme-ext network using a router named acme-rtr. We will do this two ways, from the command
line, and then using the OpenStack Dashboard.
Scenario 1
Before we begin, log in as the root user using the information provided:
With the information copied, we need to go into the adminrc.sh file and update its contents. To
do so, use your preferred editor:
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0
export OS_TENANT_NAME=”demo”
export OS_USERNAME=”demo”
export OS_PASSWORD=”openstack”
-1-
Managing Networks Linux Academy + Cloud Assessments
We need to change the OS_TENANT_NAME and OS_USERNAME values from demo to admin:
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0
export OS_TENANT_NAME=”admin”
export OS_USERNAME=”admin”
export OS_PASSWORD=”openstack”
Once updated, save the file and exit. Back on the command line, source the file:
Wonderful. Now we need to copy the id somewhere that we can get to later, as we’ll need it to
create our Network. From here on, this id will be referenced as $COPIED_ID.
-2-
Managing Networks Linux Academy + Cloud Assessments
We see six current roles, though the only one we want is the Member role. We need to give this
role to our demo user on our corporate project:
-3-
Managing Networks Linux Academy + Cloud Assessments
+---------------------------+------------------------------------+
| Field | Value |
+---------------------------+------------------------------------+
| admin_state_up | True |
| id | d81c31e6-6c4f-456b-b064-860c6b481d |
| mtu | 0 |
| name | acme-ext |
| port_security_enabled | True |
| provider:network_type | flat |
| provider:physical_network | default |
| provider:segmentation_id | |
| router:external | True |
| shared | True |
| status | ACTIVE |
| subnets | |
| tenant_id | $COPIED_ID |
+---------------------------+------------------------------------+
-4-
Managing Networks Linux Academy + Cloud Assessments
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0
export OS_TENANT_NAME=”demo”
export OS_USERNAME=”demo”
export OS_PASSWORD=”openstack”
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0
export OS_TENANT_NAME=”corporate”
export OS_USERNAME=”demo”
export OS_PASSWORD=”openstack”
Now that our file is set up to work with our corporate project, source the credrc.sh file:
-5-
Managing Networks Linux Academy + Cloud Assessments
With everything in place, we can now create our internal network. This network will be called
acme-int:
Note that not all of the information shown will match what we get back.
From here, we need to create the subnet for our internal network. For this network, we will
be setting up to a subnet. Use 8.8.8.8 as a nameserver, a gateway of 192.168.1.1, and the
allocation pool between 192.168.1.50 and 192.168.1.100 Name it acme-int-subnet, place it on
the acme-int network, and give it an IP range of 192.168.1.0/24:
+-------------------+--------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------+
| allocation_pools |{start:"192.168.1.50",end :"192.168.1.100"} |
| cidr | 192.168.1.0/24 |
| dns_nameservers | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 192.168.1.1 |
| host_routes | |
| id | f3396b05-7820-4ae3-904b-94206c2e878b |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | acme-int-subnet |
| network_id | e5ccf713-2ca8-421d-a5a3-dad0840e722a |
| subnetpool_id | |
| tenant_id | 6ce126c6838b4422bd93668b57cb2b3e |
+-------------------+--------------------------------------------+
Note that not all of the information shown will match your own.
-6-
Managing Networks Linux Academy + Cloud Assessments
With our subnet created, we need to create a router for it. We will name it acme-rtr:
Note that not all of the information shown will match your own.
Connect the router acme-rtr to the subnet acme-int-subnet with the neutron router-interface-add
command:
Lastly, we’ll connect our gateway to the router and external network:
With the interface removed, we can go through and delete the router:
-7-
Managing Networks Linux Academy + Cloud Assessments
With everything removed, we can delete the acme-ext network. But, before we can do that, we
need to source our admin credentials as only the admin user can delete a network:
With the network removed, we can start on our second scenario; making a network from the
OpenStack Dashboard.
-8-
Managing Networks Linux Academy + Cloud Assessments
Scenario 2
Using the information provided by the lab, sign in to OpenStack. We need to make sure we sign
in using admin and that we are in the demo project.
• Name: acme-ext
• Project: corporate
• Admin State: UP
With our network created, we can now create the other parts that will go with it.
Once logged in as the demo user, make sure we are in the corporate project at the top of the
page, not the demo project. Once in the correct project, select the Network drop-down, then
select Networks from the sidebar. On the page that opens, select Create Network.
-9-
Managing Networks Linux Academy + Cloud Assessments
Name the network acme-int, leave the Admin State as UP, and then select Next. For the next
section, enter the following:
• Name: acme-int-subnet
• Address: 192.168.1.0/24
• IP Version: IPv4
On the details page, enter the following: * Allocation Pools: 192.168.1.50,192.168.1.100 * DNS
Name Servers: 8.8.8.8
Select Create.
Once created, select acme-rtr from the router list. We are taken to a page with information over
the router. Here, select the Interfaces tab, and then select Add Interface. From the Subnet
dropdown, select our acme-int subnet. Leave the others as the default and then select Add
Interface.
With that all set up, select Network Topology from the sidebar. Here we can see how all of our
pieces fit together in a nodular map. Everything we did above can also be done from this page
by selecting a node. For example, selecting the acme-rtr node gives you the option to add an
interface.
- 10 -
Managing Networks Linux Academy + Cloud Assessments
To finish the cleanup process, we need to log out and then back in as the admin user. You can
only delete the Network as an admin.
Once signed in as the admin, select Networks from the sidebar. Check the box next to the
corporate network, and then select Delete Networks. The network will cease to exist.
Review
In this lab, we’ve managed to complete all sorts of networking tasks. From a command line,
we set up a user and manipulated credentials. After that, we created both internal and external
networks, then the routers, interfaces, and subrouters to get the two networks connected.
Finally, we got rid of the network pieces, cleaned up the networks, and then left the command
line altogether to set those pieces up again, but this time using the graphical front end. We now
have experience in both environments. Congratulations on completing the lab! Feel free to keep
practicing within the lab environment, as more time than needed to complete the lab has been
given.
- 11 -