Créer un routeur en ligne de commande : Différence entre versions
De Hopla.cloud OpenStack Documentation Wiki
(→Description des paramètres de la commande) (Balise : Éditeur visuel) |
|||
Ligne 35 : | Ligne 35 : | ||
==Description des paramètres de la commande== | ==Description des paramètres de la commande== | ||
<syntaxhighlight lang="shell"> | <syntaxhighlight lang="shell"> | ||
− | openstack | + | openstack router create |
− | [- | + | [--project <project> [--project-domain <project-domain>]] |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[--enable | --disable] | [--enable | --disable] | ||
− | < | + | [--distributed | --centralized] |
+ | [--ha | --no-ha] | ||
+ | [--description <description>] | ||
+ | [--availability-zone-hint <availability-zone>] | ||
+ | [--tag <tag> | --no-tag] | ||
+ | <name> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | ;- | + | ;; --project <project> |
− | : | + | ;: Owner’s project (name or ID) |
− | ;- | + | ;; --project-domain <project-domain> |
− | : | + | ;: Domain the project belongs to (name or ID). This can be used in case collisions between project names exist. |
− | ;-- | + | ;; --enable<code class="descclassname"> <project></code> |
− | : | + | ;: Enable router (default) |
− | ;-- | + | ;; --disable<code class="descclassname"> <project></code> |
− | : | + | ;: Disable router |
− | ;-- | + | ;; --distributed<code class="descclassname"> <project></code> |
− | : | + | ;: Create a distributed router The default router type (distributed vs centralized) is determined by a configuration setting in the OpenStack deployment. Since we are unable to know that default wihtout attempting to actually create a router it is suggested to use either --distributed or --centralized in situations where multiple cloud deployments may be used. |
− | ;-- | + | ;; --centralized<code class="descclassname"> <project></code> |
− | : | + | ;: Create a centralized router See the note in --distributed regarding the default used when creating a new router. |
− | ;-- | + | ;; --ha<code class="descclassname"> <project></code> |
− | : | + | ;: Create a highly available router |
− | ;-- | + | ;; --no-ha<code class="descclassname"> <project></code> |
− | : | + | ;: Create a legacy router |
− | ;-- | + | ;; --description <description> |
− | : | + | ;: Set router description |
+ | ;; --availability-zone-hint <availability-zone> | ||
+ | ;: Availability Zone in which to create this router (Router Availability Zone extension required, repeat option to set multiple availability zones) | ||
+ | ;; --tag <tag> | ||
+ | ;: Tag to be added to the router (repeat option to set multiple tags) | ||
+ | ;; --no-tag<code class="descclassname"> <project></code> | ||
+ | ;: No tags associated with the router | ||
+ | ;; <name> | ||
+ | ;: New router name | ||
==Pour aller plus loin== | ==Pour aller plus loin== |
Version du 14 août 2019 à 12:27
Sommaire
Prérequis
Créer un routeur
Les commandes suivantes sont exécutées à partir du client Openstack en ligne de commandes.
Pour créer un routeur, utiliser la commande suivante :
openstack router create Routeur-1
Nous avons besoin de connaître les réseaux à connecter au routeur.
Pour cela , il faut utiliser la commande suivante :
openstack network list
+--------------------------------------+------------------+------------------------------------------------------------------------------------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+------------------+------------------------------------------------------------------------------------------------------------------+
| 5254f8b0-0d1c-4513-9576-e490ba504556 | Reseau-1 | 98468515-f8cf-43bf-8df5-b2bf1a1c4641 |
| f3692924-e1b9-4adf-92e1-67bad3b14888 | fr-east-1-public | 5c8716e7-41c8-4104-b608-80ad568b8626, 6cebeb41-d626-4871-90ac-369f573423c8, c19c31ed-483a-42a0-9496-746228d68946 |
+--------------------------------------+------------------+------------------------------------------------------------------------------------------------------------------+
Ajouter une interface externe (publique) au routeur
openstack router set --external-gateway fr-east-1-public Routeur-1
Puis ajouter une interface sur le réseau local
openstack router add subnet Routeur-1 S-Reseau-1
Description des paramètres de la commande
openstack router create
[--project <project> [--project-domain <project-domain>]]
[--enable | --disable]
[--distributed | --centralized]
[--ha | --no-ha]
[--description <description>]
[--availability-zone-hint <availability-zone>]
[--tag <tag> | --no-tag]
<name>
- --project <project>
- Owner’s project (name or ID)
- --project-domain <project-domain>
- Domain the project belongs to (name or ID). This can be used in case collisions between project names exist.
- --enable
<project>
- Enable router (default)
- --disable
<project>
- Disable router
- --distributed
<project>
- Create a distributed router The default router type (distributed vs centralized) is determined by a configuration setting in the OpenStack deployment. Since we are unable to know that default wihtout attempting to actually create a router it is suggested to use either --distributed or --centralized in situations where multiple cloud deployments may be used.
- --centralized
<project>
- Create a centralized router See the note in --distributed regarding the default used when creating a new router.
- --ha
<project>
- Create a highly available router
- --no-ha
<project>
- Create a legacy router
- --description <description>
- Set router description
- --availability-zone-hint <availability-zone>
- Availability Zone in which to create this router (Router Availability Zone extension required, repeat option to set multiple availability zones)
- --tag <tag>
- Tag to be added to the router (repeat option to set multiple tags)
- --no-tag
<project>
- No tags associated with the router
- <name>
- New router name