8.10. Working with OpenStack Networking
This section describes the different procedures for using OpenStack Networking.
Note
If you have opted for Compute Networking by setting
CONFIG_NEUTRON_INSTALL to n, then refer to Section 8.9, “Working with Compute Networking”.
8.10.1. Creating an External Network
This section describes the steps to be followed for creating an external network.
Procedure 8.8. Creating a Network Using the Command Line Interface
- Use the
sourcecommand to load the credentials of the administrative user.$source ~/keystonerc_admin - Use the
net-createaction of theneutroncommand-line client to create a new provider network.The arguments passed to theneutron net-createcommand depend on whether you passed the valueproviderin the step Configuring OpenStack Networking in section Section 5.2, “Running PackStack Interactively” (or in theanswer fileif running PackStack non-interactively).Three options are available:- if using an external bridge, use:
$neutron net-create EXTERNAL_NAME \ --router:external True \ --provider:network_type local - if using a flat provider external network, use:
$neutron net-create EXTERNAL_NAME \ --router:external True \ --provider:network_type flat --provider:physical_network PHYSICAL_NAME - if using a VLAN provider external network, use:
$neutron net-create EXTERNAL_NAME \ --router:external True \ --provider:network_type vlan --provider:physical_network PHYSICAL_NAME --provider:segmentation_id VLAN_TAG
Replace these strings with the appropriate values for your environment:- Replace EXTERNAL_NAME with a name for the new external network provider.
- Replace PHYSICAL_NAME with a name for the physical network.
- Replace VLAN_TAG with the VLAN tag that will be used to identify network traffic. The VLAN tag specified must have been defined by the network administrator.
Take note of the unique external network identifier returned, this will be required in subsequent steps.Note
When creating a provider network of type flat or VLAN, the physical network PHYSICAL_NAME must be listed innetwork_vlan_rangeson the node whereneutron-serverruns. If the physical network is not listed, runningneutron net-createproduces an error:Unknown provider:physical_network.To specify the physical network, for example when using linuxbridge, use the command:$openstack-config --set /etc/neutron/plugin.ini \LINUX_BRIDGE network_vlan_ranges PHYSICAL_NAMEIn this instance, no ranges of VLAN tags are required. This makes the physical networks available for flat or VLAN provider networks without making VLANs on those physical networks available as tenant networks. - Use the
subnet-createaction of the command line client to create a new subnet for the new external provider network.$neutron subnet-create --gateway GATEWAY \--allocation-pool start=IP_RANGE_START,end=IP_RANGE_END \--disable-dhcp EXTERNAL_NAME EXTERNAL_CIDRReplace these strings with the appropriate values for your environment:- Replace GATEWAY with the IP address or hostname of the system that is to act as the gateway for the new subnet.
- Replace IP_RANGE_START with the IP address that denotes the start of the range of IP addresses within the new subnet that floating IP addresses will be allocated from.
- Replace IP_RANGE_END with the IP address that denotes the end of the range of IP addresses within the new subnet that floating IP addresses will be allocated from.
- Replace EXTERNAL_NAME with the name of the external network the subnet is to be associated with. This must match the name that was provided to the
net-createaction in the previous step. - Replace EXTERNAL_CIDR with the Classless Inter-Domain Routing (CIDR) representation of the block of IP addresses the subnet represents. An example would be
192.168.100.0/24.
Take note of the unique subnet identifier returned, this will be required in subsequent steps.Important
The IP address used to replace the string GATEWAY must be within the block of IP addresses specified in place of the EXTERNAL_CIDR string but outside of the block of IP addresses specified by the range started by IP_RANGE_START and ended by IP_RANGE_END.The block of IP addresses specifed by the range started by IP_RANGE_START and ended by IP_RANGE_END must also fall within the block of IP addresses specified by EXTERNAL_CIDR.