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 16:53] – beu | kb:cheatsheet:openvswitch [2019/08/23 13:15] (Version actuelle) – beu | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
======Cheatsheet OpenVSwitch====== | ======Cheatsheet OpenVSwitch====== | ||
+ | ====Configuration en lignes de commande==== | ||
+ | Cette méthode permet modifier vos configurations réseau sans coupures. | ||
+ | |||
+ | ====Les bridges==== | ||
+ | |||
+ | Pour créer un bridge, il suffit de taper : | ||
+ | |||
+ | <code bash> | ||
+ | # ovs-vsctl add-br vmbr0 | ||
+ | </ | ||
+ | |||
+ | et pour le supprimer : | ||
+ | |||
+ | <code bash> | ||
+ | # ovs-vsctl del-br vmbr0 | ||
+ | </ | ||
+ | |||
+ | Pour y ajouter un port physique en mode trunk : | ||
+ | |||
+ | <code bash> | ||
+ | # ovs-vsctl add-port vmbr0 eth0 | ||
+ | </ | ||
+ | |||
+ | ou en mode access : | ||
+ | |||
+ | <code bash> | ||
+ | # ovs-vsctl add-port vmbr0 eth0 tag=30 vlan_mode=access | ||
+ | </ | ||
+ | |||
+ | ou une interface trunk : | ||
+ | |||
+ | <code bash> | ||
+ | # ovs-vsctl add-port vmbr0 eth0 | ||
+ | </ | ||
+ | |||
+ | ou en mode mixte : | ||
+ | |||
+ | <code bash> | ||
+ | # ovs-vsctl add-port vmbr0 eth0 tag=20 vlan_mode=native-untagged trunks=30, | ||
+ | </ | ||
+ | |||
+ | 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==== | ||
+ | |||
+ | Pour créer un bond : | ||
+ | |||
+ | <code bash> | ||
+ | # ovs=vsctl add-bond vmbr0 eth0 eth1 lacp=active bond_mode=balance-slb other_config: | ||
+ | </ | ||
- | =====Configuration | + | =====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 12: | 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 | ||
</ | </ | ||
- | |||
- | Voir [[kb: | ||
Ligne 28: | 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 56: | 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 70: | 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 81: | 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.1537721604.txt.gz · Dernière modification : 2018/09/23 16:53 de beu