Virtualisation/KVM/Bridges bond vlans : Différence entre versions
Ligne 11 : | Ligne 11 : | ||
= Comment créer des bridges sur des bonds (avec ou sans VLANS) en utilisant NetworkManager (nmcli) ? = | = Comment créer des bridges sur des bonds (avec ou sans VLANS) en utilisant NetworkManager (nmcli) ? = | ||
+ | |||
+ | Some production systems you face might make use of bonded network connections that you need to bridge in order to get VMs onto them. That bond may or may not have a native VLAN (in which case you bridge the bond), or it might have VLANs on top (in which case you want to bridge the VLANs), or perhaps you need to do both. | ||
+ | |||
+ | Let’s walk through an example where we have a bond that has a native VLAN, that also has the tagged VLAN 123 on top (and maybe a second VLAN 456), all of which need to be separately bridged. This means we will have the bond (bond0) with a matching bridge (br-bond0), plus a VLAN on the bond (bond0.123) with its matching bridge (br-vlan123). It should look something like this. | ||
+ | |||
+ | |||
== Schéma d'infra == | == Schéma d'infra == | ||
Ligne 30 : | Ligne 36 : | ||
+---------------+ | +---------------+ | ||
</CODE> | </CODE> | ||
+ | |||
+ | To make it more complicated, let’s say that the native VLAN on the bond needs a static IP and to operate at an MTU of 1500 while the other uses DHCP and needs MTU of 9000. | ||
+ | |||
+ | OK, so how do we do that? | ||
+ | |||
+ | Start by creating the bridge, then later we create the interface that attaches to that bridge. When creating VLANs, they are created on the bond, but then attached as a slave to the bridge. |
Version du 30 août 2022 à 08:20
Sites Références
Article très largement inspiré et adapté de ce site : [1]
Comment créer des bridges sur des bonds (avec ou sans VLANS) en utilisant NetworkManager (nmcli) ?
Some production systems you face might make use of bonded network connections that you need to bridge in order to get VMs onto them. That bond may or may not have a native VLAN (in which case you bridge the bond), or it might have VLANs on top (in which case you want to bridge the VLANs), or perhaps you need to do both.
Let’s walk through an example where we have a bond that has a native VLAN, that also has the tagged VLAN 123 on top (and maybe a second VLAN 456), all of which need to be separately bridged. This means we will have the bond (bond0) with a matching bridge (br-bond0), plus a VLAN on the bond (bond0.123) with its matching bridge (br-vlan123). It should look something like this.
Schéma d'infra
+------+ +---------+ +---------------+
| eth0 |---| | +------------+ | Network one |
+------+ | |----------| br-bond0 |---| (native VLAN) |
| bond0 | +------------+ +---------------+
+------+ | |
| eth1 |---| |
+------+ +---------+ +---------------+
| | +---------+ +------------+ | Network two |
| +---| vlan123 |---| br-vlan123 |---| (tagged VLAN) |
| +---------+ +------------+ +---------------+
|
| +---------+ +------------+ +---------------+
+-----| vlan456 |---| br-vlan456 |---| Network three |
+---------+ +------------+ | (tagged VLAN) |
+---------------+
To make it more complicated, let’s say that the native VLAN on the bond needs a static IP and to operate at an MTU of 1500 while the other uses DHCP and needs MTU of 9000.
OK, so how do we do that?
Start by creating the bridge, then later we create the interface that attaches to that bridge. When creating VLANs, they are created on the bond, but then attached as a slave to the bridge.