Chapter 5. Networking

OpenStack Networking (neutron) is the software-defined networking component of RHEL OpenStack Platform. The virtual network infrastructure enables connectivity between instances and the physical external network.

5.1. Manage Network Resources

Add and remove OpenStack Networking resources such as subnets and routers to suit your RHEL OpenStack Platform deployment.

5.1.1. Add a Network

Create a network to give your instances a place to communicate with each other and receive IP addresses using DHCP.
A network can also be integrated with external networks in your RHEL OpenStack Platform deployment or elsewhere, such as the physical network. This integration allows your instances to communicate with, and be reachable by, outside systems. To integrate your network with your physical external network, see Section 5.3, “Bridge the physical network”.
When creating networks, it is important to know that networks can host multiple subnets. This is useful if you intend to host distinctly different systems in the same network, and would prefer a measure of isolation between them. For example, you can designate that only webserver traffic is present on one subnet, while database traffic traverse another. Subnets are isolated from each other, and any instance that wishes to communicate with another subnet must have their traffic directed by a router. Consider placing systems that will require a high volume of traffic amongst themselves in the same subnet, so that they don't require routing, and avoid the subsequent latency and load.

5.1.1.1. Create a Network

  1. In the dashboard, select Project > Network > Networks.
  2. Click +Create Network.
  3. Specify the following:
    Field Description
    Network Name
    Descriptive name, based on the role that the network will perform. If you are integrating the network with an external VLAN, consider appending the VLAN ID number to the name. Examples:
    • webservers_122, if you are hosting HTTP web servers in this subnet, and your VLAN tag is 122.
    • internal-only, if you intend to keep the network traffic private, and not integrate it with an external network.
    Admin State Controls whether the network is immediately available. This field allows you to create the network but still keep it in a Down state, where it is logically present but still inactive. This is useful if you do not intend to enter the network into production right away.
  4. Click the Next button, and specify the following in the Subnet tab:
    Field Description
    Create Subnet Determines whether a subnet is created. For example, you might not want to create a subnet if you intend to keep this network as a placeholder without network connectivity.
    Subnet Name Descriptive name.
    Network Address Address in CIDR format, which contains the IP address range and subnet mask in one value. To determine the address, calculate the number of bits masked in the subnet mask and append that value to the IP address range. For example, the subnet mask 255.255.255.0 has 24 masked bits. To use this mask with the IPv4 address range 192.168.122.0, specify the address 192.168.122.0/24.
    IP Version
    Internet protocol, where valid types are IPv4 or IPv6. The IP address range in the Network Address field must match whichever version you select.
    Gateway IP IP address of the router interface for your default gateway. This address is the next hop for routing any traffic destined for an external location, and must be within the range specified in the Network Address field. For example, if your CIDR network address is 192.168.122.0/24, then your default gateway is likely to be 192.168.122.1.
    Disable Gateway Disables forwarding and keeps the network isolated.
  5. Click Next to specify DHCP options:
    Field Description
    Enable DHCP Enables DHCP services for this subnet. DHCP allows you to automate the distribution of IP settings to your instances.
    IPv6 Address Configuration Mode
    If creating an IPv6 network, specifies how IPv6 addresses and additional information are allocated:
    • No Options Specified - Select this option if IP addresses are set manually, or a non OpenStack-aware method is used for address allocation.
    • SLAAC (Stateless Address Autoconfiguration) - Instances generate IPv6 addresses based on Router Advertisement (RA) messages sent from the OpenStack Networking router. This configuration results in an OpenStack Networking subnet created with ra_mode set to slaac and address_mode set to slaac.
    • DHCPv6 stateful - Instances receive IPv6 addresses as well as additional options (for example, DNS) from OpenStack Networking DHCPv6 service. This configuration results in a subnet created with ra_mode set to dhcpv6-stateful and address_mode set to dhcpv6-stateful.
    • DHCPv6 stateless - Instances generate IPv6 addresses based on Router Advertisement (RA) messages sent from the OpenStack Networking router. Additional options (for example, DNS) are allocated from the OpenStack Networking DHCPv6 service. This configuration results in a subnet created with ra_mode set to dhcpv6-stateless and address_mode set to dhcpv6-stateless.
    Allocation Pools
    Range of IP addresses you would like DHCP to assign. For example, the value 192.168.22.100,192.168.22.100 considers all 'up' addresses in that range as available for allocation.
    DNS Name Servers
    IP addresses of the DNS servers available on the network. DHCP distributes these addresses to the instances for name resolution.
    Host Routes
    Static host routes. First specify the destination network in CIDR format, followed by the next hop that should be used for routing. For example: 192.168.23.0/24, 10.1.31.1
    Provide this value if you need to distribute static routes to instances.
  6. Click Create.
The completed network is available for viewing in the Networks tab. You can also click Edit to change any options as needed. Now when you create instances, you can configure them now to use its subnet, and they will subsequently receive any specified DHCP options.

5.1.1.2. Create an Advanced Network

Advanced network options are available for administrators, when creating a network from the Admin view. These options define the network type to use, and allow tenants to be specified:
  1. In the dashboard, select Admin > Networks > Create Network > Project.
  2. Select a destination project to host the new network using Project.
  3. Review the options in Provider Network Type:
    • Local - Traffic remains on the local Compute host and is effectively isolated from any external networks.
    • Flat - Traffic remains on a single network and can also be shared with the host. No VLAN tagging or other network segregation takes place.
    • VLAN - Create a network using a VLAN ID that corresponds to a VLAN present in the physical network. Allows instances to communicate with systems on the same layer 2 VLAN.
    • GRE - Use a network overlay that spans multiple nodes for private communication between instances. Traffic egressing the overlay must be routed.
    • VXLAN - Use a network overlay that spans multiple nodes for private communication between instances. Traffic egressing the overlay must be routed.
  4. Click Create Network, and review the Project's Network Topology to validate that the network has been successfully created.

5.1.1.3. Add Network Routing

To allow traffic to be routed to and from your new network, you must add its subnet as an interface to an existing virtual router:
  1. In the dashboard, select Project > Network > Routers.
  2. Click on your virtual router's name in the Routers list, and click +Add Interface.
  3. In the Subnet list, select the name of your new subnet.
  4. You can optionally specify an IP address for the interface in this field.
  5. Click Add Interface.
Instances on your network are now able to communicate with systems outside the subnet.

5.1.2. Delete a Network

There are occasions where it becomes necessary to delete a network that was previously created, perhaps as housekeeping or as part of a decommisioning process. In order to successfully delete a network, you must first remove or detach any interfaces where it is still in use. The following procedure provides the steps for deleting a network in your project, together with any dependent interfaces.
  1. In the dashboard, select Project > Network > Networks.
  2. Remove all router interfaces associated with the target network's subnets. To remove an interface:
    1. Find the ID number of the network you would like to delete by clicking on your target network in the Networks list, and looking at the its ID field. All the network's associated subnets will share this value in their Network ID field.
    2. Select Project > Network > Routers, click on your virtual router's name in the Routers list, and locate the interface attached to the subnet you would like to delete. You can distinguish it from the others by the IP address that would have served as the gateway IP. In addition, you can further validate the distinction by ensuring that the interface's network ID matches the ID you noted in the previous step.
    3. Click the interface's Delete Interface button.
  3. Select Project > Network > Networks, and click the name of your network. Click the target subnet's Delete Subnet button.
    Note
    If you are still unable to remove the subnet at this point, ensure it is not already being used by any instances.
  4. Select Project > Network > Networks, and select the network you would like to delete.
  5. Click Delete Networks in this and the next dialog screen.

5.1.3. Create a Subnet

Subnets are the means by which instances are granted network connectivity. Each instance is assigned to a subnet as part of the instance creation process, therefore it's important to consider proper placement of instances to best accomodate their connectivity requirements. Subnets are created in pre-existing networks.
Remember that tenant networks in OpenStack Networking can host multiple subnets. This is useful if you intend to host distinctly different systems in the same network, and would prefer a measure of isolation between them. For example, you can designate that only webserver traffic is present on one subnet, while database traffic traverse another. Subnets are isolated from each other, and any instance that wishes to communicate with another subnet must have their traffic directed by a router. Consider placing systems that will require a high volume of traffic amongst themselves in the same subnet, so that they don't require routing, and avoid the subsequent latency and load.

Procedure 5.1. Create a new subnet

  1. In the dashboard, select Project > Network > Networks, and click your network's name in the Networks view.
  2. Click Create Subnet, and specify the following.
    Field Description
    Subnet Name Descriptive subnet name.
    Network Address Address in CIDR format, which contains the IP address range and subnet mask in one value. To determine the address, calculate the number of bits masked in the subnet mask and append that value to the IP address range. For example, the subnet mask 255.255.255.0 has 24 masked bits. To use this mask with the IPv4 address range 192.168.122.0, specify the address 192.168.122.0/24.
    IP Version
    Internet protocol, where valid types are IPv4 or IPv6. The IP address range in the Network Address field must match whichever version you select.
    Gateway IP IP address of the router interface for your default gateway. This address is the next hop for routing any traffic destined for an external location, and must be within the range specified in the Network Address field. For example, if your CIDR network address is 192.168.122.0/24, then your default gateway is likely to be 192.168.122.1.
    Disable Gateway Disables forwarding and keeps the network isolated.
  3. Click Next to specify DHCP options:
    Field Description
    Enable DHCP Enables DHCP services for this subnet. DHCP allows you to automate the distribution of IP settings to your instances.
    IPv6 Address Configuration Mode
    If creating an IPv6 network, specifies how IPv6 addresses and additional information are allocated:
    • No Options Specified - Select this option if IP addresses are set manually, or a non OpenStack-aware method is used for address allocation.
    • SLAAC (Stateless Address Autoconfiguration) - Instances generate IPv6 addresses based on Router Advertisement (RA) messages sent from the OpenStack Networking router. This configuration results in a OpenStack Networking subnet created with ra_mode set to slaac and address_mode set to slaac.
    • DHCPv6 stateful - Instances receive IPv6 addresses as well as additional options (for example, DNS) from OpenStack Networking DHCPv6 service. This configuration results in a subnet created with ra_mode set to dhcpv6-stateful and address_mode set to dhcpv6-stateful.
    • DHCPv6 stateless - Instances generate IPv6 addresses based on Router Advertisement (RA) messages sent from the OpenStack Networking router. Additional options (for example, DNS) are allocated from the OpenStack Networking DHCPv6 service. This configuration results in a subnet created with ra_mode set to dhcpv6-stateless and address_mode set to dhcpv6-stateless.
    Allocation Pools
    Range of IP addresses you would like DHCP to assign. For example, the value 192.168.22.100,192.168.22.100 considers all 'up' addresses in that range as available for allocation.
    DNS Name Servers
    IP addresses of the DNS servers available on the network. DHCP distributes these addresses to the instances for name resolution.
    Host Routes
    Static host routes. First specify the destination network in CIDR format, followed by the next hop that should be used for routing. For example: 192.168.23.0/24, 10.1.31.1
    Provide this value if you need to distribute static routes to instances.
  4. Click Create.
The new subnet is available for viewing in your network's Subnets list. You can also click Edit to change any options as needed. When you create instances, you can configure them now to use this subnet, and they will subsequently receive any specified DHCP options.

5.1.4. Delete a Subnet

You can delete a subnet if it is no longer in use. However, if any instances are still configured to use the subnet, the deletion attempt fails and the dashboard displays an error message.
This procedure demonstrates how to delete a specific subnet in a network:
  1. In the dashboard, select Project > Network > Networks, and click the name of your network.
  2. Select the target subnet and click Delete Subnets.

5.1.5. Add a router

OpenStack Networking provides routing services using an SDN-based virtual router. Routers are a requirement for your instances to communicate with external subnets, including those out in the physical network. Routers and subnets connect using interfaces, with each subnet requiring its own interface to the router.
A router's default gateway defines the next hop for any traffic received by the router. Its network is typically configured to route traffic to the external physical network using a virtual bridge.
  1. In the dashboard, select Project > Network > Routers, and click +Create Router.
  2. Enter a descriptive name for the new router, and click Create router.
  3. Click Set Gateway next to the new router's entry in the Routers list.
  4. In the External Network list, specify the network that will receive traffic destined for an external location.
  5. Click Set Gateway.
After adding a router, the next step is to configure any subnets you have created to send traffic using this router. You do this by creating interfaces between the subnet and the router (see Procedure 5.0, “”).

5.1.6. Delete a router

You can delete a router if it has no connected interfaces. This procedure describes the steps needed to first remove a router's interfaces, and then the router itself.
  1. In the dashboard, select Project > Network > Routers, and click on the name of the router you would like to delete.
  2. Select the interfaces of type Internal Interface.
  3. Click Delete Interfaces.
  4. From the Routers list, select the target router and click Delete Routers.

5.1.7. Add an interface

Interfaces allow you to interconnect routers with subnets. As a result, the router can direct any traffic that instances send to destinations outside of their intermediate subnet. This procedure adds a router interface and connects it to a subnet.
The procedure uses the Network Topology feature, which displays a graphical representation of all your virtual router and networks and enables you to perform network management tasks.
  1. In the dashboard, select Project > Network > Network Topology.
  2. Locate the router you wish to manage, hover your mouse over it, and click Add Interface.
  3. Specify the Subnet to which you would like to connect the router.
  4. You have the option of specifying an IP Address. The address is useful for testing and troubleshooting purposes, since a successful ping to this interface indicates that the traffic is routing as expected.
  5. Click Add interface.
The Network Topology diagram automatically updates to reflect the new interface connection between the router and subnet.

5.1.8. Delete an interface

You can remove an interface to a subnet if you no longer require the router to direct its traffic. This procedure demonstrates the steps required for deleting an interface:
  1. In the dashboard, select Project > Network > Routers.
  2. Click on the name of the router that hosts the interface you would like to delete.
  3. Select the interface (will be of type Internal Interface), and click Delete Interfaces.