17.3k views
3 votes
Now we will create public and private network and then add a router.

A. Create private network in admin tenant and add a subnet to it by running following commands. # openstack network create # openstack subnet create --network --allocation-pool \ start=,end= --subnet-range
B. Create Public network and add a subnet to it. # openstack network create --provider-network-type flat --provider-physical-network extnet --external # openstack subnet create --network --allocation-pool \ start=,end= --gateway --dhcp \ --subnet-range
C. Create a router by executing the following command, it will connect public and private subnets, set its gateway as pub_network and link pvt_network as well. # openstack router create # openstack router set --external-gateway # openstack router add subnet

User Gixxer
by
6.9k points

1 Answer

4 votes

Final answer:

The student's question involves using OpenStack commands to create a private network with a subnet, a public network with a subnet, and a router to connect them. Specific parameters in the command must be replaced with the appropriate network names, IP ranges, and subnet CIDRs.

Step-by-step explanation:

To create a private network in the admin tenant and add a subnet, you would run the following commands with the appropriate parameters filled in:

OpenStack network create <private_network_name>
OpenStack subnet create --network <private_network_name> --allocation-pool start=<start_ip>,end=<end_ip> --subnet-range <subnet_cidr>

To create a public network and add a subnet, the commands would include additional flags to specify the network type and whether it is external. The commands are:

openstack network create --provider-network-type flat --provider-physical-network extnet --external <public_network_name>
openstack subnet create --network <public_network_name> --allocation-pool start=<start_ip>,end=<end_ip> --gateway <gateway_ip> --dhcp --subnet-range <subnet_cidr>

Finally, to create a router that connects the public and private subnets set its gateway to the public network and link the private network as follows:

OpenStack router create <router_name>
OpenStack router set --external-gateway <public_network_name>
OpenStack router add subnet <private_subnet_name>

This will establish a network topology in OpenStack where the private subnet can route outbound traffic to the internet via the public network and associated router.

User Azolo
by
7.3k points