Openstack installation : Create Provider / Self service Networks

Content from “openstack.org”, listed here with minor/no changes – just noting down what I did – online notes.

On the controller node, source the admin credentials to gain access to admin-only CLI commands:

$ . admin-openrc

Create the provider (external) network

$ openstack network create  --share --external --provider-physical-network provider --provider-network-type flat provider

The –share option allows all projects to use the virtual network.

The –external option defines the virtual network to be external. (Default is –internal).

The –provider-physical-network provider and –provider-network-type flat options connect the flat virtual network to the flat (native/untagged) physical network on the enp3s0 interface on the host using information from the following files:

ml2_conf.ini:

[ml2_type_flat]
flat_networks = provider

linuxbridge_agent.ini:

[linux_bridge]
physical_interface_mappings = provider:enp3s0

Create a subnet on the network (Wanted to use 10.0.0.65 to 10.0.0.124 range of IP in the subnet 10.0.0.0/24 for floating ips)

$ openstack subnet create --network provider --allocation-pool start=10.0.0.65,end=10.0.0.124 --dns-nameserver 8.8.8.8 --gateway 10.0.0.1 --subnet-range 10.0.0.0/24 provider

Non-privileged users typically cannot supply additional parameters to this command. The service automatically chooses parameters using information from the following files:

ml2_conf.ini:

[ml2]
tenant_network_types = vxlan
[ml2_type_vxlan]
vni_ranges = 1:1000

Create the self-service network

$ openstack network create selfservice

Create a subnet on the network:

$ openstack subnet create --network selfservice --dns-nameserver 8.8.4.4 --gateway 172.16.1.1 --subnet-range 172.16.1.0/24 selfservice

Create a router

Self-service networks connect to provider networks using a virtual router that typically performs bidirectional NAT. Each router contains an interface on at least one self-service network and a gateway on a provider network.

The provider network must include the router:external option to enable self-service routers to use it for connectivity to external networks such as the Internet. The admin or other privileged user must include this option during network creation or add it later.
In this case, the router:external option was set by using the –external parameter when creating the provider network.

$ openstack router create router

Add the self-service network subnet as an interface on the router:

$ openstack router add subnet router selfservice

Set a gateway on the provider network on the router:

$ openstack router set router --external-gateway provider

Verify operation. List network namespaces. You should see one qrouter namespace and two qdhcp namespaces.

$ ip netns
qrouter-89dd2083-a160-4d75-ab3a-14239f01ea0b
qdhcp-7c6f9b37-76b4-463e-98d8-27e5686ed083
qdhcp-0e62efcd-8cee-46c7-b163-d8df05c3c5ad

List ports on the router to determine the gateway IP address on the provider network:

$ openstack port list --router router
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------+--------+
| 1bad25c9-9d67-46dd-9293-c9be75c85969 | | fa:16:3e:04:52:54 | ip_address='10.0.0.69', subnet_id='9621ec8b-31fb-4143-b24f-c4976025e900' | ACTIVE |
| c50cfa6b-ffee-452b-a3d3-45e6a692bc59 | | fa:16:3e:be:ae:4a | ip_address='172.16.1.1', subnet_id='56ec9e7a-6c13-4139-9d17-95532ade4c5b' | ACTIVE |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------+--------+

Ping this IP address from the controller node or any host on the physical provider network:

$ ping -c 4 10.0.0.69
PING 10.0.0.69 (10.0.0.69) 56(84) bytes of data.
64 bytes from 10.0.0.69: icmp_seq=1 ttl=64 time=0.583 ms
64 bytes from 10.0.0.69: icmp_seq=2 ttl=64 time=0.449 ms
64 bytes from 10.0.0.69: icmp_seq=3 ttl=64 time=0.359 ms
64 bytes from 10.0.0.69: icmp_seq=4 ttl=64 time=0.388 ms

About sandeep

Passionate about sharing information on "how to".
This entry was posted in Installation / How To, Notes and tagged , , , , , , . Bookmark the permalink.