命令:neutron subnet-create --name 子网名字 --dns-nameserver 8.8.8.8 --gateway 子网网关 网络名称 子网网段
查看网络名称: [root@controller ~]# neutron net-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. | |||
---|---|---|---|
id | name | tenant_id | subnets |
0419d666-2a1e-4c5f-9331-b54ab7718b8b | public | b03aac1f6ae94f7bada2afa8f2064312 | e97beba0-d8ae-4bc6-9497-abad9200cb60 42.51.77.0/24 |
b6c7014c-6007-4cd9-92da-da64365275f6 172.16.1.0/24 | |||
36878f8d-9df4-4e8a-9972-4c236d9c9eca | private | b03aac1f6ae94f7bada2afa8f2064312 | 2e2086da-6acb-499e-a22e-a3906bcf48e7 10.0.0.0/24 |
我们创建一个子网名叫newnet,DNS为8.8.8.8,网关为192.168.1.1 创建到public网络名称上 网段分配IP为:192.168.1.2-192.168.1.254 neutron subnet-create --name newnet --dns-nameserver 8.8.8.8 --gateway 192.168.1.1 public 192.168.1.0/24
开始创建子网 [root@controller ~]# neutron subnet-create --name newnet --dns-nameserver 8.8.8.8 --gateway 192.168.1.1 public 192.168.1.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": "192.168.1.2", "end": "192.168.1.254"} |
cidr | 192.168.1.0/24 |
created_at | 2019-05-23T01:42:19Z |
description | |
dns_nameservers | 8.8.8.8 |
enable_dhcp | True |
gateway_ip | 192.168.1.1 |
host_routes | |
id | 8b0e68ea-4326-457b-aec3-c8dbdca45098 |
ip_version | 4 |
ipv6_address_mode | |
ipv6_ra_mode | |
name | newnet |
network_id | 0419d666-2a1e-4c5f-9331-b54ab7718b8b |
project_id | b03aac1f6ae94f7bada2afa8f2064312 |
revision_number | 0 |
service_types | |
subnetpool_id | |
tags | |
tenant_id | b03aac1f6ae94f7bada2afa8f2064312 |
updated_at | 2019-05-23T01:42:19Z |
查看网络列表-已经发现存在我们创建的子网了 [root@controller ~]# neutron net-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. | |||
---|---|---|---|
id | name | tenant_id | subnets |
0419d666-2a1e-4c5f-9331-b54ab7718b8b | public | b03aac1f6ae94f7bada2afa8f2064312 | 8b0e68ea-4326-457b-aec3-c8dbdca45098 192.168.1.0/24 |
b6c7014c-6007-4cd9-92da-da64365275f6 172.16.1.0/24 | |||
e97beba0-d8ae-4bc6-9497-abad9200cb60 42.51.77.0/24 | |||
36878f8d-9df4-4e8a-9972-4c236d9c9eca | private | b03aac1f6ae94f7bada2afa8f2064312 | 2e2086da-6acb-499e-a22e-a3906bcf48e7 10.0.0.0/24 |