The tenant network provides internal network access for instances.
The architecture isolates this type of network from other tenants. The
Like the external network, your tenant network also requires
a subnet attached to it. You can specify any valid subnet because the
architecture isolates tenant networks. By default, this subnet uses
DHCP so your instances can obtain IP addresses.
A virtual router passes network traffic between two or more virtual
networks. Each router requires one or more
interfaces and/or gateways
that provide access to specific networks. In this case, you create
a router and attach your tenant and external networks to it.
demo
tenant owns this network because it only
provides network access for instances within it.Note | |
---|---|
Perform these commands on the controller node. |
To create the tenant network
- Source the
demo
credentials to gain access to user-only CLI commands:
$ source demo-openrc.sh
- Create the network:
$ neutron net-create demo-net Created a new network:
+---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | True | | id | bbe2a1dd-2557-41ff-b9ec-228d2e271add | | mtu | 0 | | name | demo-net | | provider:network_type | gre | | provider:physical_network | | | provider:segmentation_id | 62 | | router:external | False | | shared | False | | status | ACTIVE | | subnets | | | tenant_id | 9c1cc7fa7fc24c17812ec662555ba519 | +---------------------------+--------------------------------------+
To create a subnet on the tenant network
- Create the subnet:
$ neutron subnet-create demo-net
ReplaceTENANT_NETWORK_CIDR
\ --name demo-subnet --gatewayTENANT_NETWORK_GATEWAY
TENANT_NETWORK_CIDR
with the subnet you want to associate with the tenant network andTENANT_NETWORK_GATEWAY
with the gateway you want to associate with it, typically the ".1" IP address.
Example using192.168.1.0/24
:
$ neutron subnet-create demo-net 192.168.1.0/24 \ --name demo-subnet --gateway 192.168.1.1 Created a new subnet:
+-------------------+--------------------------------------------------+ | Field | Value | +-------------------+--------------------------------------------------+ | allocation_pools | {"start": "192.168.1.2", "end": "192.168.1.254"} | | cidr | 192.168.1.0/24 | | dns_nameservers | | | enable_dhcp | True | | gateway_ip | 192.168.1.1 | | host_routes | | | id | d70a9abc-b83f-4078-ae5f-bfe5d01dc30b | | ip_version | 4 | | ipv6_address_mode | | | ipv6_ra_mode | | | name | demo-subnet | | network_id | bbe2a1dd-2557-41ff-b9ec-228d2e271add | | subnetpool_id | | | tenant_id | 9c1cc7fa7fc24c17812ec662555ba519 | +-------------------+--------------------------------------------------+
To create a router on the tenant network and attach the external
and tenant networks to it
- Create the router:
$ neutron router-create demo-router Created a new router:
+-----------------------+--------------------------------------+ | Field | Value | +-----------------------+--------------------------------------+ | admin_state_up | True | | distributed | False | | external_gateway_info | | | ha | False | | id | 1aaa1237-ce55-47e1-8a70-70a700c9c2eb | | name | demo-router | | routes | | | status | ACTIVE | | tenant_id | 9c1cc7fa7fc24c17812ec662555ba519 | +-----------------------+--------------------------------------+
- Attach the router to the
demo
tenant subnet:
$ neutron router-interface-add demo-router demo-subnet Added interface b1a894fd-aee8-475c-9262-4342afdc1b58 to router demo-router.
- Attach the router to the external network by setting it as
the gateway:
$ neutron router-gateway-set demo-router ext-net Set gateway for router demo-router
No comments:
Post a Comment