Openstack创建网络

neutron命令在新版本中不再被推荐使用,统一使用openstack命令来执行原来的neutron命令。

使用neutron命令创建网络

caas@caas-virtual-machine:~/devstack$ neutron net-create --tenant-id ffee4b11f4fb4a259d747f024d2477f3 GENERAL_NETWORK
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new network:
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| availability_zone_hints   |                                      |
| availability_zones        |                                      |
| created_at                | 2018-07-19T05:46:14Z                 |
| description               |                                      |
| id                        | 5d34a074-068f-42f4-89f2-e839e537a20a |
| ipv4_address_scope        |                                      |
| ipv6_address_scope        |                                      |
| is_default                | False                                |
| mtu                       | 1450                                 |
| name                      | GENERAL_NETWORK                      |
| port_security_enabled     | True                                 |
| project_id                | ffee4b11f4fb4a259d747f024d2477f3     |
| provider:network_type     | vxlan                                |
| provider:physical_network |                                      |
| provider:segmentation_id  | 78                                   |
| revision_number           | 1                                    |
| router:external           | False                                |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tags                      |                                      |
| tenant_id                 | ffee4b11f4fb4a259d747f024d2477f3     |
| updated_at                | 2018-07-19T05:46:14Z                 |
+---------------------------+--------------------------------------+

使用openstack命令创建网络

caas@caas-virtual-machine:~/devstack$ openstack network create --project=General testnet
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        |                                      |
| created_at                | 2018-07-19T06:05:00Z                 |
| description               |                                      |
| dns_domain                | None                                 |
| id                        | 25937468-3cb5-4226-9fc5-e49d121209d0 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| is_default                | False                                |
| is_vlan_transparent       | None                                 |
| mtu                       | 1450                                 |
| name                      | testnet                              |
| port_security_enabled     | True                                 |
| project_id                | ffee4b11f4fb4a259d747f024d2477f3     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 38                                   |
| qos_policy_id             | None                                 |
| revision_number           | 1                                    |
| router:external           | Internal                             |
| segments                  | None                                 |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tags                      |                                      |
| updated_at                | 2018-07-19T06:05:00Z                 |
+---------------------------+--------------------------------------+

使用neutron创建子网

caas@caas-virtual-machine:~/devstack$ neutron subnet-create --tenant-id ffee4b11f4fb4a259d747f024d2477f3 GENERAL_NETWORK 172.24.220.0/24
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new subnet:
+-------------------+----------------------------------------------------+
| Field             | Value                                              |
+-------------------+----------------------------------------------------+
| allocation_pools  | {"start": "172.24.220.2", "end": "172.24.220.254"} |
| cidr              | 172.24.220.0/24                                    |
| created_at        | 2018-07-19T06:38:55Z                               |
| description       |                                                    |
| dns_nameservers   |                                                    |
| enable_dhcp       | True                                               |
| gateway_ip        | 172.24.220.1                                       |
| host_routes       |                                                    |
| id                | 34d11177-10ae-47ff-9c08-ebca4bb127d9               |
| ip_version        | 4                                                  |
| ipv6_address_mode |                                                    |
| ipv6_ra_mode      |                                                    |
| name              |                                                    |
| network_id        | 5d34a074-068f-42f4-89f2-e839e537a20a               |
| project_id        | ffee4b11f4fb4a259d747f024d2477f3                   |
| revision_number   | 0                                                  |
| service_types     |                                                    |
| subnetpool_id     |                                                    |
| tags              |                                                    |
| tenant_id         | ffee4b11f4fb4a259d747f024d2477f3                   |
| updated_at        | 2018-07-19T06:38:55Z                               |
+-------------------+----------------------------------------------------+

使用neutron创建路由

caas@caas-virtual-machine:~/devstack$ neutron router-create --tenant-id ffee4b11f4fb4a259d747f024d2477f3 GENERAL_ROUTER
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new router:
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | True                                 |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2018-07-19T06:43:07Z                 |
| description             |                                      |
| distributed             | False                                |
| external_gateway_info   |                                      |
| flavor_id               |                                      |
| ha                      | False                                |
| id                      | 5bab2637-6ed5-49db-a1e3-1a984cae4833 |
| name                    | GENERAL_ROUTER                       |
| project_id              | ffee4b11f4fb4a259d747f024d2477f3     |
| revision_number         | 1                                    |
| routes                  |                                      |
| status                  | ACTIVE                               |
| tags                    |                                      |
| tenant_id               | ffee4b11f4fb4a259d747f024d2477f3     |
| updated_at              | 2018-07-19T06:43:07Z                 |
+-------------------------+--------------------------------------+

你可能感兴趣的:(openstack)