Créer un réseau en ligne de commande
De Hopla.cloud OpenStack Documentation Wiki
Révision datée du 14 août 2019 à 13:17 par Amoreau (discussion | contributions) (→Description des paramètres de la commande)
Sommaire
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