How to Build an OpenStack Network using the Neutron CLI


Within this article we will provide the steps required to build a simple Neutron network. The network will consist of,

  • Provider network (NET_EXTERNAL)
  • Tenant network (NET_INTERNAL)
  • L3 Router (NEUTRON-ROUTER)
  • Floating IPs (

Below is a diagram on how the topology looks,

Provider Network

First we create the provider network. This is a layer2 network that maps to a physical network, allowing us to use a physical device as the gateway. Below traffic is sent out tagged on VLAN100.
We then assign a subnet to the network. This contains the floating IPs as well as the default gateway.

neutron net-create --provider:physical_network=physnet1 \
                   --provider:network_type=vlan \
                   --provider:segmentation_id=100 \
                   --shared --router:external NET_EXTERNAL

neutron subnet-create NET_EXTERNAL \
                   --name SUBNET_EXTERNAL \ 
                   --enable_dhcp=False \
                   --allocation_pool start=,end= \ 

Tenant Network

The tenant network is then created. We assign the DNS servers and IP pool (fixed IPs) that will be assigned to the instances by DHCP on creation.

neutron net-create NET_INTERNAL
neutron subnet-create NET_INTERNAL \
                 --name SUBNET_INTERNAL \
                 --dns-nameservers list=true

L3 Router

Finally we create the L3 router. We assign the gateway network (i.e provider) and then the tenant network.

neutron router-create NEUTRON-ROUTER
neutron router-gateway-set NEUTRON-ROUTER NET_EXTERNAL
neutron router-interface-add NEUTRON-ROUTER SUBNET_INTERNAL

Show Commands

neutron net-listList networks
neutron net-show <network>Show network
neutron subnet-istList subnets
neutron subnet-show <subnet>Show subnet
neutron floatingip-listList floating IPs
neutron floatingip-show <floating_ip>Show floating IP
neutron router-listList routers
neutron router-show <router>Show router


Installation Scripts –

Rick Donato

Want to become an OpenStack expert?

Here is our hand-picked selection of the best courses you can find online:
OpenStack Essentials course
Certified OpenStack Administrator course
Docker Mastery course
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial