To create a Neutron network on a physical network, perform the following steps on a Neutron controller node:
cctrl# TENANT=`keystone tenant-get demo|grep id|awk '{print $4}'`
cctrl# VLAN_ID=1
cctrl# CIDR=IP-address/22
cctrl# GATEWAY=IP-address
cctrl# SUBNET_NAME=subnet-name
cctrl# NETWORK_NAME=network-name
cctrl# START_IP=start-IP-address
cctrl# END_IP=end-IP-address
cctrl# ML2_PHYSNET=physnetN
cctrl# export OS_USERNAME=neutron
cctrl# neutron net-create --provider:network_type=vlan \
--provider:segmentation_id=${VLAN_ID} --provider:physical_network=${ML2_PHYSNET} \
--tenant-id ${TENANT} ${NETWORK_NAME}
cctrl# neutron subnet-create --disable-dhcp --gateway ${GATEWAY} \
--name ${SUBNET_NAME} --allocation-pool start=${START_IP},end=${END_IP} \
--tenant-id ${TENANT} ${NETWORK_NAME} ${CIDR}
The following example shows how to create a Neutron network on a physical network called physnet1.
The following example sets up a simple 192.168.0.0/24 network, with a gateway (default router) of 192.168.0.1. IP addresses 192.168.0.100 - 192.168.0.200 are available for logical domain guests. The VLAN ID is 500 and assumes the demo tenant.
cctrl# TENANT=`keystone tenant-get demo|grep id|awk '{print $4}'`
cctrl# VLAN_ID=500
cctrl# CIDR=192.168.0.0/24
cctrl# GATEWAY=10.0.68.1
cctrl# SUBNET_NAME=private_subnet
cctrl# NETWORK_NAME=private_network
cctrl# START_IP=192.168.0.100
cctrl# END_IP=192.168.0.200
cctrl# ML2_PHYSNET=physnet1
cctrl# export OS_USERNAME=neutron
cctrl# export OS_PASSWORD=services-password
cctrl# export OS_TENANT_NAME=service
cctrl# export OS_AUTH_URL=http://cloud-controller-IP-address:5000/v2.0
cctrl# neutron net-create --provider:network_type=vlan \
--provider:segmentation_id=${VLAN_ID} \
--provider:physical_network=${ML2_PHYSNET} --tenant-id ${TENANT} ${NETWORK_NAME}
cctrl# neutron subnet-create --disable-dhcp --gateway ${GATEWAY} \
--name ${SUBNET_NAME} --allocation-pool start=${START_IP},end=${END_IP} \
--tenant-id ${TENANT} ${NETWORK_NAME} ${CIDR}