openstack-manuals/doc/install-guide/basic-install-files/basic-install_network-operating.xml
Diane Fleming 64b6c9261e Folder rename, file rename, flattening of directories
Current folder name	New folder name	        Book title
----------------------------------------------------------
basic-install 	        DELETE
cli-guide	        DELETE
common	                common
NEW	                admin-guide-cloud	Cloud Administrators Guide
docbkx-example	        DELETE
openstack-block-storage-admin 	DELETE
openstack-compute-admin 	DELETE
openstack-config 	config-reference	OpenStack Configuration Reference
openstack-ha 	        high-availability-guide	OpenStack High Availabilty Guide
openstack-image	        image-guide	OpenStack Virtual Machine Image Guide
openstack-install 	install-guide	OpenStack Installation Guide
openstack-network-connectivity-admin 	admin-guide-network 	OpenStack Networking Administration Guide
openstack-object-storage-admin 	DELETE
openstack-security 	security-guide	OpenStack Security Guide
openstack-training 	training-guide	OpenStack Training Guide
openstack-user 	        user-guide	OpenStack End User Guide
openstack-user-admin 	user-guide-admin	OpenStack Admin User Guide
glossary	        NEW        	OpenStack Glossary

bug: #1220407

Change-Id: Id5ffc774b966ba7b9a591743a877aa10ab3094c7
author: diane fleming
2013-09-08 15:15:50 -07: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>