In our architecture, floating IPs are in VLAN 101.

neutron net-create floating-192-168-101  \
--shared --router:external true --provider:network_type vlan \
--provider:physical_network vlan --provider:segmentation_id 101

 

 

+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | 01c41b9a-3241-4236-9e52-77e0967d4b53 |
| mtu                       | 0                                    |
| name                      | floating-192-168-101                 |
| port_security_enabled     | True                                 |
| provider:network_type     | vlan                                 |
| provider:physical_network | vlan                                 |
| provider:segmentation_id  | 101                                  |
| router:external           | True                                 |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tenant_id                 | 15318113a30947fcb5dfde01ef04e97b     |
+---------------------------+--------------------------------------+

note down the ID, and use the ID in the next command

neutron subnet-create --allocation-pool start=192.168.101.5,end=192.168.101.250 \
--ip-version 4  --gateway 192.168.101.1 --disable-dhcp \
--name floating-192-168-101 --dns-nameserver 8.8.8.8  \
01c41b9a-3241-4236-9e52-77e0967d4b53 192.168.101.0/24

 

Created a new subnet:
+-------------------+------------------------------------------------------+
| Field             | Value                                                |
+-------------------+------------------------------------------------------+
| allocation_pools  | {"start": "192.168.101.5", "end": "192.168.101.250"} |
| cidr              | 192.168.101.0/24                                     |
| dns_nameservers   | 8.8.8.8                                              |
| enable_dhcp       | False                                                |
| gateway_ip        | 192.168.101.1                                        |
| host_routes       |                                                      |
| id                | 8433e4c6-7f96-4de4-9f1c-746fe835da64                 |
| ip_version        | 4                                                    |
| ipv6_address_mode |                                                      |
| ipv6_ra_mode      |                                                      |
| name              | floating-192-168-101                                 |
| network_id        | 01c41b9a-3241-4236-9e52-77e0967d4b53                 |
| subnetpool_id     |                                                      |
| tenant_id         | 15318113a30947fcb5dfde01ef04e97b                     |
+-------------------+------------------------------------------------------+

neutron net-external-list

+--------------------------------------+----------------------+-------------------------------------------------------+
| id                                   | name                 | subnets                                               |
+--------------------------------------+----------------------+-------------------------------------------------------+
| 01c41b9a-3241-4236-9e52-77e0967d4b53 | floating-192-168-101 | 8433e4c6-7f96-4de4-9f1c-746fe835da64 192.168.101.0/24 |
+--------------------------------------+----------------------+-------------------------------------------------------+

note down the id.
Now you need to create a router to connect to this network.

neutron router-create router01

 

Created a new router:
+-----------------------+--------------------------------------+
| Field                 | Value                                |
+-----------------------+--------------------------------------+
| admin_state_up        | True                                 |
| distributed           | False                                |
| external_gateway_info |                                      |
| ha                    | True                                 |
| id                    | 0a070515-ccd3-4149-9c2c-67ed7180d27f |
| name                  | router01                             |
| routes                |                                      |
| status                | ACTIVE                               |
| tenant_id             | 15318113a30947fcb5dfde01ef04e97b     |
+-----------------------+--------------------------------------+
neutron router-gateway-set 0a070515-ccd3-4149-9c2c-67ed7180d27f 01c41b9a-3241-4236-9e52-77e0967d4b53

 neutron router-list

+--------------------------------------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+------+
| id                                   | name     | external_gateway_info                                                                                                                                                                     | distributed | ha   |
+--------------------------------------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+------+
| 0a070515-ccd3-4149-9c2c-67ed7180d27f | router01 | {"network_id": "01c41b9a-3241-4236-9e52-77e0967d4b53", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "8433e4c6-7f96-4de4-9f1c-746fe835da64", "ip_address": "192.168.101.5"}]} | False       | True |
+--------------------------------------+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+------+

neutron_floating_ip_admin0

About The Author