kb:cheatsheet:openvswitch
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| kb:cheatsheet:openvswitch [2018/09/23 17:34] – beu | kb:cheatsheet:openvswitch [2019/08/23 13:15] (Version actuelle) – beu | ||
|---|---|---|---|
| Ligne 10: | Ligne 10: | ||
| <code bash> | <code bash> | ||
| - | # ovs-vsctl add-br | + | # ovs-vsctl add-br |
| </ | </ | ||
| Ligne 16: | Ligne 16: | ||
| <code bash> | <code bash> | ||
| - | # ovs-vsctl del-br | + | # ovs-vsctl del-br |
| </ | </ | ||
| - | Pour y ajouter un port physique en mode access: | + | Pour y ajouter un port physique en mode trunk : |
| <code bash> | <code bash> | ||
| - | # ovs-vsctl add-port | + | # ovs-vsctl add-port |
| + | </ | ||
| + | |||
| + | ou en mode access : | ||
| + | |||
| + | <code bash> | ||
| + | # ovs-vsctl add-port vmbr0 eth0 tag=30 vlan_mode=access | ||
| </ | </ | ||
| Ligne 28: | Ligne 34: | ||
| <code bash> | <code bash> | ||
| - | # ovs-vsctl add-port | + | # ovs-vsctl add-port |
| </ | </ | ||
| - | ou pour créer et ajouter une interface interne | + | ou en mode mixte : |
| <code bash> | <code bash> | ||
| - | # ovs=vsctl add-port | + | # ovs-vsctl add-port |
| </ | </ | ||
| + | Pour créer et ajouter une interface interne : | ||
| + | |||
| + | <code bash> | ||
| + | # ovs=vsctl add-port vmbr0 vlan30 tag=30 -- set interface vlan9 type=internal | ||
| + | </ | ||
| + | |||
| + | Toutes les options peuvent être mise en place via la commande : | ||
| + | |||
| + | <code bash> | ||
| + | # ovs-vsctl set interface eth0 tag=20 vlan_mode=native-untagged trunks=30, | ||
| + | </ | ||
| ====Les bonds==== | ====Les bonds==== | ||
| + | Pour créer un bond : | ||
| + | |||
| + | <code bash> | ||
| + | # ovs=vsctl add-bond vmbr0 eth0 eth1 lacp=active bond_mode=balance-slb other_config: | ||
| + | </ | ||
| - | =====Configuration en fichier de configuration===== | + | =====Configuration en fichier de configuration |
| A noter que toutes les interfaces peuvent avoir une IP fixe ou par DHCP (même si aucun intérêt sur les ports externes). | A noter que toutes les interfaces peuvent avoir une IP fixe ou par DHCP (même si aucun intérêt sur les ports externes). | ||
| Ligne 50: | Ligne 72: | ||
| Les bridges se configure comme ceci : | Les bridges se configure comme ceci : | ||
| < | < | ||
| - | auto ovsbr0 | + | auto vmbr0 |
| - | allow-ovs | + | allow-ovs |
| - | iface ovsbr0 | + | iface vmbr0 inet manual |
| ovs_type OVSBridge | ovs_type OVSBridge | ||
| ovs_ports eth0 vlan30 | ovs_ports eth0 vlan30 | ||
| Ligne 64: | Ligne 86: | ||
| < | < | ||
| auto eth0 | auto eth0 | ||
| - | allow-ovsbr0 | + | allow-vmbr0 eth0 |
| iface eth0 inet manual | iface eth0 inet manual | ||
| - | ovs_bridge | + | ovs_bridge |
| ovs_type OVSPort | ovs_type OVSPort | ||
| </ | </ | ||
| Ligne 92: | Ligne 114: | ||
| < | < | ||
| - | allow-ovsbr0 | + | auto vlan30 |
| + | allow-vmbr0 vlan30 | ||
| iface vlan30 inet manual | iface vlan30 inet manual | ||
| ovs_type OVSIntPort | ovs_type OVSIntPort | ||
| - | ovs_bridge | + | ovs_bridge |
| ovs_options tag=30 | ovs_options tag=30 | ||
| </ | </ | ||
| Ligne 106: | Ligne 129: | ||
| < | < | ||
| - | allow-ovsbr0 | + | auto bond0 |
| + | allow-vmbr0 bond0 | ||
| iface bond0 inet manual | iface bond0 inet manual | ||
| ovs_type OVSBond | ovs_type OVSBond | ||
| - | ovs_bridge | + | ovs_bridge |
| ovs_bonds eth1 eth2 | ovs_bonds eth1 eth2 | ||
| ovs_options bond_mode=active-backup | ovs_options bond_mode=active-backup | ||
| Ligne 117: | Ligne 141: | ||
| < | < | ||
| - | allow-ovsbr0 | + | auto bond0 |
| + | allow-vmbr0 bond0 | ||
| iface bond0 inet manual | iface bond0 inet manual | ||
| ovs_type OVSBond | ovs_type OVSBond | ||
| - | ovs_bridge | + | ovs_bridge |
| ovs_bonds eth1 eth2 | ovs_bonds eth1 eth2 | ||
| ovs_options bond_mode=balance-slb lacp=active other_config: | ovs_options bond_mode=balance-slb lacp=active other_config: | ||
| </ | </ | ||
| - | Voici un [[kb:linux: | + | Voici un {{ :kb:cheatsheet:ovs_sample.txt |exemple de configuration}} |
| + | |||
| + | Vous trouverez la documentation officiel [[https:// | ||
| ---- | ---- | ||
kb/cheatsheet/openvswitch.1537724047.txt.gz · Dernière modification : de beu
