Skip to content

Gérer les ip flottantes⚓︎

Une fois l'instance créée et démarrée pour pouvoir la rendre accessible il faut lui attribuée une ip flottantes ou floating ips. Cette ip sera prise dans le pool d'adresses ip relative à la zone d'exposition, soit privée soit publique

Rappel

Chaque projet peut posséder l'un des deux réseaux d'ip flottantes appelées external_priv ou external_pub

  • external_priv est une zone uniquement accessible depuis les réseaux INRAE et ESR (et au travers du VPN)

  • external_pub est accessible à partir de tout internet ! Porter une attention particulière à définir des mots de passe robustes (RDP et SSH sont ouverts à tout le monde)

$> openstack floating ip create <external_network>
$> openstack server add floating ip <instance> <floating_ip>
  • external_network : nom ou ID du réseau externe disponible dans votre projet
  • instance : nom ou ID de l'instance a laquelle attacher l'ip flottante
  • floating_ip : IP flottante a associer l'instance

A noter

Pour récupérer les informations des ressources disponibles sur le projet (flavor, network, image, ...) vous pouvez suivre la documentation ici

Exemple :

$> openstack floating ip create external_priv
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| created_at          | 2026-04-14T22:22:26Z                 |
| description         |                                      |
| dns_domain          |                                      |
| dns_name            |                                      |
| fixed_ip_address    | None                                 |
| floating_ip_address | 10.131.49.213                        |
| floating_network_id | 01ca696a-2ed8-4471-9d14-2d6525c24718 |
| id                  | 37f3b0dc-080f-4fb2-a239-30bb5e7efb4f |
| name                | 10.131.49.213                        |
| port_details        | None                                 |
| port_forwardings    | []                                   |
| port_id             | None                                 |
| project_id          | 1eeec6c08e46429aa3e02e7acca8bdcd     |
| qos_policy_id       | None                                 |
| revision_number     | 0                                    |
| router_id           | None                                 |
| status              | DOWN                                 |
| subnet_id           | None                                 |
| tags                | []                                   |
| updated_at          | 2026-04-14T22:22:26Z                 |
+---------------------+--------------------------------------+
$> openstack floating ip list --os-cloud jchabert
+--------------------------------------+---------------------+------------------+------+--------------------------------------+----------------------------------+
| ID                                   | Floating IP Address | Fixed IP Address | Port | Floating Network                     | Project                          |
+--------------------------------------+---------------------+------------------+------+--------------------------------------+----------------------------------+
| 37f3b0dc-080f-4fb2-a239-30bb5e7efb4f | 10.131.49.213       | None             | None | 01ca696a-2ed8-4471-9d14-2d6525c24718 | 1eeec6c08e46429aa3e02e7acca8bdcd |
+--------------------------------------+---------------------+------------------+------+--------------------------------------+----------------------------------+
$> openstack server add floating ip test-instance 10.131.49.213
$> openstack server list
+--------------------------------------+---------------+--------+----------------------------------------+------------------+----------+
| ID                                   | Name          | Status | Networks                               | Image            | Flavor   |
+--------------------------------------+---------------+--------+----------------------------------------+------------------+----------+
| dcb2b614-5cea-4017-bd67-ac55628f8990 | test-instance | ACTIVE | test-network=10.0.0.192, 10.131.49.213 | ubuntu-22.04-LTS | m1.small |
+--------------------------------------+---------------+--------+----------------------------------------+------------------+----------+
$> openstack server remove floating ip <instance> <floating_ip> 
$> openstack floating ip delete <floating_ip> 
  • instance : nom ou ID de l'instance de laquelle detacher l'ip flottante
  • floating_ip : IP flottante à detacher de l'instance

A noter

Pour récupérer les informations des ressources disponibles sur le projet (flavor, network, image, ...) vous pouvez suivre la documentation ici

Exemple :

$> openstack server list
+--------------------------------------+---------------+--------+----------------------------------------+------------------+----------+
| ID                                   | Name          | Status | Networks                               | Image            | Flavor   |
+--------------------------------------+---------------+--------+----------------------------------------+------------------+----------+
| dcb2b614-5cea-4017-bd67-ac55628f8990 | test-instance | ACTIVE | test-network=10.0.0.192, 10.131.49.213 | ubuntu-22.04-LTS | m1.small |
+--------------------------------------+---------------+--------+----------------------------------------+------------------+----------+
$> openstack server remove floating ip test-instance 10.131.49.213
$> openstack floating ip delete 10.131.49.213
$> openstack server list
+--------------------------------------+---------------+--------+-------------------------+------------------+----------+
| ID                                   | Name          | Status | Networks                | Image            | Flavor   |
+--------------------------------------+---------------+--------+-------------------------+------------------+----------+
| dcb2b614-5cea-4017-bd67-ac55628f8990 | test-instance | ACTIVE | test-network=10.0.0.192 | ubuntu-22.04-LTS | m1.small |
+--------------------------------------+---------------+--------+-------------------------+------------------+----------+