0% found this document useful (0 votes)
29 views6 pages

LM11

open stack essentials

Uploaded by

Eugene Berna I
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views6 pages

LM11

open stack essentials

Uploaded by

Eugene Berna I
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Creating a network

Now that we've explored some of the intricacies of what's happening under the hood, let's
actually use Neutron to create a network by performing the following steps:

1. Log in to your control node and source your keystonerc file; use the non-
administrative user for this. The command to create a virtual network is:

2. control# neutron net-create internal

3. control# neutron subnet-create internal 192.168.37.0/24

That's it. You just created a virtual network. I know that for the length of the
introduction we just covered, that was pretty anticlimactic. Note that when you
create the subnet, you're adding it to the network named internal that you just
created. The final argument to the subnet-create command is the Classless
Inter-Domain Routing (CIDR) notation. I'm not going to spend time on the
CIDR notation here. You'll have to search the internet for an explanation of it.
There are plenty of good ones. Also, search for the CIDR calculator; there are
plenty of CIDR calculators on the Internet too.
NOTE

Here are a couple of examples of CIDR calculators:

 http://jodies.de/ipcalc
 http://www.subnet-calculator.com/cidr.php
In a CIDR calculator, you can type in the CIDR mentioned earlier and it will give
you the usable IP range that it signifies. The CIDR that I've
used, 192.168.37.0/24, identifies a range of IP addresses
from 192.168.37.1 to 192.168.37.254 with 192.168.37.255 as the broadcast
address. This means that we can allocate IP addresses in this range for things on
our network.
4. Next, let's list the network that we just created; you can also list the subnet. Here's
how:

5. control# neutron net-list

6. control# neutron subnet-list

The subnet could have been created with a name. If it was, we could have updated
it by referring to its name. Since one wasn't passed, the subnet's ID will have to be
used as follows:

control# neutron subnet-create internal 192.168.37.0/24 –name


internal_subnet
7. Let's update the subnet by adding a Domain Name System (DNS) name server.
The properties of a subnet and a network can be passed at the time of creation or
updated later. Refer to the Neutron command-line help for more details. Here's
how we update the subnet by adding a DNS name:

8. control# neutron subnet-update {subnet-id-hash} --dns-nameservers


list=true 8.8.8.7 8.8.8.8

In Chapter 3, Image Management, we mentioned cloud-init. Cloud-init is the


service that runs when an instance is booted and connects back
to 169.254.169.254 to get metadata. SSH keys and post-boot scripts are two
examples of what can be provided via metadata. This IP address is provided by a
Neutron router and proxies the call from cloud-init to the metadata service. In that
case, we need a router.
9. Let's create one and add the internal network as an interface to it:

10. control# neutron router-create my_router

11. control# neutron router-interface-add my_router {subnet-id-hash}

Here again, had we passed the --name argument and given the subnet a name,
we could have used that name instead of the subnet ID. Now that the router has
been created and attached to the subnet, the instances on this network will be able
to talk to the metadata service on boot.
Web interface management
The web interface lets you create the network and subnet in the same dialog. Perform the
following steps to obtain a network and a router:

1. Log in as your non-administrative user, select the Network menu, select


the Networks submenu, and click on the Create Network button in the top-right
corner, as shown here:
2. After you have filled in the network name, go to the next dialog screen and fill in
the subnet information, as shown in the following screenshot:

3. On the final dialog box add the DNS entries, as shown in the following
screenshot:
4. When you've completed filling in the dialog, you'll end up with a network and
a subnet that's associated with the network, as shown in the following screenshot:

5. Next, create the router. Select Routers from the Network menu, and click
on Create Router in the top-right corner of the page, as shown in the following
screenshot:

6. Once you've filled in the router name, click on Create Router, as shown in the
following screenshot:
7. Next, click on the router's name and click on the Add interface button in the top-
right corner, as shown in the following screenshot:

8. Select the subnet on the network you created and add it as an interface to the
router. Once the router has been created, there will be a success message in the
upper-right corner, as shown in the following screenshot:

Now that we have a network and a router available, an instance can be launched and attached
to the network. When the launched instance runs cloud-init, it will be able to connect to
the metadata service via the router. We'll launch the first instance when we get to Chapter
6, Instance Management. Before we do that, we have a little more networking to set up.

You might also like