Créer un routeur en ligne de commande : Différence entre versions

De Hopla.cloud OpenStack Documentation Wiki
Aller à : navigation, rechercher
(Description des paramètres de la commande)
Ligne 46 : Ligne 46 :
 
</syntaxhighlight>
 
</syntaxhighlight>
  
;; --project <project>
+
; --project <project>
;: Owner’s project (name or ID)
+
: Owner’s project (name or ID)
;; --project-domain <project-domain>
+
; --project-domain <project-domain>
;: Domain the project belongs to (name or ID). This can be used in case collisions between project names exist.
+
: 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<code class="descclassname"> <project></code>
;: Enable router (default)
+
: Enable router (default)
;; --disable<code class="descclassname"> <project></code>
+
; --disable<code class="descclassname"> <project></code>
;: Disable router
+
: Disable router
;; --distributed<code class="descclassname"> <project></code>
+
; --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.
+
: 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>
+
; --centralized<code class="descclassname"> <project></code>
;: Create a centralized router  See the note in --distributed regarding the default used when creating a new router.
+
: Create a centralized router  See the note in --distributed regarding the default used when creating a new router.
;; --ha<code class="descclassname"> <project></code>
+
; --ha<code class="descclassname"> <project></code>
;: Create a highly available router
+
: Create a highly available router
;; --no-ha<code class="descclassname"> <project></code>
+
; --no-ha<code class="descclassname"> <project></code>
;: Create a legacy router
+
: Create a legacy router
;; --description <description>
+
; --description <description>: Set router description
;: Set router description
+
; --availability-zone-hint <availability-zone>
;; --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)
;: Availability Zone in which to create this router (Router Availability Zone extension required, repeat option to set multiple availability zones)
+
; --tag <tag>
;; --tag <tag>
+
: Tag to be added to the router (repeat option to set multiple tags)
;: Tag to be added to the router (repeat option to set multiple tags)
+
; --no-tag<code class="descclassname"> <project></code>
;; --no-tag<code class="descclassname"> <project></code>
+
: No tags associated with the router
;: No tags associated with the router
+
; <name>
;; <name>
+
: New router name
;: New router name
 
  
 
==Pour aller plus loin==
 
==Pour aller plus loin==

Version du 14 août 2019 à 12:27

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

Pour aller plus loin