opnsense_interface_all (Data Source)
InterfacesAll can be used to get a list of all configurations of OPNsense interfaces. Allows for custom filtering.
Example Usage
// Get all interface configs
data "opnsense_interface_all" "all" {}
// Filter for a specific MAC address
output "specific_mac" {
value = [for i in data.opnsense_interface_all.all.interfaces : i if i.macaddr == "5a:dc:1f:24:12:c6"]
}
// Filter for specific device (advisable to use opnsense_interface instead)
output "wireguard" {
value = [for i in data.opnsense_interface_all.all.interfaces : i if i.device == "wg1"]
}
Schema
Read-Only
interfaces(Attributes List) A list of all interfaces present in OPNsense. (see below for nested schema)
Nested Schema for interfaces
Required:
device(String) Name of the interface device.
Read-Only:
capabilities(Set of String) List of capabilities the interface supports.flags(Set of String) List of flags configured on the interface (equiv. to flags=xxxx in output of ifconfig).groups(Set of String) List of groups the interface is a member of.ipv4(Attributes List) (see below for nested schema)ipv6(Attributes List) (see below for nested schema)is_physical(Boolean) Whether the interface is physical or virtual.macaddr(String) MAC address assigned to the interface.media(String) Interface media type settings (see https://man.openbsd.org/ifmedia.4).media_raw(String) User-friendly interface media type.mtu(Number) Maximum Transmission Unit for the interface. This is typically 1500 bytes but can vary in some circumstances.options(Set of String) List of options configured on the interface (equiv. to options=xx in output of ifconfig).status(String) Status of the interface (e.g."active").supported_media(Set of String) List of supported media type settings (see https://man.openbsd.org/ifmedia.4).
Nested Schema for interfaces.ipv4
Read-Only:
ipaddr(String) IPv4 address assigned to the interface.subnetbits(Number) Number of subnet bits (i.e. CIDR).tunnel(Boolean) Whether IPv4 tunnelling is enabled.
Nested Schema for interfaces.ipv6
Read-Only:
autoconf(Boolean) Whether auto-configuration is enabled for the address.deprecated(Boolean) Whether the address is deprecated.ipaddr(String) IPv6 address assigned to the interface.link_local(Boolean) Whether the address is link-local.subnetbits(Number) Number of subnet bits (i.e. CIDR).tentative(Boolean) Whether the address is tentative.tunnel(Boolean) Whether IPv6 tunnelling is enabled.