openstack-manuals/doc/install-guide/basic-install_network-operating.xml
Tom Fifield 8f7d1bd81a Starts install guide chapter for neutron, cleanups
This begins the install guide chapter for neutron,
and cleans up some sections from the guide that will
not be used even as references.

* hypervisor_selection - not relevant for the adventure
where the choice is done prior, and makes some difficult
value judgement statemtnts

* scripted ubuntu install - not the purpose of this guide
and old content that isn't helpful for the rewrite

* image-troubleshooting - empty section, belongs in
cloud-admin-guide anyway

* vnc-console - already in image_install

* identity_config_keystone - already better done in
individual sections

* install nova-volume - very dated content, already
in cinder install

* basic install files - no longer needed for reference

Change-Id: I1979eeba091c7118db7cc30ad7c66f30345fe49d
2013-10-15 15:22:51 +11:00

99 lines
5.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:id="basic-install_network-operating">
<title>Virtual Networking</title>
<section xml:id="create-networking">
<title>Create Virtual Networking</title>
<para>
<orderedlist>
<listitem>
<para>Create an <literal>openrc</literal> File</para>
<para>
<itemizedlist>
<listitem>
<para>Create a file called
<filename>~/openrc</filename>. This
file contains the OpenStack admin
credentials that are used when
interacting with the OpenStack
environment on the command line.
<programlisting language="bash">export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_AUTH_URL="http://10.10.10.10:5000/v2.0/"
export SERVICE_ENDPOINT="http://10.10.10.10:35357/v2.0"
export SERVICE_TOKEN=password</programlisting></para>
</listitem>
</itemizedlist>
</para>
<itemizedlist>
<listitem>
<para>Source the credentials into your environment:
<screen><prompt>$</prompt> <userinput>source ~/openrc</userinput></screen></para></listitem>
<listitem>
<para>
Configure the Bash shell to load these credentials upon each login:
<screen><prompt>$</prompt> <userinput>echo "source ~/openrc" >> ~/.bashrc</userinput></screen>
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>The following bash script creates an internal network for the "demo" project.
<programlisting language="bash">#!/bin/bash
TENANT_NAME="demo"
TENANT_NETWORK_NAME="demo-net"
TENANT_SUBNET_NAME="${TENANT_NETWORK_NAME}-subnet"
TENANT_ROUTER_NAME="demo-router"
FIXED_RANGE="10.5.5.0/24"
NETWORK_GATEWAY="10.5.5.1"
TENANT_ID=$(keystone tenant-list | grep " $TENANT_NAME " | awk '{print $2}')
TENANT_NET_ID=$(neutron net-create --tenant_id $TENANT_ID \
$TENANT_NETWORK_NAME --provider:network_type gre \
--provider:segmentation_id 1 | grep " id " | awk '{print $4}')
TENANT_SUBNET_ID=$(neutron subnet-create --tenant_id $TENANT_ID \
--ip_version 4 --name $TENANT_SUBNET_NAME $TENANT_NET_ID $FIXED_RANGE \
--gateway $NETWORK_GATEWAY --dns_nameservers list=true 8.8.8.8 | \
grep " id " | awk '{print $4}')
ROUTER_ID=$(neutron router-create --tenant_id $TENANT_ID \
$TENANT_ROUTER_NAME | grep " id " | awk '{print $4}')
neutron router-interface-add $ROUTER_ID $TENANT_SUBNET_ID</programlisting>
</para>
</listitem>
</orderedlist>
</para>
</section>
<section xml:id="configure-l3">
<title>L3 Configuration</title>
<para>The OpenStack Networking L3 service enables instances to have external network access. If this service is not configured, your instances
can only communicate with each other. Note that this configuration is highly dependant on your environment.
For example, make note of the <literal>subnet-create</literal> command below. You must verify your own network settings
for the external subnet (<literal>10.0.0.0/24</literal> in this case) as well as an allocation pool. The allocation pool
is used to provide each Project with an IP address to access the external network. The pool consists of 50 IPs and therefore
only 50 projects can get a gateway IP.</para>
<itemizedlist>
<listitem>
<para>Create an external network:
<screen><prompt>$</prompt> <userinput>neutron net-create public --router:external=True</userinput></screen>
</para>
</listitem>
<listitem>
<para>Create a subnet for the external network:
<screen><prompt>$</prompt> <userinput>neutron subnet-create --ip_version 4 \
--gateway 10.0.0.1 public 10.0.0.0/24 \
--allocation-pool start=10.0.0.200,end=10.0.0.250 --disable-dhcp \
--name public-subnet</userinput></screen>
</para>
</listitem>
<listitem>
<para>Set the gateway of the demo router to the public network:
<screen><prompt>$</prompt> <userinput>neutron router-gateway-set demo-router public</userinput></screen>
</para>
</listitem>
</itemizedlist>
</section>
</section>