freebox_port_forwarding (Resource)

Manages a port forwarding between a local network host and the Freebox Internet Gateway.

Note: To have access to the full port range, you need to enable the Full Stack IP (see the Freebox documentation (in French)).

Example

resource "freebox_port_forwarding" "example" {
  enabled          = true
  ip_protocol      = "udp"
  target_ip        = "192.168.1.255"
  comment          = "This is an example comment"
  source_ip        = "0.0.0.0"
  port_range_start = 32443
  port_range_end   = 32443
  target_port      = 443
}

output "hostname" {
  value = resource.freebox_port_forwarding.example.hostname
}

output "reachable" {
  value = resource.freebox_port_forwarding.example.host.reachable
}

Schema

Required

  • enabled (Boolean) Status of the forwarding
  • ip_protocol (String) Protocol to handle
  • port_range_start (Number) Start boundary of the port range to forward. The range is inclusive.
  • target_ip (String) Local IP of the local port forwarding target

Optional

  • comment (String) Additional comment associated with the rule
  • port_range_end (Number) End boundary of the port range to forward. If not set, it will default to the same value as port_range_start.
  • source_ip (String) Local IP of the local port forwarding target. If left unset or set to 0.0.0.0, the rule will apply to any incoming IP
  • target_port (Number) The target port range to forward to. If not set, it will default to the same value as port_range_start. Only available for a range of 1 port.

Read-Only

  • host (Attributes) LAN host information (see below for nested schema)
  • hostname (String) Name of the target host in the local network
  • id (Number) Unique identifier of the port forwarding

Nested Schema for host

Optional:

  • default_name (String) Default name of the host
  • host_type (String) When possible, the Freebox will try to guess the host_type, but you can manually override this to the correct value
  • persistent (Boolean) If true the host is always shown even if it has not been active since the Freebox startup
  • primary_name (String) Host primary name (chosen from the list of available names, or manually set by user)

Read-Only:

  • active (Boolean) If true the host sends traffic to the Freebox
  • first_activity_seconds (Number) First time the host sent traffic, or null if it wasn’t seen before this field was added.
  • id (String) ID of the host
  • interface (String) Interface of the host
  • l2ident (Attributes) Layer 2 network id and its type (see below for nested schema)
  • l3connectivities (Attributes List) List of available layer 3 network connections (see below for nested schema)
  • names (Attributes List) List of available names, and their source (see below for nested schema)
  • network_control (Attributes) If device is associated with a profile, contains profile summary. (see below for nested schema)
  • primary_name_manual (Boolean) If true the primary name has been set manually
  • reachable (Boolean) If true the host can receive traffic from the Freebox
  • vendor_name (String) Host vendor name (from the mac address)

Nested Schema for host.l2ident

Optional:

  • id (String) ID of the L2 ident
  • type (String) Type of the L2 ident

Nested Schema for host.l3connectivities

Optional:

  • active (Boolean) Whether the L3 connectivity is active
  • address (String) Address of the L3 connectivity
  • reachable (Boolean) Whether the L3 connectivity is reachable
  • type (String) Type of the L3 connectivity

Nested Schema for host.names

Optional:

  • name (String) Name of the host
  • source (String) Source of the host

Nested Schema for host.network_control

Read-Only:

  • current_mode (String) Mode described in Network Control Object
  • name (String) Name of the profile this device is associated with
  • profile_id (Number) ID of the profile this device is associated with

Import

# ------------------------------------------------ 👇 is the ID of the virtual machine
terraform import "freebox_port_forwarding.example" 78