Auto-update blog content from Obsidian: 2025-09-12 09:47:06
All checks were successful
Blog Deployment / Check-Rebuild (push) Successful in 6s
Blog Deployment / Build (push) Has been skipped
Blog Deployment / Deploy-Staging (push) Successful in 11s
Blog Deployment / Test-Staging (push) Successful in 2s
Blog Deployment / Merge (push) Successful in 5s
Blog Deployment / Deploy-Production (push) Successful in 9s
Blog Deployment / Test-Production (push) Successful in 2s
Blog Deployment / Clean (push) Has been skipped
Blog Deployment / Notify (push) Successful in 3s
All checks were successful
Blog Deployment / Check-Rebuild (push) Successful in 6s
Blog Deployment / Build (push) Has been skipped
Blog Deployment / Deploy-Staging (push) Successful in 11s
Blog Deployment / Test-Staging (push) Successful in 2s
Blog Deployment / Merge (push) Successful in 5s
Blog Deployment / Deploy-Production (push) Successful in 9s
Blog Deployment / Test-Production (push) Successful in 2s
Blog Deployment / Clean (push) Has been skipped
Blog Deployment / Notify (push) Successful in 3s
This commit is contained in:
147
content/post/11-proxmox-cluster-networking-sdn.fr.md
Normal file
147
content/post/11-proxmox-cluster-networking-sdn.fr.md
Normal file
@@ -0,0 +1,147 @@
|
||||
---
|
||||
slug: proxmox-cluster-networking-sdn
|
||||
title: Simplifier la gestion des VLAN dans Proxmox VE avec le SDN
|
||||
description: Découvrez comment centraliser la configuration des VLAN dans Proxmox VE grâce aux zones SDN et aux VNets, pour un réseau plus simple et cohérent
|
||||
date: 2025-09-12
|
||||
draft: true
|
||||
tags:
|
||||
- proxmox
|
||||
categories:
|
||||
- homelab
|
||||
---
|
||||
|
||||
## Intro
|
||||
|
||||
Quand j’ai construit mon cluster **Proxmox VE 8** pour la première fois, le réseau n’était pas ma priorité. Je voulais simplement remplacer rapidement un vieux serveur physique, alors j’ai donné la même configuration de base à chacun de mes trois nœuds, créé le cluster et commencé à créer des VM :
|
||||

|
||||
|
||||
Cela a bien fonctionné pendant un moment. Mais comme je prévois de virtualiser mon routeur **OPNsense**, j’ai besoin de quelque chose de plus structuré et cohérent. C’est là que la fonctionnalité **S**oftware-**D**efined **N**etworking (SDN) de Proxmox entre en jeu.
|
||||
|
||||
---
|
||||
## Mon Réseau Homelab
|
||||
|
||||
Par défaut, chaque nœud Proxmox dispose de sa propre zone locale, appelée `localnetwork`, qui contient le pont Linux par défaut (`vmbr0`) comme VNet :
|
||||

|
||||
|
||||
C’est suffisant pour des configurations isolées, mais rien n’est coordonné au niveau du cluster.
|
||||
|
||||
Mon objectif est simple : déclarer les VLAN que j’utilise déjà dans mon réseau, afin de pouvoir y rattacher des VM facilement depuis n’importe quel nœud.
|
||||
|
||||
Voici la liste des VLAN que j’utilise actuellement :
|
||||
|
||||
| Nom | ID | Usage |
|
||||
| --------- | ---- | ------------------------------ |
|
||||
| Mgmt | 1 | Administration |
|
||||
| User | 13 | Réseau domestique |
|
||||
| IoT | 37 | IoT et équipements non fiables |
|
||||
| DMZ | 55 | Services exposés à Internet |
|
||||
| Lab | 66 | Réseau de lab |
|
||||
| Heartbeat | 77 | Heartbeat du cluster Proxmox |
|
||||
| Ceph | 99 | Stockage Ceph |
|
||||
| VPN | 1337 | Réseau WireGuard |
|
||||
|
||||
---
|
||||
## Aperçu du SDN Proxmox
|
||||
|
||||
Le Software-Defined Networking de Proxmox permet de définir des zones et réseaux virtuels à l’échelle du cluster. Au lieu de répéter la configuration des VLAN sur chaque nœud, le SDN offre une vue centralisée et assure la cohérence.
|
||||
|
||||
En interne, Proxmox repose essentiellement sur les fonctionnalités réseau standard de Linux, ce qui évite d’ajouter des dépendances externes et garantit la stabilité.
|
||||
|
||||
Les configurations SDN sont stockées dans `/etc/pve/sdn` et répliquées sur l’ensemble du cluster. Les changements sont appliqués de manière atomique (on prépare les modifications puis on clique sur `Apply`), ce qui rend les déploiements plus sûrs.
|
||||
|
||||
### Zones
|
||||
|
||||
Une **Zone** définit un domaine réseau séparé. Les zones peuvent couvrir certains nœuds et contenir des **VNets**.
|
||||
|
||||
Proxmox prend en charge plusieurs types de zones :
|
||||
- **Simple** : pont isolé (bridge) avec routage L3/NAT
|
||||
- **VLAN** : segmentation classique via VLAN
|
||||
- **QinQ** : empilement de VLAN (IEEE 802.1ad)
|
||||
- **VXLAN** : réseau L2 via encapsulation UDP
|
||||
- **EVPN** : VXLAN avec BGP pour du routage L3 dynamique
|
||||
|
||||
Comme mon réseau domestique utilise déjà des VLAN, j’ai créé une **zone VLAN** appelée `homelan`, en utilisant `vmbr0` comme pont et en l’appliquant à tout le cluster :
|
||||

|
||||
|
||||
### VNets
|
||||
|
||||
Un **VNet** est un réseau virtuel à l’intérieur d’une zone. Dans une zone VLAN, chaque VNet correspond à un ID VLAN spécifique.
|
||||
|
||||
J’ai commencé par créer `vlan55` dans la zone `homelan` pour mon réseau DMZ :
|
||||

|
||||
|
||||
Puis j’ai ajouté les VNets correspondant à la plupart de mes VLAN, puisque je prévois de les rattacher à une VM OPNsense :
|
||||

|
||||
|
||||
Enfin, j’ai appliqué la configuration dans **Datacenter → SDN** :
|
||||

|
||||
|
||||
---
|
||||
## Test de la Configuration Réseau
|
||||
|
||||
Dans une vieille VM que je n'utilise plus, je remplace l'actuel `vmbr0` avec le VLAN tag 66 par mon nouveau VNet `vlan66`:
|
||||

|
||||
|
||||
Après l'avoir démarrée, la VM obtient une IP du DHCP d'OPNsense sur ce VLAN, ce qui est super. J'essaye également de ping une autre machine et ça fonctionne :
|
||||

|
||||
|
||||
## Mise à jour de Cloud-Init et Terraform
|
||||
|
||||
Pour aller plus loin, j’ai mis à jour le pont réseau utilisé dans mon **template cloud-init**, dont j'avais détaillé la création dans [cet article]({{< ref "post/1-proxmox-cloud-init-vm-template" >}}).
|
||||
Comme avec la VM précédente, j’ai remplacé `vmbr0` et le tag VLAN 66 par le nouveau VNet `vlan66`.
|
||||
|
||||
J’ai aussi adapté mon code **Terraform** pour refléter ce changement :
|
||||

|
||||
|
||||
Ensuite, j’ai validé qu’aucune régression n’était introduite en déployant une VM de test :
|
||||
```bash
|
||||
terraform apply -var 'vm_name=vm-test-vnet'
|
||||
```
|
||||
```plaintext
|
||||
data.proxmox_virtual_environment_vms.template: Reading...
|
||||
data.proxmox_virtual_environment_vms.template: Read complete after 0s [id=23b17aea-d9f7-4f28-847f-41bb013262ea]
|
||||
[...]
|
||||
Plan: 2 to add, 0 to change, 0 to destroy.
|
||||
|
||||
Changes to Outputs:
|
||||
+ vm_ip = (known after apply)
|
||||
|
||||
Do you want to perform these actions?
|
||||
Terraform will perform the actions described above.
|
||||
Only 'yes' will be accepted to approve.
|
||||
|
||||
Enter a value: yes
|
||||
|
||||
proxmox_virtual_environment_file.cloud_config: Creating...
|
||||
proxmox_virtual_environment_file.cloud_config: Creation complete after 1s [id=local:snippets/vm.cloud-config.yaml]
|
||||
proxmox_virtual_environment_vm.vm: Creating...
|
||||
proxmox_virtual_environment_vm.vm: Still creating... [10s elapsed]
|
||||
[...]
|
||||
proxmox_virtual_environment_vm.vm: Still creating... [3m0s elapsed]
|
||||
proxmox_virtual_environment_vm.vm: Creation complete after 3m9s [id=119]
|
||||
|
||||
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
|
||||
|
||||
Outputs:
|
||||
|
||||
vm_ip = "192.168.66.181"
|
||||
```
|
||||
|
||||
La création s’est déroulée sans problème, tout est bon :
|
||||

|
||||
|
||||
---
|
||||
## Conclusion
|
||||
|
||||
La mise en place du SDN Proxmox avec une **zone VLAN** est simple et très pratique. Au lieu de définir manuellement un VLAN sur chaque VM, je sélectionne désormais directement le bon VNet, et tout reste cohérent dans le cluster.
|
||||
|
||||
| Étape | Avant SDN | Après SDN |
|
||||
| -------------------- | ----------------------------- | ----------------------------------- |
|
||||
| Rattacher une VM | `vmbr0` + tag VLAN manuel | Sélection du VNet approprié |
|
||||
| VLANs sur les nœuds | Config répété sur chaque nœud | Centralisé via le SDN du cluster |
|
||||
| Gestion des adresses | Manuel ou via DHCP uniquement | IPAM optionnel via sous-réseaux SDN |
|
||||
|
||||
Mon cluster est maintenant prêt à héberger mon **routeur OPNsense**, et cette base ouvre la voie à d’autres expérimentations, comme les overlays VXLAN ou l’EVPN avec BGP.
|
||||
|
||||
À suivre pour la prochaine étape !
|
||||
|
@@ -1,8 +1,8 @@
|
||||
---
|
||||
slug: proxmox-cluster-networking-sdn
|
||||
title: Template
|
||||
description:
|
||||
date:
|
||||
title: Simplifying VLAN Management in Proxmox VE with SDN
|
||||
description: Learn how to centralize VLAN configuration in Proxmox VE using SDN zones and VNets, making VM networking easier and more consistent.
|
||||
date: 2025-09-12
|
||||
draft: true
|
||||
tags:
|
||||
- proxmox
|
||||
@@ -13,7 +13,7 @@ categories:
|
||||
## Intro
|
||||
|
||||
When I first built my **Proxmox VE 8** cluster, networking wasn’t my main concern. I just wanted to replace an old physical server quickly, so I gave each of my three nodes the same basic config, created the cluster, and started running VMs:
|
||||

|
||||

|
||||
|
||||
That worked fine for a while. But as I plan to virtualize my **OPNsense** router, I need something more structured and consistent. This is where Proxmox **S**oftware-**D**efined **N**etworking (SDN) feature comes in.
|
||||
|
||||
@@ -21,7 +21,7 @@ That worked fine for a while. But as I plan to virtualize my **OPNsense** router
|
||||
## My Homelab Network
|
||||
|
||||
By default, every Proxmox node comes with its own local zone, called `localnetwork`, which contains the default Linux bridge (`vmbr0`) as a VNet:
|
||||

|
||||

|
||||
|
||||
That’s fine for isolated setups, but at the cluster level nothing is coordinated.
|
||||
|
||||
@@ -35,11 +35,12 @@ Here’s the list of VLANs I use today:
|
||||
| User | 13 | Home network |
|
||||
| IoT | 37 | IoT and untrusted equipments |
|
||||
| DMZ | 55 | Internet facing |
|
||||
| Lab | 66 | Lab network, trusted |
|
||||
| Lab | 66 | Lab network |
|
||||
| Heartbeat | 77 | Proxmox cluster heartbeat |
|
||||
| Ceph | 99 | Ceph |
|
||||
| Ceph | 99 | Ceph storage |
|
||||
| VPN | 1337 | Wireguard network |
|
||||
|
||||
---
|
||||
## Proxmox SDN Overview
|
||||
|
||||
Proxmox Software-Defined Networking makes it possible to define cluster-wide virtual zones and networks. Instead of repeating VLAN configs on every node, SDN gives you a central view and ensures consistency.
|
||||
@@ -73,7 +74,7 @@ Then I added VNets for most of my VLANs, since I plan to attach them to an OPNse
|
||||

|
||||
|
||||
Finally, I applied the configuration in **Datacenter → SDN**:
|
||||

|
||||

|
||||
|
||||
---
|
||||
## Test the Network Configuration
|
||||
@@ -86,10 +87,10 @@ After starting it, the VM gets an IP from the DHCP on OPNsense on that VLAN, whi
|
||||
|
||||
## Update Cloud-Init Template and Terraform
|
||||
|
||||
To go further, I update the bridge used in my cloud-init template, which I detailed the creation in that [post]({{< ref "post/1-proxmox-cloud-init-vm-template" >}}). Pretty much the same thing I've done with the VM, I replace the current `vmbr0` with VLAN tag 66 with my new VNet `vlan66`.
|
||||
To go further, I update the bridge used in my **cloud-init** template, which I detailed the creation in that [post]({{< ref "post/1-proxmox-cloud-init-vm-template" >}}). Pretty much the same thing I've done with the VM, I replace the current `vmbr0` with VLAN tag 66 with my new VNet `vlan66`.
|
||||
|
||||
I also update the Terrafom code to take this change into account:
|
||||

|
||||
I also update the **Terrafom** code to take this change into account:
|
||||

|
||||
|
||||
I quicky check if I don't have regression and can still deploy a VM with Terraform:
|
||||
```bash
|
||||
@@ -126,11 +127,21 @@ vm_ip = "192.168.66.181"
|
||||
```
|
||||
|
||||
The VM is deploying without any issue, everything is OK:
|
||||

|
||||

|
||||
|
||||
---
|
||||
## Conclusion
|
||||
|
||||
The implementation of the Proxmox SDN for a VLAN zone is pretty straightforward. I'd like to experiment the other types of zone to see what we can do with them.
|
||||
Setting up Proxmox SDN with a **VLAN zone** turned out to be straightforward and very useful. Instead of tagging VLANs manually per VM, I now just pick the right VNet, and everything stays consistent across the cluster.
|
||||
|
||||
| Step | Before SDN | After SDN |
|
||||
| ----------------- | ------------------------------- | ------------------------------ |
|
||||
| Attach VM to VLAN | `vmbr0` + set VLAN tag manually | Select the right VNet directly |
|
||||
| VLANs on nodes | Repeated config per node | Centralized in cluster SDN |
|
||||
| IP management | Manual or DHCP only | Optional IPAM via SDN subnets |
|
||||
|
||||
This prepares my cluster to host my **OPNsense router**, and it also sets the stage for future experiments, like trying out VXLAN overlays or EVPN with BGP.
|
||||
|
||||
See you next time for the next step!
|
||||
|
||||
|
||||
Now my Proxmox VE cluster is ready to host my OPNsense router, see you next time!
|
Reference in New Issue
Block a user