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

De Hopla.cloud OpenStack Documentation Wiki
Aller à : navigation, rechercher
(Pour aller plus loin)
(Description des paramètres de la commande)
Ligne 22 : Ligne 22 :
 
==Description des paramètres de la commande==
 
==Description des paramètres de la commande==
 
<syntaxhighlight lang="shell">
 
<syntaxhighlight lang="shell">
openstack loadbalancer member create
+
openstack network create
     [-f {json,shell,table,value,yaml}]
+
     [--project <project> [--project-domain <project-domain>]]
    [-c COLUMN]
 
    [--max-width <integer>]
 
    [--fit-width]
 
    [--print-empty]
 
    [--noindent]
 
    [--prefix PREFIX]
 
    [--name <name>]
 
    [--weight <weight>]
 
    --address <ip_address>
 
    [--subnet-id <subnet_id>]
 
    --protocol-port <protocol_port>
 
    [--monitor-port <monitor_port>]
 
    [--monitor-address <monitor_address>]
 
 
     [--enable | --disable]
 
     [--enable | --disable]
     <pool>
+
     [--share | --no-share]
 +
    [--description <description>]
 +
    [--mtu <mtu>]
 +
    [--availability-zone-hint <availability-zone>]
 +
    [--enable-port-security | --disable-port-security]
 +
    [--external [--default | --no-default] | --internal]
 +
    [--provider-network-type <provider-network-type>]
 +
    [--provider-physical-network <provider-physical-network>]
 +
    [--provider-segment <provider-segment>]
 +
    [--qos-policy <qos-policy>]
 +
    [--transparent-vlan | --no-transparent-vlan]
 +
    [--tag <tag> | --no-tag]
 +
    <name>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
;-f <FORMATTER>, --format <FORMATTER>
+
;; --project <project>
:Le format de sortie, par défaut en tableau.
+
;: Owner’s project (name or ID)  Network version 2 only
;-c COLUMN, --column COLUMN
+
;; --project-domain <project-domain>
:Spécifie la ou les colonnes à inclure, peut être répété.
+
;: Domain the project belongs to (name or ID). This can be used in case collisions between project names exist. Network version 2 only
;--max-width <integer>
+
;; --enable<code class="descclassname"> <project></code>¶
:Largeur maximale d'affichage, <1 à désactiver . Vous pouvez également utiliser la variable d'environnement CLIFF_MAX_TERM_WIDTH, mais le paramètre est prioritaire.
+
;: Enable network (default)  Network version 2 only
;--fit-width
+
;; --disable<code class="descclassname"> <project></code>¶
:Ajuste le tableau à la largeur d'affichage. Implicite si --max-width est supérieur à 0. Définissez la variable d'environnement CLIFF_FIT_WIDTH=1 pour que ce soit toujours activé.
+
;: Disable network  Network version 2 only
;--print-empty
+
;; --share<code class="descclassname"> <project></code>¶
:Affiche un tableau vide s'il n'y a aucune donnée à afficher.
+
;: Share the network between projects
;--noindent
+
;; --no-share<code class="descclassname"> <project></code>¶
:S'il faut désactiver l'indentation du JSON.
+
;: Do not share the network between projects
;--prefix <PREFIX>
+
;; --description <description>¶
:ajoute un préfixe à tous les noms de variables.
+
;: Set network description  Network version 2 only
;--name <name>
+
;; --mtu <mtu>
:Définit le nom du port d'écoute.
+
;: Set network mtu  Network version 2 only
;--weight <weight>
+
;; --availability-zone-hint <availability-zone>¶
:Le poids d'un membre détermine la portion des requêtes ou connexions qu'il dessert par rapport aux autres membres du pool.
+
;: Availability Zone in which to create this network (Network Availability Zone extension required, repeat option to set multiple availability zones)  Network version 2 only
;--address <ip_address>
+
;; --enable-port-security<code class="descclassname"> <project></code>¶
:L'adresse IP du serveur membre du backend.
+
;: Enable port security by default for ports created on this network (default)  Network version 2 only
;--subnet-id <subnet_id>
+
;; --disable-port-security<code class="descclassname"> <project></code>¶
:l'ID du sous réseau à partir duquel le service membre est accessible.
+
;: Disable port security by default for ports created on this network  Network version 2 only
;--protocol-port <protocol_port>
+
;; --subnet <subnet>¶
:Le numéro du port de protocole sur lequel le serveur membre du backend écoute.
+
;: IPv4 subnet for fixed IPs (in CIDR notation)  Compute version 2 only
;--monitor-port <monitor_port>
+
;; --external<code class="descclassname"> <project></code>¶
:Un autre port de protocole utilisé pour la surveillance de l'intégrité d'un membre du backend.
+
;: Set this network as an external network (external-net extension required)  Network version 2 only
;--monitor-address <monitor_address>
+
;; --internal<code class="descclassname"> <project></code>¶
:Une autre adresse IP utilisée pour surveille l'intégrité d'un membre du backend.
+
;: Set this network as an internal network (default)  Network version 2 only
;--enable
+
;; --default<code class="descclassname"> <project></code>¶
:Activer le port d'écoute (par défaut).
+
;: Specify if this network should be used as the default external network  Network version 2 only
;--disable
+
;; --no-default<code class="descclassname"> <project></code>
:Désactiver le port d'écoute.
+
;: Do not use the network as the default external network (default)  Network version 2 only
 
+
;; --provider-network-type <provider-network-type>
 +
;: The physical mechanism by which the virtual network is implemented. The supported options are: flat, geneve, gre, local, vlan, vxlan.  Network version 2 only
 +
;; --provider-physical-network <provider-physical-network>
 +
;: Name of the physical network over which the virtual network is implemented  Network version 2 only
 +
;; --provider-segment <provider-segment>
 +
;: VLAN ID for VLAN networks or Tunnel ID for GENEVE/GRE/VXLAN networks  Network version 2 only
 +
;; --qos-policy <qos-policy>
 +
;: QoS policy to attach to this network (name or ID)  Network version 2 only
 +
;; --transparent-vlan<code class="descclassname"> <project></code>
 +
;: Make the network VLAN transparent  Network version 2 only
 +
;; --no-transparent-vlan<code class="descclassname"> <project></code>¶
 +
;: Do not make the network VLAN transparent  Network version 2 only
 +
;; --tag <tag>¶
 +
;: Tag to be added to the network (repeat option to set multiple tags) Network version 2 only
 +
;; --no-tag<code class="descclassname"> <project></code>¶
 +
;: No tags associated with the network  Network version 2 only
 +
;; <name>
 +
;: New network name
  
 
==Pour aller plus loin==
 
==Pour aller plus loin==

Version du 14 août 2019 à 13:16

Prérequis

Créer un réseau

Les commandes suivantes sont exécutées à partir du client Openstack et l'extension octavia en ligne de commande

Pour créer un réseau, utiliser la commande suivante :

openstack network create Reseau-1

Pour ajouter un sous-réseau au Reseau-1 utiliser la commande suivante :

Par défaut, le DHCP sera activé et le pool d'allocation sera de x.2 à x.254. L'adresse x.1 est réservée pour la passerelle.

openstack subnet create --network Reseau-1 --subnet-range 192.168.0.0/24 S-Reseau-1
openstack subnet set --dns-nameserver 8.8.8.8 S-Reseau-1

Description des paramètres de la commande

openstack network create
    [--project <project> [--project-domain <project-domain>]]
    [--enable | --disable]
    [--share | --no-share]
    [--description <description>]
    [--mtu <mtu>]
    [--availability-zone-hint <availability-zone>]
    [--enable-port-security | --disable-port-security]
    [--external [--default | --no-default] | --internal]
    [--provider-network-type <provider-network-type>]
    [--provider-physical-network <provider-physical-network>]
    [--provider-segment <provider-segment>]
    [--qos-policy <qos-policy>]
    [--transparent-vlan | --no-transparent-vlan]
    [--tag <tag> | --no-tag]
    <name>
--project <project>¶
Owner’s project (name or ID) Network version 2 only
--project-domain <project-domain>¶
Domain the project belongs to (name or ID). This can be used in case collisions between project names exist. Network version 2 only
--enable <project>
Enable network (default) Network version 2 only
--disable <project>
Disable network Network version 2 only
--share <project>
Share the network between projects
--no-share <project>
Do not share the network between projects
--description <description>¶
Set network description Network version 2 only
--mtu <mtu>¶
Set network mtu Network version 2 only
--availability-zone-hint <availability-zone>¶
Availability Zone in which to create this network (Network Availability Zone extension required, repeat option to set multiple availability zones) Network version 2 only
--enable-port-security <project>
Enable port security by default for ports created on this network (default) Network version 2 only
--disable-port-security <project>
Disable port security by default for ports created on this network Network version 2 only
--subnet <subnet>¶
IPv4 subnet for fixed IPs (in CIDR notation) Compute version 2 only
--external <project>
Set this network as an external network (external-net extension required) Network version 2 only
--internal <project>
Set this network as an internal network (default) Network version 2 only
--default <project>
Specify if this network should be used as the default external network Network version 2 only
--no-default <project>
Do not use the network as the default external network (default) Network version 2 only
--provider-network-type <provider-network-type>¶
The physical mechanism by which the virtual network is implemented. The supported options are: flat, geneve, gre, local, vlan, vxlan. Network version 2 only
--provider-physical-network <provider-physical-network>¶
Name of the physical network over which the virtual network is implemented Network version 2 only
--provider-segment <provider-segment>¶
VLAN ID for VLAN networks or Tunnel ID for GENEVE/GRE/VXLAN networks Network version 2 only
--qos-policy <qos-policy>¶
QoS policy to attach to this network (name or ID) Network version 2 only
--transparent-vlan <project>
Make the network VLAN transparent Network version 2 only
--no-transparent-vlan <project>
Do not make the network VLAN transparent Network version 2 only
--tag <tag>¶
Tag to be added to the network (repeat option to set multiple tags) Network version 2 only
--no-tag <project>
No tags associated with the network Network version 2 only
<name>
New network name

Pour aller plus loin