Skip to content

Resource: proxmox_network_linux_bridge

Manages a Linux Bridge network interface in a Proxmox VE node.

Example Usage

resource "proxmox_network_linux_bridge" "vmbr99" {
  depends_on = [
    proxmox_network_linux_vlan.vlan99
  ]

  node_name = "pve"
  name      = "vmbr99"

  address = "99.99.99.99/16"

  comment = "vmbr99 comment"

  ports = [
    # Network (or VLAN) interfaces to attach to the bridge, specified by their interface name
    # (e.g. "ens18.99" for VLAN 99 on interface ens18).
    # For VLAN interfaces with custom names, use the interface name without the VLAN tag, e.g. "vlan_lab"
    "ens18.99"
  ]

  # VLAN-aware bridge: permit any tagged VLAN through. Segmentation typically
  # lives upstream (switch / firewall), not on the hypervisor bridge.
  vlan_aware = true
  vids       = "2-4094"
}

resource "proxmox_network_linux_vlan" "vlan99" {
  node_name = "pve"
  name      = "ens18.99"

  ## or alternatively, use custom name:
  # name      = "vlan_lab"
  # interface = "eno0"
  # vlan      = 98
}

Schema

Required

  • name (String) The interface name. Commonly vmbr[N], where 0 ≤ N ≤ 4094 (vmbr0 - vmbr4094), but can be any string containing only letters, numbers, and underscores (_), starting with a letter and at most 10 characters long.
  • node_name (String) The name of the node.

Optional

  • address (String) The interface IPv4/CIDR address.
  • address6 (String) The interface IPv6/CIDR address.
  • autostart (Boolean) Automatically start interface on boot (defaults to true).
  • comment (String) Comment for the interface.
  • gateway (String) Default gateway address.
  • gateway6 (String) Default IPv6 gateway address.
  • mtu (Number) The interface MTU.
  • ports (List of String) The interface bridge ports.
  • timeout_reload (Number) Timeout for network reload operations in seconds (defaults to 100).
  • vids (String) VLAN IDs allowed on the bridge (Linux Bridge bridge-vids). Space-separated list of VLAN IDs and/or hyphenated ranges (e.g. "2-4094", "1 20 130", or "1 10-20 30"). Requires vlan_aware = true. PVE/ifupdown2 fills in 2-4094 as the implicit default for VLAN-aware bridges when this attribute is omitted; the provider surfaces that default in state.
  • vlan_aware (Boolean) Whether the interface bridge is VLAN aware (defaults to false).

Read-Only

  • id (String) A unique identifier with format <node name>:<iface>

Import

Import is supported using the following syntax:

#!/usr/bin/env sh
# Interfaces can be imported using the `node_name:iface` format, e.g.
terraform import proxmox_network_linux_bridge.vmbr99 pve:vmbr99