Openstack installation : Create Provider / Self service Networks

Content from “”, 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:


flat_networks = provider


physical_interface_mappings = provider:enp3s0

Create a subnet on the network (Wanted to use to range of IP in the subnet for floating ips)

$ openstack subnet create --network provider --allocation-pool start=,end= --dns-nameserver --gateway --subnet-range provider

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


tenant_network_types = 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 --gateway --subnet-range 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

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='', subnet_id='9621ec8b-31fb-4143-b24f-c4976025e900' | ACTIVE |
| c50cfa6b-ffee-452b-a3d3-45e6a692bc59 | | fa:16:3e:be:ae:4a | ip_address='', 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
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.583 ms
64 bytes from icmp_seq=2 ttl=64 time=0.449 ms
64 bytes from icmp_seq=3 ttl=64 time=0.359 ms
64 bytes from 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.