root@build-vm:/home/sunshout# neutron subnet-create ext-network 192.168.1.0/24 --tenant-id 115a1a2e76c14f2d9b4b0c6e33ea276a --gateway 192.168.1.254 --disable-dhcp --allocation-pool start=192.168.1.50,end=192.168.1.60
Created a new subnet:
+------------------+--------------------------------------------------+
| Field | Value |
+------------------+--------------------------------------------------+
| allocation_pools | {"start": "192.168.1.50", "end": "192.168.1.60"} |
| cidr | 192.168.1.0/24 |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | 192.168.1.254 |
| host_routes | |
| id | b3995309-98c9-4cfe-83ef-b6e3f3cf6293 |
| ip_version | 4 |
| name | |
| network_id | e9246d5a-76dd-4d36-b19b-a3562530f6aa |
| tenant_id | 115a1a2e76c14f2d9b4b0c6e33ea276a |
+------------------+--------------------------------------------------+
root@build-vm:/home/sunshout# neutron router-create --tenant-id fcdb781869ba40a08d908ca05c842cbd demo_router
Created a new router:
+-----------------------+--------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------+
| admin_state_up | True |
| external_gateway_info | |
| id | 613a988f-d473-4897-bf4a-c9ea0025e82d |
| name | demo_router |
| status | ACTIVE |
| tenant_id | fcdb781869ba40a08d908ca05c842cbd |
+-----------------------+--------------------------------------+
root@build-vm:/home/sunshout#
root@build-vm:/home/sunshout# neutron router-gateway-set demo_router ext-network
Set gateway for router demo_router
root@build-vm:/home/sunshout#
root@build-vm:/home/sunshout# neutron net-create --tenant-id fcdb781869ba40a08d908ca05c842cbd private01 --provider:network_type vlan --provider:physical_network physnet2 --provider:segmentation_id 121
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | 4f6858cd-bdaa-4f3a-b61e-d576a1d42e27 |
| name | private01 |
| provider:network_type | vlan |
| provider:physical_network | physnet2 |
| provider:segmentation_id | 121 |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | fcdb781869ba40a08d908ca05c842cbd |
+---------------------------+--------------------------------------+
root@build-vm:/home/sunshout# neutron subnet-create --tenant-id fcdb781869ba40a08d908ca05c842cbd --name private01-subnet --dns-nameserver 8.8.8.8 private01 192.168.11.0/24
Created a new subnet:
+------------------+----------------------------------------------------+
| Field | Value |
+------------------+----------------------------------------------------+
| allocation_pools | {"start": "192.168.11.2", "end": "192.168.11.254"} |
| cidr | 192.168.11.0/24 |
| dns_nameservers | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 192.168.11.1 |
| host_routes | |
| id | e8597e32-b639-4ed8-9bd8-cbba0a4b7517 |
| ip_version | 4 |
| name | private01-subnet |
| network_id | 4f6858cd-bdaa-4f3a-b61e-d576a1d42e27 |
| tenant_id | fcdb781869ba40a08d908ca05c842cbd |
+------------------+----------------------------------------------------+
root@build-vm:/home/sunshout# neutron router-interface-add demo_router private01-subnet
Added interface 5efce585-1c9d-4e27-adb5-8fb3fa971cbe to router demo_router.
root@build-vm:/home/sunshout#