Bridge networking per VM e container
Un bridge di rete collega interfacce fisiche e virtuali sullo stesso segmento L2. Essenziale per dare alle VM un IP nella LAN reale.
1. Installazione
apt install bridge-utils -y
2. Configurazione con Netplan (Ubuntu/Debian)
# /etc/netplan/01-bridge.yaml
network:
version: 2
ethernets:
enp0s3:
dhcp4: no
bridges:
br0:
interfaces: [enp0s3]
addresses: [192.168.1.92/24]
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [192.168.1.1, 8.8.8.8]
parameters:
stp: false
forward-delay: 0
3. Applicare
netplan apply
4. Configurazione con /etc/network/interfaces
auto br0
iface br0 inet static
bridge_ports enp0s3
address 192.168.1.92
netmask 255.255.255.0
gateway 192.168.1.1
bridge_stp off
bridge_fd 0
5. Bridge in Proxmox
Proxmox crea automaticamente vmbr0. Per aggiungere bridge aggiuntivi (es. per VLAN):
auto vmbr1
iface vmbr1 inet static
address 192.168.20.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
6. Verifica
brctl show
ip addr show br0
bridge link
I bridge sono la base del networking in Proxmox: ogni VM si collega a un bridge per comunicare con la rete.