published on Wednesday, Jul 8, 2026 by Pulumiverse
published on Wednesday, Jul 8, 2026 by Pulumiverse
The unifi.Network resource manages networks in your UniFi environment, including WAN, LAN, and VLAN networks. This resource enables you to:
- Create and manage different types of networks (corporate, guest, WAN, VLAN-only)
- Configure network addressing and DHCP settings
- Set up IPv6 networking features
- Manage DHCP relay and DNS settings
- Configure network groups and VLANs
Common use cases include:
- Setting up corporate and guest networks with different security policies
- Configuring WAN connectivity with various authentication methods
- Creating VLANs for network segmentation
- Managing DHCP and DNS services for network clients
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as unifi from "@pulumiverse/unifi";
const config = new pulumi.Config();
const vlanId = config.getNumber("vlanId") || 10;
const vlan = new unifi.Network("vlan", {
name: "wifi-vlan",
purpose: "corporate",
subnet: "10.0.0.1/24",
vlanId: vlanId,
dhcpStart: "10.0.0.6",
dhcpStop: "10.0.0.254",
dhcpEnabled: true,
});
const wan = new unifi.Network("wan", {
name: "wan",
purpose: "wan",
wanNetworkgroup: "WAN",
wanType: "pppoe",
wanIp: "192.168.1.1",
wanEgressQos: 1,
wanUsername: "username",
xWanPassword: "password",
});
// Zone-Based Firewall (UniFi OS 9.x): pin a network to a firewall zone from the
// network side. Use EITHER this `firewall_zone_id` lever OR the zone-side
// `unifi_firewall_zone.networks` argument for a given network — not both, or the two
// resources will fight over the association.
const iot = new unifi.firewall.Zone("iot", {name: "iot"});
const iotNetwork = new unifi.Network("iot", {
name: "iot-vlan",
purpose: "corporate",
subnet: "10.0.20.1/24",
vlanId: 20,
firewallZoneId: iot.id,
});
// Override the DHCP-advertised default gateway. By default UniFi advertises the
// network's own interface IP as the gateway (DHCP option 3); setting
// `dhcpd_gateway_enabled = true` switches that to "manual" and hands clients the
// address in `dhcpd_gateway` instead. Here clients are pointed at a Tailscale
// subnet-router node (10.0.30.10) so their traffic can reach a remote tailnet.
const tailscaleLan = new unifi.Network("tailscale_lan", {
name: "tailscale-lan",
purpose: "corporate",
subnet: "10.0.30.1/24",
vlanId: 30,
dhcpStart: "10.0.30.100",
dhcpStop: "10.0.30.254",
dhcpEnabled: true,
dhcpdGatewayEnabled: true,
dhcpdGateway: "10.0.30.10",
});
import pulumi
import pulumiverse_unifi as unifi
config = pulumi.Config()
vlan_id = config.get_float("vlanId")
if vlan_id is None:
vlan_id = 10
vlan = unifi.Network("vlan",
name="wifi-vlan",
purpose="corporate",
subnet="10.0.0.1/24",
vlan_id=int(vlan_id),
dhcp_start="10.0.0.6",
dhcp_stop="10.0.0.254",
dhcp_enabled=True)
wan = unifi.Network("wan",
name="wan",
purpose="wan",
wan_networkgroup="WAN",
wan_type="pppoe",
wan_ip="192.168.1.1",
wan_egress_qos=1,
wan_username="username",
x_wan_password="password")
# Zone-Based Firewall (UniFi OS 9.x): pin a network to a firewall zone from the
# network side. Use EITHER this `firewall_zone_id` lever OR the zone-side
# `unifi_firewall_zone.networks` argument for a given network — not both, or the two
# resources will fight over the association.
iot = unifi.firewall.Zone("iot", name="iot")
iot_network = unifi.Network("iot",
name="iot-vlan",
purpose="corporate",
subnet="10.0.20.1/24",
vlan_id=20,
firewall_zone_id=iot.id)
# Override the DHCP-advertised default gateway. By default UniFi advertises the
# network's own interface IP as the gateway (DHCP option 3); setting
# `dhcpd_gateway_enabled = true` switches that to "manual" and hands clients the
# address in `dhcpd_gateway` instead. Here clients are pointed at a Tailscale
# subnet-router node (10.0.30.10) so their traffic can reach a remote tailnet.
tailscale_lan = unifi.Network("tailscale_lan",
name="tailscale-lan",
purpose="corporate",
subnet="10.0.30.1/24",
vlan_id=30,
dhcp_start="10.0.30.100",
dhcp_stop="10.0.30.254",
dhcp_enabled=True,
dhcpd_gateway_enabled=True,
dhcpd_gateway="10.0.30.10")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
"github.com/pulumiverse/pulumi-unifi/sdk/go/unifi"
"github.com/pulumiverse/pulumi-unifi/sdk/go/unifi/firewall"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
vlanId := float64(10)
if param := cfg.GetFloat64("vlanId"); param != 0 {
vlanId = param
}
_, err := unifi.NewNetwork(ctx, "vlan", &unifi.NetworkArgs{
Name: pulumi.String("wifi-vlan"),
Purpose: pulumi.String("corporate"),
Subnet: pulumi.String("10.0.0.1/24"),
VlanId: pulumi.Float64(vlanId),
DhcpStart: pulumi.String("10.0.0.6"),
DhcpStop: pulumi.String("10.0.0.254"),
DhcpEnabled: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = unifi.NewNetwork(ctx, "wan", &unifi.NetworkArgs{
Name: pulumi.String("wan"),
Purpose: pulumi.String("wan"),
WanNetworkgroup: pulumi.String("WAN"),
WanType: pulumi.String("pppoe"),
WanIp: pulumi.String("192.168.1.1"),
WanEgressQos: pulumi.Int(1),
WanUsername: pulumi.String("username"),
XWanPassword: pulumi.String("password"),
})
if err != nil {
return err
}
// Zone-Based Firewall (UniFi OS 9.x): pin a network to a firewall zone from the
// network side. Use EITHER this `firewall_zone_id` lever OR the zone-side
// `unifi_firewall_zone.networks` argument for a given network — not both, or the two
// resources will fight over the association.
iot, err := firewall.NewZone(ctx, "iot", &firewall.ZoneArgs{
Name: pulumi.String("iot"),
})
if err != nil {
return err
}
_, err = unifi.NewNetwork(ctx, "iot", &unifi.NetworkArgs{
Name: pulumi.String("iot-vlan"),
Purpose: pulumi.String("corporate"),
Subnet: pulumi.String("10.0.20.1/24"),
VlanId: pulumi.Int(20),
FirewallZoneId: iot.ID(),
})
if err != nil {
return err
}
// Override the DHCP-advertised default gateway. By default UniFi advertises the
// network's own interface IP as the gateway (DHCP option 3); setting
// `dhcpd_gateway_enabled = true` switches that to "manual" and hands clients the
// address in `dhcpd_gateway` instead. Here clients are pointed at a Tailscale
// subnet-router node (10.0.30.10) so their traffic can reach a remote tailnet.
_, err = unifi.NewNetwork(ctx, "tailscale_lan", &unifi.NetworkArgs{
Name: pulumi.String("tailscale-lan"),
Purpose: pulumi.String("corporate"),
Subnet: pulumi.String("10.0.30.1/24"),
VlanId: pulumi.Int(30),
DhcpStart: pulumi.String("10.0.30.100"),
DhcpStop: pulumi.String("10.0.30.254"),
DhcpEnabled: pulumi.Bool(true),
DhcpdGatewayEnabled: pulumi.Bool(true),
DhcpdGateway: pulumi.String("10.0.30.10"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Unifi = Pulumiverse.Unifi;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var vlanId = config.GetDouble("vlanId") ?? 10;
var vlan = new Unifi.Network("vlan", new()
{
Name = "wifi-vlan",
Purpose = "corporate",
Subnet = "10.0.0.1/24",
VlanId = vlanId,
DhcpStart = "10.0.0.6",
DhcpStop = "10.0.0.254",
DhcpEnabled = true,
});
var wan = new Unifi.Network("wan", new()
{
Name = "wan",
Purpose = "wan",
WanNetworkgroup = "WAN",
WanType = "pppoe",
WanIp = "192.168.1.1",
WanEgressQos = 1,
WanUsername = "username",
XWanPassword = "password",
});
// Zone-Based Firewall (UniFi OS 9.x): pin a network to a firewall zone from the
// network side. Use EITHER this `firewall_zone_id` lever OR the zone-side
// `unifi_firewall_zone.networks` argument for a given network — not both, or the two
// resources will fight over the association.
var iot = new Unifi.Firewall.Zone("iot", new()
{
Name = "iot",
});
var iotNetwork = new Unifi.Network("iot", new()
{
Name = "iot-vlan",
Purpose = "corporate",
Subnet = "10.0.20.1/24",
VlanId = 20,
FirewallZoneId = iot.Id,
});
// Override the DHCP-advertised default gateway. By default UniFi advertises the
// network's own interface IP as the gateway (DHCP option 3); setting
// `dhcpd_gateway_enabled = true` switches that to "manual" and hands clients the
// address in `dhcpd_gateway` instead. Here clients are pointed at a Tailscale
// subnet-router node (10.0.30.10) so their traffic can reach a remote tailnet.
var tailscaleLan = new Unifi.Network("tailscale_lan", new()
{
Name = "tailscale-lan",
Purpose = "corporate",
Subnet = "10.0.30.1/24",
VlanId = 30,
DhcpStart = "10.0.30.100",
DhcpStop = "10.0.30.254",
DhcpEnabled = true,
DhcpdGatewayEnabled = true,
DhcpdGateway = "10.0.30.10",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumiverse.unifi.Network;
import com.pulumiverse.unifi.NetworkArgs;
import com.pulumiverse.unifi.firewall.Zone;
import com.pulumiverse.unifi.firewall.ZoneArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var vlanId = config.getDouble("vlanId").orElse(10);
var vlan = new Network("vlan", NetworkArgs.builder()
.name("wifi-vlan")
.purpose("corporate")
.subnet("10.0.0.1/24")
.vlanId(vlanId)
.dhcpStart("10.0.0.6")
.dhcpStop("10.0.0.254")
.dhcpEnabled(true)
.build());
var wan = new Network("wan", NetworkArgs.builder()
.name("wan")
.purpose("wan")
.wanNetworkgroup("WAN")
.wanType("pppoe")
.wanIp("192.168.1.1")
.wanEgressQos(1)
.wanUsername("username")
.xWanPassword("password")
.build());
// Zone-Based Firewall (UniFi OS 9.x): pin a network to a firewall zone from the
// network side. Use EITHER this `firewall_zone_id` lever OR the zone-side
// `unifi_firewall_zone.networks` argument for a given network — not both, or the two
// resources will fight over the association.
var iot = new Zone("iot", ZoneArgs.builder()
.name("iot")
.build());
var iotNetwork = new Network("iotNetwork", NetworkArgs.builder()
.name("iot-vlan")
.purpose("corporate")
.subnet("10.0.20.1/24")
.vlanId(20)
.firewallZoneId(iot.id())
.build());
// Override the DHCP-advertised default gateway. By default UniFi advertises the
// network's own interface IP as the gateway (DHCP option 3); setting
// `dhcpd_gateway_enabled = true` switches that to "manual" and hands clients the
// address in `dhcpd_gateway` instead. Here clients are pointed at a Tailscale
// subnet-router node (10.0.30.10) so their traffic can reach a remote tailnet.
var tailscaleLan = new Network("tailscaleLan", NetworkArgs.builder()
.name("tailscale-lan")
.purpose("corporate")
.subnet("10.0.30.1/24")
.vlanId(30)
.dhcpStart("10.0.30.100")
.dhcpStop("10.0.30.254")
.dhcpEnabled(true)
.dhcpdGatewayEnabled(true)
.dhcpdGateway("10.0.30.10")
.build());
}
}
configuration:
vlanId:
type: number
default: 10
resources:
vlan:
type: unifi:Network
properties:
name: wifi-vlan
purpose: corporate
subnet: 10.0.0.1/24
vlanId: ${vlanId}
dhcpStart: 10.0.0.6
dhcpStop: 10.0.0.254
dhcpEnabled: true
wan:
type: unifi:Network
properties:
name: wan
purpose: wan
wanNetworkgroup: WAN
wanType: pppoe
wanIp: 192.168.1.1
wanEgressQos: 1
wanUsername: username
xWanPassword: password
# Zone-Based Firewall (UniFi OS 9.x): pin a network to a firewall zone from the
# network side. Use EITHER this `firewall_zone_id` lever OR the zone-side
# `unifi_firewall_zone.networks` argument for a given network — not both, or the two
# resources will fight over the association.
iot:
type: unifi:firewall:Zone
properties:
name: iot
iotNetwork:
type: unifi:Network
name: iot
properties:
name: iot-vlan
purpose: corporate
subnet: 10.0.20.1/24
vlanId: 20
firewallZoneId: ${iot.id}
# Override the DHCP-advertised default gateway. By default UniFi advertises the
# network's own interface IP as the gateway (DHCP option 3); setting
# `dhcpd_gateway_enabled = true` switches that to "manual" and hands clients the
# address in `dhcpd_gateway` instead. Here clients are pointed at a Tailscale
# subnet-router node (10.0.30.10) so their traffic can reach a remote tailnet.
tailscaleLan:
type: unifi:Network
name: tailscale_lan
properties:
name: tailscale-lan
purpose: corporate
subnet: 10.0.30.1/24
vlanId: 30
dhcpStart: 10.0.30.100
dhcpStop: 10.0.30.254
dhcpEnabled: true
dhcpdGatewayEnabled: true
dhcpdGateway: 10.0.30.10
pulumi {
required_providers {
unifi = {
source = "pulumi/unifi"
}
}
}
resource "unifi_network" "vlan" {
name = "wifi-vlan"
purpose = "corporate"
subnet = "10.0.0.1/24"
vlan_id = var.vlanId
dhcp_start = "10.0.0.6"
dhcp_stop = "10.0.0.254"
dhcp_enabled = true
}
resource "unifi_network" "wan" {
name = "wan"
purpose = "wan"
wan_networkgroup = "WAN"
wan_type = "pppoe"
wan_ip = "192.168.1.1"
wan_egress_qos = 1
wan_username = "username"
x_wan_password = "password"
}
# Zone-Based Firewall (UniFi OS 9.x): pin a network to a firewall zone from the
# network side. Use EITHER this `firewall_zone_id` lever OR the zone-side
# `unifi_firewall_zone.networks` argument for a given network — not both, or the two
# resources will fight over the association.
resource "unifi_firewall_zone" "iot" {
name = "iot"
}
resource "unifi_network" "iot" {
name = "iot-vlan"
purpose = "corporate"
subnet = "10.0.20.1/24"
vlan_id = 20
firewall_zone_id = unifi_firewall_zone.iot.id
}
# Override the DHCP-advertised default gateway. By default UniFi advertises the
# network's own interface IP as the gateway (DHCP option 3); setting
# `dhcpd_gateway_enabled = true` switches that to "manual" and hands clients the
# address in `dhcpd_gateway` instead. Here clients are pointed at a Tailscale
# subnet-router node (10.0.30.10) so their traffic can reach a remote tailnet.
resource "unifi_network" "tailscale_lan" {
name = "tailscale-lan"
purpose = "corporate"
subnet = "10.0.30.1/24"
vlan_id = 30
dhcp_start = "10.0.30.100"
dhcp_stop = "10.0.30.254"
dhcp_enabled = true
dhcpd_gateway_enabled = true
dhcpd_gateway = "10.0.30.10"
}
variable "vlanId" {
type = number
default = 10
}
Create Network Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Network(name: string, args: NetworkArgs, opts?: CustomResourceOptions);@overload
def Network(resource_name: str,
args: NetworkArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Network(resource_name: str,
opts: Optional[ResourceOptions] = None,
purpose: Optional[str] = None,
dhcp_dns: Optional[Sequence[str]] = None,
dhcp_enabled: Optional[bool] = None,
dhcp_guarding: Optional[bool] = None,
dhcp_guarding_trusted_servers: Optional[Sequence[str]] = None,
dhcp_lease: Optional[int] = None,
dhcp_relay_enabled: Optional[bool] = None,
dhcp_start: Optional[str] = None,
dhcp_stop: Optional[str] = None,
dhcp_v6_dns: Optional[Sequence[str]] = None,
dhcp_v6_dns_auto: Optional[bool] = None,
dhcp_v6_enabled: Optional[bool] = None,
dhcp_v6_lease: Optional[int] = None,
dhcp_v6_start: Optional[str] = None,
dhcp_v6_stop: Optional[str] = None,
dhcpd_boot_enabled: Optional[bool] = None,
dhcpd_boot_filename: Optional[str] = None,
dhcpd_boot_server: Optional[str] = None,
dhcpd_gateway: Optional[str] = None,
dhcpd_gateway_enabled: Optional[bool] = None,
domain_name: Optional[str] = None,
enabled: Optional[bool] = None,
firewall_zone_id: Optional[str] = None,
igmp_snooping: Optional[bool] = None,
internet_access_enabled: Optional[bool] = None,
ipv6_interface_type: Optional[str] = None,
ipv6_pd_interface: Optional[str] = None,
ipv6_pd_prefixid: Optional[str] = None,
ipv6_pd_start: Optional[str] = None,
ipv6_pd_stop: Optional[str] = None,
ipv6_ra_enable: Optional[bool] = None,
ipv6_ra_preferred_lifetime: Optional[int] = None,
ipv6_ra_priority: Optional[str] = None,
ipv6_ra_valid_lifetime: Optional[int] = None,
ipv6_static_subnet: Optional[str] = None,
multicast_dns: Optional[bool] = None,
name: Optional[str] = None,
network_group: Optional[str] = None,
network_isolation_enabled: Optional[bool] = None,
site: Optional[str] = None,
subnet: Optional[str] = None,
uid_vpn_custom_routings: Optional[Sequence[str]] = None,
upnp_lan_enabled: Optional[bool] = None,
vlan_id: Optional[int] = None,
vpn_client_default_route: Optional[bool] = None,
vpn_client_pull_dns: Optional[bool] = None,
vpn_type: Optional[str] = None,
wan_dhcp_v6_pd_size: Optional[int] = None,
wan_dns: Optional[Sequence[str]] = None,
wan_egress_qos: Optional[int] = None,
wan_gateway: Optional[str] = None,
wan_gateway_v6: Optional[str] = None,
wan_ip: Optional[str] = None,
wan_ipv6: Optional[str] = None,
wan_netmask: Optional[str] = None,
wan_networkgroup: Optional[str] = None,
wan_prefixlen: Optional[int] = None,
wan_type: Optional[str] = None,
wan_type_v6: Optional[str] = None,
wan_username: Optional[str] = None,
wireguard_client_mode: Optional[str] = None,
wireguard_client_peer_ip: Optional[str] = None,
wireguard_client_peer_port: Optional[int] = None,
wireguard_client_peer_public_key: Optional[str] = None,
wireguard_client_preshared_key: Optional[str] = None,
wireguard_client_preshared_key_enabled: Optional[bool] = None,
wireguard_interface: Optional[str] = None,
x_wan_password: Optional[str] = None,
x_wireguard_private_key: Optional[str] = None)func NewNetwork(ctx *Context, name string, args NetworkArgs, opts ...ResourceOption) (*Network, error)public Network(string name, NetworkArgs args, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: unifi:Network
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "unifi_network" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var networkResource = new Unifi.Network("networkResource", new()
{
Purpose = "string",
DhcpDns = new[]
{
"string",
},
DhcpEnabled = false,
DhcpGuarding = false,
DhcpGuardingTrustedServers = new[]
{
"string",
},
DhcpLease = 0,
DhcpRelayEnabled = false,
DhcpStart = "string",
DhcpStop = "string",
DhcpV6Dns = new[]
{
"string",
},
DhcpV6DnsAuto = false,
DhcpV6Enabled = false,
DhcpV6Lease = 0,
DhcpV6Start = "string",
DhcpV6Stop = "string",
DhcpdBootEnabled = false,
DhcpdBootFilename = "string",
DhcpdBootServer = "string",
DhcpdGateway = "string",
DhcpdGatewayEnabled = false,
DomainName = "string",
Enabled = false,
FirewallZoneId = "string",
IgmpSnooping = false,
InternetAccessEnabled = false,
Ipv6InterfaceType = "string",
Ipv6PdInterface = "string",
Ipv6PdPrefixid = "string",
Ipv6PdStart = "string",
Ipv6PdStop = "string",
Ipv6RaEnable = false,
Ipv6RaPreferredLifetime = 0,
Ipv6RaPriority = "string",
Ipv6RaValidLifetime = 0,
Ipv6StaticSubnet = "string",
MulticastDns = false,
Name = "string",
NetworkGroup = "string",
NetworkIsolationEnabled = false,
Site = "string",
Subnet = "string",
UidVpnCustomRoutings = new[]
{
"string",
},
UpnpLanEnabled = false,
VlanId = 0,
VpnClientDefaultRoute = false,
VpnClientPullDns = false,
VpnType = "string",
WanDhcpV6PdSize = 0,
WanDns = new[]
{
"string",
},
WanEgressQos = 0,
WanGateway = "string",
WanGatewayV6 = "string",
WanIp = "string",
WanIpv6 = "string",
WanNetmask = "string",
WanNetworkgroup = "string",
WanPrefixlen = 0,
WanType = "string",
WanTypeV6 = "string",
WanUsername = "string",
WireguardClientMode = "string",
WireguardClientPeerIp = "string",
WireguardClientPeerPort = 0,
WireguardClientPeerPublicKey = "string",
WireguardClientPresharedKey = "string",
WireguardClientPresharedKeyEnabled = false,
WireguardInterface = "string",
XWanPassword = "string",
XWireguardPrivateKey = "string",
});
example, err := unifi.NewNetwork(ctx, "networkResource", &unifi.NetworkArgs{
Purpose: pulumi.String("string"),
DhcpDns: pulumi.StringArray{
pulumi.String("string"),
},
DhcpEnabled: pulumi.Bool(false),
DhcpGuarding: pulumi.Bool(false),
DhcpGuardingTrustedServers: pulumi.StringArray{
pulumi.String("string"),
},
DhcpLease: pulumi.Int(0),
DhcpRelayEnabled: pulumi.Bool(false),
DhcpStart: pulumi.String("string"),
DhcpStop: pulumi.String("string"),
DhcpV6Dns: pulumi.StringArray{
pulumi.String("string"),
},
DhcpV6DnsAuto: pulumi.Bool(false),
DhcpV6Enabled: pulumi.Bool(false),
DhcpV6Lease: pulumi.Int(0),
DhcpV6Start: pulumi.String("string"),
DhcpV6Stop: pulumi.String("string"),
DhcpdBootEnabled: pulumi.Bool(false),
DhcpdBootFilename: pulumi.String("string"),
DhcpdBootServer: pulumi.String("string"),
DhcpdGateway: pulumi.String("string"),
DhcpdGatewayEnabled: pulumi.Bool(false),
DomainName: pulumi.String("string"),
Enabled: pulumi.Bool(false),
FirewallZoneId: pulumi.String("string"),
IgmpSnooping: pulumi.Bool(false),
InternetAccessEnabled: pulumi.Bool(false),
Ipv6InterfaceType: pulumi.String("string"),
Ipv6PdInterface: pulumi.String("string"),
Ipv6PdPrefixid: pulumi.String("string"),
Ipv6PdStart: pulumi.String("string"),
Ipv6PdStop: pulumi.String("string"),
Ipv6RaEnable: pulumi.Bool(false),
Ipv6RaPreferredLifetime: pulumi.Int(0),
Ipv6RaPriority: pulumi.String("string"),
Ipv6RaValidLifetime: pulumi.Int(0),
Ipv6StaticSubnet: pulumi.String("string"),
MulticastDns: pulumi.Bool(false),
Name: pulumi.String("string"),
NetworkGroup: pulumi.String("string"),
NetworkIsolationEnabled: pulumi.Bool(false),
Site: pulumi.String("string"),
Subnet: pulumi.String("string"),
UidVpnCustomRoutings: pulumi.StringArray{
pulumi.String("string"),
},
UpnpLanEnabled: pulumi.Bool(false),
VlanId: pulumi.Int(0),
VpnClientDefaultRoute: pulumi.Bool(false),
VpnClientPullDns: pulumi.Bool(false),
VpnType: pulumi.String("string"),
WanDhcpV6PdSize: pulumi.Int(0),
WanDns: pulumi.StringArray{
pulumi.String("string"),
},
WanEgressQos: pulumi.Int(0),
WanGateway: pulumi.String("string"),
WanGatewayV6: pulumi.String("string"),
WanIp: pulumi.String("string"),
WanIpv6: pulumi.String("string"),
WanNetmask: pulumi.String("string"),
WanNetworkgroup: pulumi.String("string"),
WanPrefixlen: pulumi.Int(0),
WanType: pulumi.String("string"),
WanTypeV6: pulumi.String("string"),
WanUsername: pulumi.String("string"),
WireguardClientMode: pulumi.String("string"),
WireguardClientPeerIp: pulumi.String("string"),
WireguardClientPeerPort: pulumi.Int(0),
WireguardClientPeerPublicKey: pulumi.String("string"),
WireguardClientPresharedKey: pulumi.String("string"),
WireguardClientPresharedKeyEnabled: pulumi.Bool(false),
WireguardInterface: pulumi.String("string"),
XWanPassword: pulumi.String("string"),
XWireguardPrivateKey: pulumi.String("string"),
})
resource "unifi_network" "networkResource" {
purpose = "string"
dhcp_dns = ["string"]
dhcp_enabled = false
dhcp_guarding = false
dhcp_guarding_trusted_servers = ["string"]
dhcp_lease = 0
dhcp_relay_enabled = false
dhcp_start = "string"
dhcp_stop = "string"
dhcp_v6_dns = ["string"]
dhcp_v6_dns_auto = false
dhcp_v6_enabled = false
dhcp_v6_lease = 0
dhcp_v6_start = "string"
dhcp_v6_stop = "string"
dhcpd_boot_enabled = false
dhcpd_boot_filename = "string"
dhcpd_boot_server = "string"
dhcpd_gateway = "string"
dhcpd_gateway_enabled = false
domain_name = "string"
enabled = false
firewall_zone_id = "string"
igmp_snooping = false
internet_access_enabled = false
ipv6_interface_type = "string"
ipv6_pd_interface = "string"
ipv6_pd_prefixid = "string"
ipv6_pd_start = "string"
ipv6_pd_stop = "string"
ipv6_ra_enable = false
ipv6_ra_preferred_lifetime = 0
ipv6_ra_priority = "string"
ipv6_ra_valid_lifetime = 0
ipv6_static_subnet = "string"
multicast_dns = false
name = "string"
network_group = "string"
network_isolation_enabled = false
site = "string"
subnet = "string"
uid_vpn_custom_routings = ["string"]
upnp_lan_enabled = false
vlan_id = 0
vpn_client_default_route = false
vpn_client_pull_dns = false
vpn_type = "string"
wan_dhcp_v6_pd_size = 0
wan_dns = ["string"]
wan_egress_qos = 0
wan_gateway = "string"
wan_gateway_v6 = "string"
wan_ip = "string"
wan_ipv6 = "string"
wan_netmask = "string"
wan_networkgroup = "string"
wan_prefixlen = 0
wan_type = "string"
wan_type_v6 = "string"
wan_username = "string"
wireguard_client_mode = "string"
wireguard_client_peer_ip = "string"
wireguard_client_peer_port = 0
wireguard_client_peer_public_key = "string"
wireguard_client_preshared_key = "string"
wireguard_client_preshared_key_enabled = false
wireguard_interface = "string"
x_wan_password = "string"
x_wireguard_private_key = "string"
}
var networkResource = new Network("networkResource", NetworkArgs.builder()
.purpose("string")
.dhcpDns("string")
.dhcpEnabled(false)
.dhcpGuarding(false)
.dhcpGuardingTrustedServers("string")
.dhcpLease(0)
.dhcpRelayEnabled(false)
.dhcpStart("string")
.dhcpStop("string")
.dhcpV6Dns("string")
.dhcpV6DnsAuto(false)
.dhcpV6Enabled(false)
.dhcpV6Lease(0)
.dhcpV6Start("string")
.dhcpV6Stop("string")
.dhcpdBootEnabled(false)
.dhcpdBootFilename("string")
.dhcpdBootServer("string")
.dhcpdGateway("string")
.dhcpdGatewayEnabled(false)
.domainName("string")
.enabled(false)
.firewallZoneId("string")
.igmpSnooping(false)
.internetAccessEnabled(false)
.ipv6InterfaceType("string")
.ipv6PdInterface("string")
.ipv6PdPrefixid("string")
.ipv6PdStart("string")
.ipv6PdStop("string")
.ipv6RaEnable(false)
.ipv6RaPreferredLifetime(0)
.ipv6RaPriority("string")
.ipv6RaValidLifetime(0)
.ipv6StaticSubnet("string")
.multicastDns(false)
.name("string")
.networkGroup("string")
.networkIsolationEnabled(false)
.site("string")
.subnet("string")
.uidVpnCustomRoutings("string")
.upnpLanEnabled(false)
.vlanId(0)
.vpnClientDefaultRoute(false)
.vpnClientPullDns(false)
.vpnType("string")
.wanDhcpV6PdSize(0)
.wanDns("string")
.wanEgressQos(0)
.wanGateway("string")
.wanGatewayV6("string")
.wanIp("string")
.wanIpv6("string")
.wanNetmask("string")
.wanNetworkgroup("string")
.wanPrefixlen(0)
.wanType("string")
.wanTypeV6("string")
.wanUsername("string")
.wireguardClientMode("string")
.wireguardClientPeerIp("string")
.wireguardClientPeerPort(0)
.wireguardClientPeerPublicKey("string")
.wireguardClientPresharedKey("string")
.wireguardClientPresharedKeyEnabled(false)
.wireguardInterface("string")
.xWanPassword("string")
.xWireguardPrivateKey("string")
.build());
network_resource = unifi.Network("networkResource",
purpose="string",
dhcp_dns=["string"],
dhcp_enabled=False,
dhcp_guarding=False,
dhcp_guarding_trusted_servers=["string"],
dhcp_lease=0,
dhcp_relay_enabled=False,
dhcp_start="string",
dhcp_stop="string",
dhcp_v6_dns=["string"],
dhcp_v6_dns_auto=False,
dhcp_v6_enabled=False,
dhcp_v6_lease=0,
dhcp_v6_start="string",
dhcp_v6_stop="string",
dhcpd_boot_enabled=False,
dhcpd_boot_filename="string",
dhcpd_boot_server="string",
dhcpd_gateway="string",
dhcpd_gateway_enabled=False,
domain_name="string",
enabled=False,
firewall_zone_id="string",
igmp_snooping=False,
internet_access_enabled=False,
ipv6_interface_type="string",
ipv6_pd_interface="string",
ipv6_pd_prefixid="string",
ipv6_pd_start="string",
ipv6_pd_stop="string",
ipv6_ra_enable=False,
ipv6_ra_preferred_lifetime=0,
ipv6_ra_priority="string",
ipv6_ra_valid_lifetime=0,
ipv6_static_subnet="string",
multicast_dns=False,
name="string",
network_group="string",
network_isolation_enabled=False,
site="string",
subnet="string",
uid_vpn_custom_routings=["string"],
upnp_lan_enabled=False,
vlan_id=0,
vpn_client_default_route=False,
vpn_client_pull_dns=False,
vpn_type="string",
wan_dhcp_v6_pd_size=0,
wan_dns=["string"],
wan_egress_qos=0,
wan_gateway="string",
wan_gateway_v6="string",
wan_ip="string",
wan_ipv6="string",
wan_netmask="string",
wan_networkgroup="string",
wan_prefixlen=0,
wan_type="string",
wan_type_v6="string",
wan_username="string",
wireguard_client_mode="string",
wireguard_client_peer_ip="string",
wireguard_client_peer_port=0,
wireguard_client_peer_public_key="string",
wireguard_client_preshared_key="string",
wireguard_client_preshared_key_enabled=False,
wireguard_interface="string",
x_wan_password="string",
x_wireguard_private_key="string")
const networkResource = new unifi.Network("networkResource", {
purpose: "string",
dhcpDns: ["string"],
dhcpEnabled: false,
dhcpGuarding: false,
dhcpGuardingTrustedServers: ["string"],
dhcpLease: 0,
dhcpRelayEnabled: false,
dhcpStart: "string",
dhcpStop: "string",
dhcpV6Dns: ["string"],
dhcpV6DnsAuto: false,
dhcpV6Enabled: false,
dhcpV6Lease: 0,
dhcpV6Start: "string",
dhcpV6Stop: "string",
dhcpdBootEnabled: false,
dhcpdBootFilename: "string",
dhcpdBootServer: "string",
dhcpdGateway: "string",
dhcpdGatewayEnabled: false,
domainName: "string",
enabled: false,
firewallZoneId: "string",
igmpSnooping: false,
internetAccessEnabled: false,
ipv6InterfaceType: "string",
ipv6PdInterface: "string",
ipv6PdPrefixid: "string",
ipv6PdStart: "string",
ipv6PdStop: "string",
ipv6RaEnable: false,
ipv6RaPreferredLifetime: 0,
ipv6RaPriority: "string",
ipv6RaValidLifetime: 0,
ipv6StaticSubnet: "string",
multicastDns: false,
name: "string",
networkGroup: "string",
networkIsolationEnabled: false,
site: "string",
subnet: "string",
uidVpnCustomRoutings: ["string"],
upnpLanEnabled: false,
vlanId: 0,
vpnClientDefaultRoute: false,
vpnClientPullDns: false,
vpnType: "string",
wanDhcpV6PdSize: 0,
wanDns: ["string"],
wanEgressQos: 0,
wanGateway: "string",
wanGatewayV6: "string",
wanIp: "string",
wanIpv6: "string",
wanNetmask: "string",
wanNetworkgroup: "string",
wanPrefixlen: 0,
wanType: "string",
wanTypeV6: "string",
wanUsername: "string",
wireguardClientMode: "string",
wireguardClientPeerIp: "string",
wireguardClientPeerPort: 0,
wireguardClientPeerPublicKey: "string",
wireguardClientPresharedKey: "string",
wireguardClientPresharedKeyEnabled: false,
wireguardInterface: "string",
xWanPassword: "string",
xWireguardPrivateKey: "string",
});
type: unifi:Network
properties:
dhcpDns:
- string
dhcpEnabled: false
dhcpGuarding: false
dhcpGuardingTrustedServers:
- string
dhcpLease: 0
dhcpRelayEnabled: false
dhcpStart: string
dhcpStop: string
dhcpV6Dns:
- string
dhcpV6DnsAuto: false
dhcpV6Enabled: false
dhcpV6Lease: 0
dhcpV6Start: string
dhcpV6Stop: string
dhcpdBootEnabled: false
dhcpdBootFilename: string
dhcpdBootServer: string
dhcpdGateway: string
dhcpdGatewayEnabled: false
domainName: string
enabled: false
firewallZoneId: string
igmpSnooping: false
internetAccessEnabled: false
ipv6InterfaceType: string
ipv6PdInterface: string
ipv6PdPrefixid: string
ipv6PdStart: string
ipv6PdStop: string
ipv6RaEnable: false
ipv6RaPreferredLifetime: 0
ipv6RaPriority: string
ipv6RaValidLifetime: 0
ipv6StaticSubnet: string
multicastDns: false
name: string
networkGroup: string
networkIsolationEnabled: false
purpose: string
site: string
subnet: string
uidVpnCustomRoutings:
- string
upnpLanEnabled: false
vlanId: 0
vpnClientDefaultRoute: false
vpnClientPullDns: false
vpnType: string
wanDhcpV6PdSize: 0
wanDns:
- string
wanEgressQos: 0
wanGateway: string
wanGatewayV6: string
wanIp: string
wanIpv6: string
wanNetmask: string
wanNetworkgroup: string
wanPrefixlen: 0
wanType: string
wanTypeV6: string
wanUsername: string
wireguardClientMode: string
wireguardClientPeerIp: string
wireguardClientPeerPort: 0
wireguardClientPeerPublicKey: string
wireguardClientPresharedKey: string
wireguardClientPresharedKeyEnabled: false
wireguardInterface: string
xWanPassword: string
xWireguardPrivateKey: string
Network Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Network resource accepts the following input properties:
- Purpose string
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- Dhcp
Dns List<string> - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- Dhcp
Enabled bool - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- Dhcp
Guarding bool Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- Dhcp
Guarding List<string>Trusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- Dhcp
Lease int - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- Dhcp
Relay boolEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- Dhcp
Start string - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- Dhcp
Stop string - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- Dhcp
V6Dns List<string> - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- Dhcp
V6Dns boolAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- Dhcp
V6Enabled bool - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- Dhcp
V6Lease int - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- Dhcp
V6Start string The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- Dhcp
V6Stop string The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- Dhcpd
Boot boolEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- Dhcpd
Boot stringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- Dhcpd
Boot stringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- Dhcpd
Gateway string The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- Dhcpd
Gateway boolEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- Domain
Name string - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- Enabled bool
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- Firewall
Zone stringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- Igmp
Snooping bool - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- Internet
Access boolEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- Ipv6Interface
Type string Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- Ipv6Pd
Interface string The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Pd
Prefixid string - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- Ipv6Pd
Start string The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Pd
Stop string The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Ra
Enable bool - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- Ipv6Ra
Preferred intLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- Ipv6Ra
Priority string Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- Ipv6Ra
Valid intLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- Ipv6Static
Subnet string The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- Multicast
Dns bool - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- Name string
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- Network
Group string - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- Network
Isolation boolEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- Site string
- The name of the site to associate the network with.
- Subnet string
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- Uid
Vpn List<string>Custom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - Upnp
Lan boolEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - Vlan
Id int The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- Vpn
Client boolDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - Vpn
Client boolPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - Vpn
Type string - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - Wan
Dhcp intV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - Wan
Dns List<string> - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- Wan
Egress intQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- Wan
Gateway string - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - Wan
Gateway stringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - Wan
Ip string - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - Wan
Ipv6 string - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - Wan
Netmask string - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - Wan
Networkgroup string - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- Wan
Prefixlen int - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - Wan
Type string - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- Wan
Type stringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- Wan
Username string - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- Wireguard
Client stringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - Wireguard
Client stringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Client intPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Client stringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - string
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - bool
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Interface string - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - XWan
Password string - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- XWireguard
Private stringKey - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- Purpose string
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- Dhcp
Dns []string - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- Dhcp
Enabled bool - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- Dhcp
Guarding bool Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- Dhcp
Guarding []stringTrusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- Dhcp
Lease int - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- Dhcp
Relay boolEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- Dhcp
Start string - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- Dhcp
Stop string - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- Dhcp
V6Dns []string - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- Dhcp
V6Dns boolAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- Dhcp
V6Enabled bool - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- Dhcp
V6Lease int - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- Dhcp
V6Start string The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- Dhcp
V6Stop string The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- Dhcpd
Boot boolEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- Dhcpd
Boot stringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- Dhcpd
Boot stringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- Dhcpd
Gateway string The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- Dhcpd
Gateway boolEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- Domain
Name string - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- Enabled bool
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- Firewall
Zone stringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- Igmp
Snooping bool - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- Internet
Access boolEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- Ipv6Interface
Type string Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- Ipv6Pd
Interface string The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Pd
Prefixid string - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- Ipv6Pd
Start string The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Pd
Stop string The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Ra
Enable bool - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- Ipv6Ra
Preferred intLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- Ipv6Ra
Priority string Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- Ipv6Ra
Valid intLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- Ipv6Static
Subnet string The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- Multicast
Dns bool - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- Name string
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- Network
Group string - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- Network
Isolation boolEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- Site string
- The name of the site to associate the network with.
- Subnet string
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- Uid
Vpn []stringCustom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - Upnp
Lan boolEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - Vlan
Id int The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- Vpn
Client boolDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - Vpn
Client boolPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - Vpn
Type string - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - Wan
Dhcp intV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - Wan
Dns []string - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- Wan
Egress intQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- Wan
Gateway string - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - Wan
Gateway stringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - Wan
Ip string - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - Wan
Ipv6 string - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - Wan
Netmask string - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - Wan
Networkgroup string - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- Wan
Prefixlen int - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - Wan
Type string - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- Wan
Type stringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- Wan
Username string - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- Wireguard
Client stringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - Wireguard
Client stringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Client intPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Client stringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - string
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - bool
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Interface string - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - XWan
Password string - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- XWireguard
Private stringKey - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- purpose string
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- dhcp_
dns list(string) - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp_
enabled bool - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp_
guarding bool Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp_
guarding_ list(string)trusted_ servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp_
lease number - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp_
relay_ boolenabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp_
start string - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp_
stop string - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp_
v6_ list(string)dns - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp_
v6_ booldns_ auto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp_
v6_ boolenabled - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp_
v6_ numberlease - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp_
v6_ stringstart The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp_
v6_ stringstop The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd_
boot_ boolenabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd_
boot_ stringfilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd_
boot_ stringserver - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd_
gateway string The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd_
gateway_ boolenabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain_
name string - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled bool
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall_
zone_ stringid The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp_
snooping bool - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet_
access_ boolenabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6_
interface_ stringtype Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6_
pd_ stringinterface The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
pd_ stringprefixid - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6_
pd_ stringstart The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
pd_ stringstop The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
ra_ boolenable - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6_
ra_ numberpreferred_ lifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6_
ra_ stringpriority Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6_
ra_ numbervalid_ lifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6_
static_ stringsubnet The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast_
dns bool - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name string
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network_
group string - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network_
isolation_ boolenabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- site string
- The name of the site to associate the network with.
- subnet string
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid_
vpn_ list(string)custom_ routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp_
lan_ boolenabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan_
id number The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn_
client_ booldefault_ route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn_
client_ boolpull_ dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn_
type string - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan_
dhcp_ numberv6_ pd_ size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan_
dns list(string) - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan_
egress_ numberqos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan_
gateway string - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan_
gateway_ stringv6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan_
ip string - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan_
ipv6 string - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan_
netmask string - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan_
networkgroup string - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan_
prefixlen number - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan_
type string - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan_
type_ stringv6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan_
username string - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard_
client_ stringmode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard_
client_ stringpeer_ ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
client_ numberpeer_ port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
client_ stringpeer_ public_ key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - string
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - bool
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
interface string - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - x_
wan_ stringpassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x_
wireguard_ stringprivate_ key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- purpose String
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- dhcp
Dns List<String> - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp
Enabled Boolean - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp
Guarding Boolean Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp
Guarding List<String>Trusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp
Lease Integer - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp
Relay BooleanEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp
Start String - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp
Stop String - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp
V6Dns List<String> - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp
V6Dns BooleanAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp
V6Enabled Boolean - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp
V6Lease Integer - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp
V6Start String The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp
V6Stop String The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd
Boot BooleanEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd
Boot StringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd
Boot StringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd
Gateway String The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd
Gateway BooleanEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain
Name String - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled Boolean
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall
Zone StringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp
Snooping Boolean - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet
Access BooleanEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6Interface
Type String Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6Pd
Interface String The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Prefixid String - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6Pd
Start String The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Stop String The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Enable Boolean - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6Ra
Preferred IntegerLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6Ra
Priority String Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Valid IntegerLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6Static
Subnet String The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast
Dns Boolean - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name String
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network
Group String - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network
Isolation BooleanEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- site String
- The name of the site to associate the network with.
- subnet String
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid
Vpn List<String>Custom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp
Lan BooleanEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan
Id Integer The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn
Client BooleanDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn
Client BooleanPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn
Type String - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan
Dhcp IntegerV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan
Dns List<String> - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan
Egress IntegerQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan
Gateway String - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan
Gateway StringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan
Ip String - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan
Ipv6 String - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan
Netmask String - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan
Networkgroup String - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan
Prefixlen Integer - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan
Type String - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan
Type StringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan
Username String - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard
Client StringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Client StringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client IntegerPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client StringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - String
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - Boolean
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Interface String - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - x
Wan StringPassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x
Wireguard StringPrivate Key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- purpose string
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- dhcp
Dns string[] - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp
Enabled boolean - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp
Guarding boolean Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp
Guarding string[]Trusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp
Lease number - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp
Relay booleanEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp
Start string - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp
Stop string - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp
V6Dns string[] - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp
V6Dns booleanAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp
V6Enabled boolean - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp
V6Lease number - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp
V6Start string The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp
V6Stop string The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd
Boot booleanEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd
Boot stringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd
Boot stringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd
Gateway string The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd
Gateway booleanEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain
Name string - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled boolean
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall
Zone stringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp
Snooping boolean - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet
Access booleanEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6Interface
Type string Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6Pd
Interface string The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Prefixid string - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6Pd
Start string The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Stop string The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Enable boolean - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6Ra
Preferred numberLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6Ra
Priority string Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Valid numberLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6Static
Subnet string The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast
Dns boolean - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name string
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network
Group string - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network
Isolation booleanEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- site string
- The name of the site to associate the network with.
- subnet string
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid
Vpn string[]Custom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp
Lan booleanEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan
Id number The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn
Client booleanDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn
Client booleanPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn
Type string - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan
Dhcp numberV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan
Dns string[] - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan
Egress numberQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan
Gateway string - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan
Gateway stringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan
Ip string - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan
Ipv6 string - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan
Netmask string - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan
Networkgroup string - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan
Prefixlen number - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan
Type string - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan
Type stringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan
Username string - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard
Client stringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Client stringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client numberPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client stringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - string
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - boolean
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Interface string - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - x
Wan stringPassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x
Wireguard stringPrivate Key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- purpose str
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- dhcp_
dns Sequence[str] - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp_
enabled bool - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp_
guarding bool Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp_
guarding_ Sequence[str]trusted_ servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp_
lease int - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp_
relay_ boolenabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp_
start str - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp_
stop str - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp_
v6_ Sequence[str]dns - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp_
v6_ booldns_ auto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp_
v6_ boolenabled - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp_
v6_ intlease - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp_
v6_ strstart The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp_
v6_ strstop The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd_
boot_ boolenabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd_
boot_ strfilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd_
boot_ strserver - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd_
gateway str The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd_
gateway_ boolenabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain_
name str - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled bool
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall_
zone_ strid The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp_
snooping bool - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet_
access_ boolenabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6_
interface_ strtype Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6_
pd_ strinterface The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
pd_ strprefixid - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6_
pd_ strstart The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
pd_ strstop The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
ra_ boolenable - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6_
ra_ intpreferred_ lifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6_
ra_ strpriority Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6_
ra_ intvalid_ lifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6_
static_ strsubnet The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast_
dns bool - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name str
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network_
group str - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network_
isolation_ boolenabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- site str
- The name of the site to associate the network with.
- subnet str
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid_
vpn_ Sequence[str]custom_ routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp_
lan_ boolenabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan_
id int The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn_
client_ booldefault_ route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn_
client_ boolpull_ dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn_
type str - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan_
dhcp_ intv6_ pd_ size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan_
dns Sequence[str] - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan_
egress_ intqos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan_
gateway str - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan_
gateway_ strv6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan_
ip str - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan_
ipv6 str - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan_
netmask str - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan_
networkgroup str - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan_
prefixlen int - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan_
type str - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan_
type_ strv6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan_
username str - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard_
client_ strmode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard_
client_ strpeer_ ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
client_ intpeer_ port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
client_ strpeer_ public_ key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - str
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - bool
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
interface str - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - x_
wan_ strpassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x_
wireguard_ strprivate_ key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- purpose String
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- dhcp
Dns List<String> - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp
Enabled Boolean - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp
Guarding Boolean Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp
Guarding List<String>Trusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp
Lease Number - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp
Relay BooleanEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp
Start String - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp
Stop String - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp
V6Dns List<String> - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp
V6Dns BooleanAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp
V6Enabled Boolean - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp
V6Lease Number - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp
V6Start String The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp
V6Stop String The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd
Boot BooleanEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd
Boot StringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd
Boot StringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd
Gateway String The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd
Gateway BooleanEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain
Name String - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled Boolean
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall
Zone StringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp
Snooping Boolean - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet
Access BooleanEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6Interface
Type String Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6Pd
Interface String The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Prefixid String - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6Pd
Start String The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Stop String The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Enable Boolean - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6Ra
Preferred NumberLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6Ra
Priority String Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Valid NumberLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6Static
Subnet String The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast
Dns Boolean - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name String
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network
Group String - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network
Isolation BooleanEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- site String
- The name of the site to associate the network with.
- subnet String
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid
Vpn List<String>Custom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp
Lan BooleanEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan
Id Number The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn
Client BooleanDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn
Client BooleanPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn
Type String - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan
Dhcp NumberV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan
Dns List<String> - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan
Egress NumberQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan
Gateway String - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan
Gateway StringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan
Ip String - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan
Ipv6 String - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan
Netmask String - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan
Networkgroup String - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan
Prefixlen Number - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan
Type String - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan
Type StringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan
Username String - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard
Client StringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Client StringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client NumberPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client StringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - String
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - Boolean
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Interface String - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - x
Wan StringPassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x
Wireguard StringPrivate Key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
Outputs
All input properties are implicitly available as output properties. Additionally, the Network resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Wireguard
Public stringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'.
- Id string
- The provider-assigned unique ID for this managed resource.
- Wireguard
Public stringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'.
- id string
- The provider-assigned unique ID for this managed resource.
- wireguard_
public_ stringkey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'.
- id String
- The provider-assigned unique ID for this managed resource.
- wireguard
Public StringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'.
- id string
- The provider-assigned unique ID for this managed resource.
- wireguard
Public stringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'.
- id str
- The provider-assigned unique ID for this managed resource.
- wireguard_
public_ strkey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'.
- id String
- The provider-assigned unique ID for this managed resource.
- wireguard
Public StringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'.
Look up Existing Network Resource
Get an existing Network resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NetworkState, opts?: CustomResourceOptions): Network@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dhcp_dns: Optional[Sequence[str]] = None,
dhcp_enabled: Optional[bool] = None,
dhcp_guarding: Optional[bool] = None,
dhcp_guarding_trusted_servers: Optional[Sequence[str]] = None,
dhcp_lease: Optional[int] = None,
dhcp_relay_enabled: Optional[bool] = None,
dhcp_start: Optional[str] = None,
dhcp_stop: Optional[str] = None,
dhcp_v6_dns: Optional[Sequence[str]] = None,
dhcp_v6_dns_auto: Optional[bool] = None,
dhcp_v6_enabled: Optional[bool] = None,
dhcp_v6_lease: Optional[int] = None,
dhcp_v6_start: Optional[str] = None,
dhcp_v6_stop: Optional[str] = None,
dhcpd_boot_enabled: Optional[bool] = None,
dhcpd_boot_filename: Optional[str] = None,
dhcpd_boot_server: Optional[str] = None,
dhcpd_gateway: Optional[str] = None,
dhcpd_gateway_enabled: Optional[bool] = None,
domain_name: Optional[str] = None,
enabled: Optional[bool] = None,
firewall_zone_id: Optional[str] = None,
igmp_snooping: Optional[bool] = None,
internet_access_enabled: Optional[bool] = None,
ipv6_interface_type: Optional[str] = None,
ipv6_pd_interface: Optional[str] = None,
ipv6_pd_prefixid: Optional[str] = None,
ipv6_pd_start: Optional[str] = None,
ipv6_pd_stop: Optional[str] = None,
ipv6_ra_enable: Optional[bool] = None,
ipv6_ra_preferred_lifetime: Optional[int] = None,
ipv6_ra_priority: Optional[str] = None,
ipv6_ra_valid_lifetime: Optional[int] = None,
ipv6_static_subnet: Optional[str] = None,
multicast_dns: Optional[bool] = None,
name: Optional[str] = None,
network_group: Optional[str] = None,
network_isolation_enabled: Optional[bool] = None,
purpose: Optional[str] = None,
site: Optional[str] = None,
subnet: Optional[str] = None,
uid_vpn_custom_routings: Optional[Sequence[str]] = None,
upnp_lan_enabled: Optional[bool] = None,
vlan_id: Optional[int] = None,
vpn_client_default_route: Optional[bool] = None,
vpn_client_pull_dns: Optional[bool] = None,
vpn_type: Optional[str] = None,
wan_dhcp_v6_pd_size: Optional[int] = None,
wan_dns: Optional[Sequence[str]] = None,
wan_egress_qos: Optional[int] = None,
wan_gateway: Optional[str] = None,
wan_gateway_v6: Optional[str] = None,
wan_ip: Optional[str] = None,
wan_ipv6: Optional[str] = None,
wan_netmask: Optional[str] = None,
wan_networkgroup: Optional[str] = None,
wan_prefixlen: Optional[int] = None,
wan_type: Optional[str] = None,
wan_type_v6: Optional[str] = None,
wan_username: Optional[str] = None,
wireguard_client_mode: Optional[str] = None,
wireguard_client_peer_ip: Optional[str] = None,
wireguard_client_peer_port: Optional[int] = None,
wireguard_client_peer_public_key: Optional[str] = None,
wireguard_client_preshared_key: Optional[str] = None,
wireguard_client_preshared_key_enabled: Optional[bool] = None,
wireguard_interface: Optional[str] = None,
wireguard_public_key: Optional[str] = None,
x_wan_password: Optional[str] = None,
x_wireguard_private_key: Optional[str] = None) -> Networkfunc GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)resources: _: type: unifi:Network get: id: ${id}import {
to = unifi_network.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Dhcp
Dns List<string> - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- Dhcp
Enabled bool - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- Dhcp
Guarding bool Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- Dhcp
Guarding List<string>Trusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- Dhcp
Lease int - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- Dhcp
Relay boolEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- Dhcp
Start string - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- Dhcp
Stop string - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- Dhcp
V6Dns List<string> - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- Dhcp
V6Dns boolAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- Dhcp
V6Enabled bool - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- Dhcp
V6Lease int - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- Dhcp
V6Start string The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- Dhcp
V6Stop string The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- Dhcpd
Boot boolEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- Dhcpd
Boot stringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- Dhcpd
Boot stringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- Dhcpd
Gateway string The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- Dhcpd
Gateway boolEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- Domain
Name string - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- Enabled bool
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- Firewall
Zone stringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- Igmp
Snooping bool - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- Internet
Access boolEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- Ipv6Interface
Type string Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- Ipv6Pd
Interface string The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Pd
Prefixid string - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- Ipv6Pd
Start string The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Pd
Stop string The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Ra
Enable bool - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- Ipv6Ra
Preferred intLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- Ipv6Ra
Priority string Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- Ipv6Ra
Valid intLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- Ipv6Static
Subnet string The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- Multicast
Dns bool - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- Name string
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- Network
Group string - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- Network
Isolation boolEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- Purpose string
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- Site string
- The name of the site to associate the network with.
- Subnet string
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- Uid
Vpn List<string>Custom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - Upnp
Lan boolEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - Vlan
Id int The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- Vpn
Client boolDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - Vpn
Client boolPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - Vpn
Type string - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - Wan
Dhcp intV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - Wan
Dns List<string> - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- Wan
Egress intQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- Wan
Gateway string - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - Wan
Gateway stringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - Wan
Ip string - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - Wan
Ipv6 string - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - Wan
Netmask string - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - Wan
Networkgroup string - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- Wan
Prefixlen int - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - Wan
Type string - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- Wan
Type stringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- Wan
Username string - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- Wireguard
Client stringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - Wireguard
Client stringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Client intPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Client stringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - string
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - bool
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Interface string - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - Wireguard
Public stringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'. - XWan
Password string - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- XWireguard
Private stringKey - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- Dhcp
Dns []string - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- Dhcp
Enabled bool - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- Dhcp
Guarding bool Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- Dhcp
Guarding []stringTrusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- Dhcp
Lease int - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- Dhcp
Relay boolEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- Dhcp
Start string - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- Dhcp
Stop string - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- Dhcp
V6Dns []string - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- Dhcp
V6Dns boolAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- Dhcp
V6Enabled bool - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- Dhcp
V6Lease int - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- Dhcp
V6Start string The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- Dhcp
V6Stop string The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- Dhcpd
Boot boolEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- Dhcpd
Boot stringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- Dhcpd
Boot stringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- Dhcpd
Gateway string The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- Dhcpd
Gateway boolEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- Domain
Name string - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- Enabled bool
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- Firewall
Zone stringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- Igmp
Snooping bool - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- Internet
Access boolEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- Ipv6Interface
Type string Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- Ipv6Pd
Interface string The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Pd
Prefixid string - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- Ipv6Pd
Start string The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Pd
Stop string The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- Ipv6Ra
Enable bool - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- Ipv6Ra
Preferred intLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- Ipv6Ra
Priority string Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- Ipv6Ra
Valid intLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- Ipv6Static
Subnet string The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- Multicast
Dns bool - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- Name string
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- Network
Group string - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- Network
Isolation boolEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- Purpose string
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- Site string
- The name of the site to associate the network with.
- Subnet string
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- Uid
Vpn []stringCustom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - Upnp
Lan boolEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - Vlan
Id int The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- Vpn
Client boolDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - Vpn
Client boolPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - Vpn
Type string - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - Wan
Dhcp intV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - Wan
Dns []string - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- Wan
Egress intQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- Wan
Gateway string - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - Wan
Gateway stringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - Wan
Ip string - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - Wan
Ipv6 string - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - Wan
Netmask string - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - Wan
Networkgroup string - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- Wan
Prefixlen int - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - Wan
Type string - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- Wan
Type stringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- Wan
Username string - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- Wireguard
Client stringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - Wireguard
Client stringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Client intPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Client stringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - string
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - bool
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - Wireguard
Interface string - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - Wireguard
Public stringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'. - XWan
Password string - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- XWireguard
Private stringKey - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- dhcp_
dns list(string) - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp_
enabled bool - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp_
guarding bool Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp_
guarding_ list(string)trusted_ servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp_
lease number - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp_
relay_ boolenabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp_
start string - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp_
stop string - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp_
v6_ list(string)dns - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp_
v6_ booldns_ auto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp_
v6_ boolenabled - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp_
v6_ numberlease - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp_
v6_ stringstart The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp_
v6_ stringstop The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd_
boot_ boolenabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd_
boot_ stringfilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd_
boot_ stringserver - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd_
gateway string The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd_
gateway_ boolenabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain_
name string - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled bool
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall_
zone_ stringid The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp_
snooping bool - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet_
access_ boolenabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6_
interface_ stringtype Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6_
pd_ stringinterface The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
pd_ stringprefixid - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6_
pd_ stringstart The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
pd_ stringstop The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
ra_ boolenable - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6_
ra_ numberpreferred_ lifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6_
ra_ stringpriority Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6_
ra_ numbervalid_ lifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6_
static_ stringsubnet The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast_
dns bool - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name string
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network_
group string - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network_
isolation_ boolenabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- purpose string
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- site string
- The name of the site to associate the network with.
- subnet string
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid_
vpn_ list(string)custom_ routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp_
lan_ boolenabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan_
id number The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn_
client_ booldefault_ route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn_
client_ boolpull_ dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn_
type string - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan_
dhcp_ numberv6_ pd_ size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan_
dns list(string) - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan_
egress_ numberqos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan_
gateway string - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan_
gateway_ stringv6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan_
ip string - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan_
ipv6 string - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan_
netmask string - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan_
networkgroup string - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan_
prefixlen number - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan_
type string - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan_
type_ stringv6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan_
username string - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard_
client_ stringmode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard_
client_ stringpeer_ ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
client_ numberpeer_ port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
client_ stringpeer_ public_ key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - string
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - bool
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
interface string - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard_
public_ stringkey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'. - x_
wan_ stringpassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x_
wireguard_ stringprivate_ key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- dhcp
Dns List<String> - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp
Enabled Boolean - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp
Guarding Boolean Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp
Guarding List<String>Trusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp
Lease Integer - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp
Relay BooleanEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp
Start String - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp
Stop String - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp
V6Dns List<String> - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp
V6Dns BooleanAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp
V6Enabled Boolean - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp
V6Lease Integer - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp
V6Start String The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp
V6Stop String The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd
Boot BooleanEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd
Boot StringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd
Boot StringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd
Gateway String The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd
Gateway BooleanEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain
Name String - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled Boolean
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall
Zone StringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp
Snooping Boolean - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet
Access BooleanEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6Interface
Type String Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6Pd
Interface String The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Prefixid String - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6Pd
Start String The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Stop String The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Enable Boolean - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6Ra
Preferred IntegerLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6Ra
Priority String Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Valid IntegerLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6Static
Subnet String The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast
Dns Boolean - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name String
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network
Group String - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network
Isolation BooleanEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- purpose String
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- site String
- The name of the site to associate the network with.
- subnet String
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid
Vpn List<String>Custom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp
Lan BooleanEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan
Id Integer The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn
Client BooleanDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn
Client BooleanPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn
Type String - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan
Dhcp IntegerV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan
Dns List<String> - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan
Egress IntegerQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan
Gateway String - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan
Gateway StringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan
Ip String - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan
Ipv6 String - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan
Netmask String - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan
Networkgroup String - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan
Prefixlen Integer - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan
Type String - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan
Type StringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan
Username String - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard
Client StringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Client StringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client IntegerPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client StringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - String
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - Boolean
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Interface String - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Public StringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'. - x
Wan StringPassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x
Wireguard StringPrivate Key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- dhcp
Dns string[] - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp
Enabled boolean - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp
Guarding boolean Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp
Guarding string[]Trusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp
Lease number - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp
Relay booleanEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp
Start string - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp
Stop string - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp
V6Dns string[] - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp
V6Dns booleanAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp
V6Enabled boolean - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp
V6Lease number - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp
V6Start string The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp
V6Stop string The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd
Boot booleanEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd
Boot stringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd
Boot stringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd
Gateway string The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd
Gateway booleanEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain
Name string - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled boolean
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall
Zone stringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp
Snooping boolean - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet
Access booleanEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6Interface
Type string Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6Pd
Interface string The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Prefixid string - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6Pd
Start string The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Stop string The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Enable boolean - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6Ra
Preferred numberLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6Ra
Priority string Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Valid numberLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6Static
Subnet string The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast
Dns boolean - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name string
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network
Group string - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network
Isolation booleanEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- purpose string
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- site string
- The name of the site to associate the network with.
- subnet string
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid
Vpn string[]Custom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp
Lan booleanEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan
Id number The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn
Client booleanDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn
Client booleanPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn
Type string - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan
Dhcp numberV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan
Dns string[] - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan
Egress numberQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan
Gateway string - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan
Gateway stringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan
Ip string - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan
Ipv6 string - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan
Netmask string - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan
Networkgroup string - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan
Prefixlen number - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan
Type string - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan
Type stringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan
Username string - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard
Client stringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Client stringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client numberPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client stringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - string
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - boolean
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Interface string - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Public stringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'. - x
Wan stringPassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x
Wireguard stringPrivate Key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- dhcp_
dns Sequence[str] - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp_
enabled bool - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp_
guarding bool Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp_
guarding_ Sequence[str]trusted_ servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp_
lease int - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp_
relay_ boolenabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp_
start str - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp_
stop str - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp_
v6_ Sequence[str]dns - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp_
v6_ booldns_ auto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp_
v6_ boolenabled - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp_
v6_ intlease - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp_
v6_ strstart The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp_
v6_ strstop The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd_
boot_ boolenabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd_
boot_ strfilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd_
boot_ strserver - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd_
gateway str The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd_
gateway_ boolenabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain_
name str - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled bool
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall_
zone_ strid The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp_
snooping bool - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet_
access_ boolenabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6_
interface_ strtype Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6_
pd_ strinterface The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
pd_ strprefixid - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6_
pd_ strstart The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
pd_ strstop The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6_
ra_ boolenable - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6_
ra_ intpreferred_ lifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6_
ra_ strpriority Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6_
ra_ intvalid_ lifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6_
static_ strsubnet The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast_
dns bool - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name str
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network_
group str - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network_
isolation_ boolenabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- purpose str
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- site str
- The name of the site to associate the network with.
- subnet str
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid_
vpn_ Sequence[str]custom_ routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp_
lan_ boolenabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan_
id int The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn_
client_ booldefault_ route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn_
client_ boolpull_ dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn_
type str - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan_
dhcp_ intv6_ pd_ size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan_
dns Sequence[str] - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan_
egress_ intqos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan_
gateway str - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan_
gateway_ strv6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan_
ip str - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan_
ipv6 str - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan_
netmask str - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan_
networkgroup str - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan_
prefixlen int - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan_
type str - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan_
type_ strv6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan_
username str - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard_
client_ strmode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard_
client_ strpeer_ ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
client_ intpeer_ port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
client_ strpeer_ public_ key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - str
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - bool
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard_
interface str - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard_
public_ strkey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'. - x_
wan_ strpassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x_
wireguard_ strprivate_ key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
- dhcp
Dns List<String> - List of IPv4 DNS server addresses to be provided to DHCP clients. Examples:
- Use ['8.8.8.8', '8.8.4.4'] for Google DNS
- Use ['1.1.1.1', '1.0.0.1'] for Cloudflare DNS
- Use internal DNS servers for corporate networks Maximum 4 servers can be specified.
- dhcp
Enabled Boolean - Controls whether DHCP server is enabled for this network. When enabled:
- The network will automatically assign IP addresses to clients
- DHCP options (DNS, lease time) will be provided to clients
- Static IP assignments can still be made outside the DHCP range
- dhcp
Guarding Boolean Enables DHCP Guarding for this network, blocking DHCP server responses from untrusted/rogue sources so only the trusted DHCP server can hand out leases. When enabled:
- Drops DHCP offers/acknowledgements from servers other than the trusted one
- Protects clients from rogue or misconfigured DHCP servers
This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value enabled in the UI is preserved), rather than being reset. Set it explicitly to manage the value from Terraform.- dhcp
Guarding List<String>Trusted Servers List of trusted DHCP server IPv4 addresses for DHCP Guarding. When
dhcpGuardingis enabled the controller drops DHCP offers from every server except those listed here, so at least one address is required whenever guarding is on (for a network served by the UniFi gateway's own DHCP server this is typically the network's gateway IP). Maximum 3 servers can be specified.Like
dhcpGuarding, this attribute isOptionalandComputed: when omitted it inherits the current value reported by the controller (so a list configured in the UI is preserved rather than cleared). Set it explicitly to manage the trusted servers from Terraform.- dhcp
Lease Number - The DHCP lease time in seconds. Common values:
- 86400 (1 day) - Default, suitable for most networks
- 3600 (1 hour) - For testing or temporary networks
- 604800 (1 week) - For stable networks with static clients
- 2592000 (30 days) - For very stable networks
- dhcp
Relay BooleanEnabled - Enables DHCP relay for this network. When enabled:
- DHCP requests are forwarded to an external DHCP server
- Local DHCP server is disabled
- Useful for centralized DHCP management
- dhcp
Start String - The starting IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical start: '192.168.1.100'
- For subnet 10.0.0.0/24, typical start: '10.0.0.100' Ensure this address is within the network's subnet.
- dhcp
Stop String - The ending IPv4 address of the DHCP range. Examples:
- For subnet 192.168.1.0/24, typical stop: '192.168.1.254'
- For subnet 10.0.0.0/24, typical stop: '10.0.0.254' Must be greater than dhcpStart and within the network's subnet.
- dhcp
V6Dns List<String> - List of IPv6 DNS server addresses for DHCPv6 clients. Examples:
- Use ['2001:4860:4860::8888', '2001:4860:4860::8844'] for Google DNS
- Use ['2606:4700:4700::1111', '2606:4700:4700::1001'] for Cloudflare DNS Only used when dhcpV6DnsAuto is false. Maximum of 4 addresses are allowed.
- dhcp
V6Dns BooleanAuto - Controls DNS server source for DHCPv6 clients:
- true - Use upstream DNS servers (recommended)
- false - Use manually specified servers from dhcpV6Dns Default is true for easier management.
- dhcp
V6Enabled Boolean - Enables stateful DHCPv6 for IPv6 address assignment. When enabled:
- Provides IPv6 addresses to clients
- Works alongside SLAAC if configured
- Allows for more controlled IPv6 addressing
- dhcp
V6Lease Number - The DHCPv6 lease time in seconds. Common values:
- 86400 (1 day) - Default setting
- 3600 (1 hour) - For testing
- 604800 (1 week) - For stable networks Typically longer than IPv4 DHCP leases.
- dhcp
V6Start String The starting IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be a valid IPv6 address within your allocated IPv6 subnet.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcp
V6Stop String The ending IPv6 address for the DHCPv6 range. Used in static DHCPv6 configuration. Must be after dhcpV6Start in the IPv6 address space.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn DHCPv6 off withdhcpV6Enabled/ipv6InterfaceTypeinstead. Set it explicitly to manage the value from Terraform.- dhcpd
Boot BooleanEnabled - Enables DHCP boot options for PXE boot or network boot configurations. When enabled:
- Allows network devices to boot from a TFTP server
- Requires dhcpdBootServer and dhcpdBootFilename to be set
- Commonly used for diskless workstations or network installations
- dhcpd
Boot StringFilename - The boot filename to be loaded from the TFTP server. Examples:
- 'pxelinux.0' - Standard PXE boot loader
- 'undionly.kpxe' - iPXE boot loader
- Custom paths for specific boot images
- dhcpd
Boot StringServer - The IPv4 address of the TFTP server for network boot. This setting:
- Is required when dhcpdBootEnabled is true
- Should be a reliable, always-on server
- Must be accessible to all clients that need to boot
- dhcpd
Gateway String The IPv4 default gateway to advertise to this network's DHCP clients (DHCP option 3) when
dhcpdGatewayEnabledistrue. Typically an address inside this network'ssubnet; an off-subnet address (e.g. a 100.64.0.0/10 Tailscale CGNAT address) passes validation here but may be rejected by the controller at apply. IPv4 only — there is no IPv6 default-gateway override.This attribute is
OptionalandComputed: when omitted it inherits the current value reported by the controller (so a manually-set gateway, or a value the controller echoes in auto mode, does not show as drift). Set it together withdhcpdGatewayEnabled = trueto manage the override from Terraform.- dhcpd
Gateway BooleanEnabled Controls whether the default gateway advertised to this network's DHCP clients is selected automatically or set manually — equivalent to switching the network's default gateway from automatic to a manually specified address in the UniFi UI (the exact control label and location vary across controller versions). When
false(automatic, the default) the controller advertises the network's own interface IP as the gateway via DHCP option 3. Set this totrueto advertise the address indhcpdGatewayinstead — useful for pointing clients at a custom next hop such as a VPN/subnet-router node (e.g. Tailscale).This attribute is
OptionalandComputed: when omitted from configuration it inherits the current value reported by the controller (so a value set in the UI is preserved) rather than being reset. Whentrue,dhcpdGatewayis required.Only meaningful when this network runs the UniFi DHCP server (
dhcpEnabled = trueanddhcpRelayEnabled = false) with an address range (dhcpStart/dhcpStop) configured — the override is DHCP option 3 and the controller rejects a manual gateway with no pool to hand out. It has no effect onwanorvlan-onlynetworks. Note: on some controller versions the network must also be in manual configuration mode (toggled in the UniFi UI) before a manually-specified gateway is honored.- domain
Name String - The domain name for this network. Examples:
- 'corp.example.com' - For corporate networks
- 'guest.example.com' - For guest networks
- 'iot.example.com' - For IoT networks Used for internal DNS resolution and DHCP options.
- enabled Boolean
- Controls whether this network is active. When disabled:
- Network will not be available to clients
- DHCP services will be stopped
- Existing clients will be disconnected Useful for temporary network maintenance or security measures.
- firewall
Zone StringId The ID of the Zone-Based Firewall (ZBF) zone this network belongs to. This is only meaningful on UniFi OS 9.x controllers with Zone-Based Firewall enabled. The zone ID is site-scoped: an ID from a different site is rejected or silently dropped by the controller.
This attribute is
Optional+Computed:- Leave it unset to preserve whatever zone the controller (or a
unifi.firewall.Zoneresource) has assigned. The provider never sends the field when it is not configured, so it cannot clobber a zone managed elsewhere. - Set it to explicitly pin or move this network to a specific zone — choose the zone appropriate for the network's purpose (e.g. Internal, External, Guest).
On read the controller-assigned zone is always populated, so drift is detectable and
terraform importround-trips cleanly. Note the standardOptional+Computed"sticky value" semantics: once set and later removed from configuration the value persists in state rather than reverting, and removing it does not un-zone the network.To manage zone membership from the zone side instead, use
unifi_firewall_zone.networks. Do not manage the same network-to-zone association from both sides.- Leave it unset to preserve whatever zone the controller (or a
- igmp
Snooping Boolean - Enables IGMP (Internet Group Management Protocol) snooping. When enabled:
- Optimizes multicast traffic flow
- Reduces network congestion
- Improves performance for multicast applications (e.g., IPTV) Recommended for networks with multicast traffic.
- internet
Access BooleanEnabled - Controls internet access for this network. When disabled:
- Clients cannot access external networks
- Internal network access remains available
- Useful for creating isolated or secure networks
- ipv6Interface
Type String Specifies the IPv6 connection type. Must be one of:
none- IPv6 disabled (default)static- Static IPv6 addressingpd- Prefix Delegation from upstreamsingleNetwork- Share a delegated IPv6 prefix with a single LAN
Choose based on your IPv6 deployment strategy and ISP capabilities. Note:
singleNetworkhas companion controller settings (the single-network interface/LAN binding) that this provider does not yet expose, so a baresingleNetworknetwork may not be fully configurable.- ipv6Pd
Interface String The WAN interface to use for IPv6 Prefix Delegation. Options:
wan- Primary WAN interfacewan2- Secondary WAN interface Only applicable whenipv6InterfaceTypeis 'pd'.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Prefixid String - The IPv6 Prefix ID for Prefix Delegation. Used to:
- Differentiate multiple delegated prefixes
- Create unique subnets from the delegated prefix Typically a hexadecimal value (e.g., '0', '1', 'a1').
- ipv6Pd
Start String The starting IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be within the delegated prefix range.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Pd
Stop String The ending IPv6 address for Prefix Delegation range. Only used when
ipv6InterfaceTypeis 'pd'. Must be afteripv6PdStartwithin the delegated prefix.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'pd' to disable Prefix Delegation instead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Enable Boolean - Enables IPv6 Router Advertisements (RA). When enabled:
- Announces IPv6 prefix information to clients
- Enables SLAAC address configuration
- Required for most IPv6 deployments
- ipv6Ra
Preferred NumberLifetime - The preferred lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be less than or equal to
ipv6RaValidLifetime - Default: 14400 (4 hours)
- After this time, addresses become deprecated but still usable
- Must be less than or equal to
- ipv6Ra
Priority String Sets the priority for IPv6 Router Advertisements. Options:
high- Preferred for primary networksmedium- Standard prioritylow- For backup or secondary networks Affects router selection when multiple IPv6 routers exist.
This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; turn Router Advertisements off withipv6RaEnableinstead. Set it explicitly to manage the value from Terraform.- ipv6Ra
Valid NumberLifetime - The valid lifetime (in seconds) for IPv6 addresses in Router Advertisements.
- Must be greater than or equal to
ipv6RaPreferredLifetime - Default: 86400 (24 hours)
- After this time, addresses become invalid
- Must be greater than or equal to
- ipv6Static
Subnet String The static IPv6 subnet in CIDR notation (e.g., '2001:db8::/64') when using static IPv6. Only applicable when
ipv6InterfaceTypeis 'static'. Must be a valid IPv6 subnet allocated to your organization.This attribute is
Optional+Computed: when omitted from configuration it inherits the current value reported by the controller, so a value configured in the UI (or read in viaterraform import) is preserved rather than planned for removal. Note the standardOptional+Computed"sticky value" semantics — once the controller has a value, removing the attribute from configuration leaves that value in place rather than clearing it (the provider serializes this field withomitempty, so an empty value is never sent). There is therefore no way to clear it by deleting it from configuration; switchipv6InterfaceTypeaway from 'static' to disable static IPv6 instead. Set it explicitly to manage the value from Terraform.- multicast
Dns Boolean - Enables Multicast DNS (mDNS/Bonjour/Avahi) on the network. When enabled:
- Allows device discovery (e.g., printers, Chromecasts)
- Supports zero-configuration networking
- Available on Controller version 7 and later
- name String
- The name of the network. This should be a descriptive name that helps identify the network's purpose, such as 'Corporate-Main', 'Guest-Network', or 'IoT-VLAN'.
- network
Group String - The network group for this network. Default is 'LAN'. For WAN networks, use 'WAN' or 'WAN2'. Network groups help organize and apply policies to multiple networks.
- network
Isolation BooleanEnabled - Isolates this network from other local networks/VLANs on the site. When enabled:
- Hosts on this network cannot route to or from other local networks on the site
- Gateway and internet access are retained (internet access is subject to
internetAccessEnabled) - This is a routing/firewall option for network-to-network isolation, distinct from per-client (WLAN) isolation
- purpose String
- The purpose/type of the network. Must be one of:
corporate- Standard network for corporate use with full accessguest- Isolated network for guest access with limited permissionswan- External network connection (WAN uplink)vlan-only- VLAN network without DHCP servicesvpn-client- Site-to-site VPN client connection (see thevpnTypeandwireguard_client_*arguments to configure a WireGuard VPN client)
- site String
- The name of the site to associate the network with.
- subnet String
- The IPv4 subnet for this network in CIDR notation (e.g., '192.168.1.0/24'). This defines the network's address space and determines the range of IP addresses available for DHCP.
- uid
Vpn List<String>Custom Routings - The list of destination subnets (CIDR notation) routed through the VPN client tunnel when
vpnClientDefaultRouteis false. Values are canonicalized to their network address (e.g.10.0.0.1/16becomes10.0.0.0/16). Only applicable whenpurposeis 'vpn-client'. - upnp
Lan BooleanEnabled - Whether clients on THIS network are allowed to request UPnP/NAT-PMP port mappings. Per-network opt-in that complements the gateway-global UPnP toggle (
unifi_setting_usg.upnp_enabled): UPnP must be enabled globally AND on a given network for that network's devices to self-map WAN ports. Leave false on untrusted networks (IoT, Guest, …) so a compromised device cannot open inbound holes in the firewall; enable only on networks whose devices you trust to manage their own port mappings. - vlan
Id Number The VLAN ID for this network. Valid range is 0-4096. Common uses:
- 1-4094: Standard VLAN range for network segmentation
- 0: Untagged/native VLAN
4094: Reserved for special purposes
- vpn
Client BooleanDefault Route - When true, route all of the gateway's internet traffic through the VPN client tunnel. When false (default), only the destinations in
uidVpnCustomRoutingare routed through the tunnel. Only applicable whenpurposeis 'vpn-client'. - vpn
Client BooleanPull Dns - When true, use DNS servers advertised by the VPN peer for traffic on the tunnel. Only applicable when
purposeis 'vpn-client'. - vpn
Type String - The VPN type for a
vpn-clientnetwork. Currentlywireguard-clientis supported, which connects the gateway to a remote WireGuard server. Only applicable whenpurposeis 'vpn-client'. Awireguard-clientnetwork also requiressubnet(the tunnel interface address, e.g.10.0.0.2/32) anddhcpDns(interface DNS); the controller rejects the create without them. - wan
Dhcp NumberV6Pd Size - The IPv6 prefix size to request from ISP. Must be between 48 and 64.
Only applicable when
wanTypeV6is 'dhcpv6'. - wan
Dns List<String> - List of IPv4 DNS servers for WAN interface. Examples:
- ISP provided DNS servers
- Public DNS services (e.g., 8.8.8.8, 1.1.1.1)
- Maximum 4 servers can be specified
- wan
Egress NumberQos - Quality of Service (QoS) priority for WAN egress traffic (0-7).
- 0 (default) - Best effort
- 1-4 - Increasing priority
- 5-7 - Highest priority, use sparingly Higher values get preferential treatment.
- wan
Gateway String - The IPv4 gateway address for WAN interface.
Required when
wanTypeis 'static'. Typically the ISP's router IP address. - wan
Gateway StringV6 - The IPv6 gateway address for WAN interface.
Required when
wanTypeV6is 'static'. Typically the ISP's router IPv6 address. - wan
Ip String - The static IPv4 address for WAN interface.
Required when
wanTypeis 'static'. Must be a valid public IP address assigned by your ISP. - wan
Ipv6 String - The static IPv6 address for WAN interface.
Required when
wanTypeV6is 'static'. Must be a valid public IPv6 address assigned by your ISP. - wan
Netmask String - The IPv4 netmask for WAN interface (e.g., '255.255.255.0').
Required when
wanTypeis 'static'. Must match the subnet mask provided by your ISP. - wan
Networkgroup String - The WAN interface group assignment. Options:
WAN- Primary WAN interfaceWAN2- Secondary WAN interfaceWAN_LTE_FAILOVER- LTE backup connection Used for dual WAN and failover configurations.
- wan
Prefixlen Number - The IPv6 prefix length for WAN interface. Must be between 1 and 128.
Only applicable when
wanTypeV6is 'static'. - wan
Type String - The IPv4 WAN connection type. Options:
disabled- WAN interface disabledstatic- Static IP configurationdhcp- Dynamic IP from ISPpppoe- PPPoE connection (common for DSL) Choose based on your ISP's requirements.
- wan
Type StringV6 - The IPv6 WAN connection type. Options:
disabled- IPv6 disabledstatic- Static IPv6 configurationdhcpv6- Dynamic IPv6 from ISP Choose based on your ISP's requirements.
- wan
Username String - Username for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Cannot contain spaces or special characters
- wireguard
Client StringMode - How the WireGuard VPN client peer is configured. Currently only
manualis supported, configuring the peer with the individualwireguard_client_*arguments. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Client StringPeer Ip - The remote WireGuard server's endpoint host or IP address that the gateway dials. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client NumberPeer Port - The remote WireGuard server's listen port (e.g. 51820). Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Client StringPeer Public Key - The remote WireGuard server's public key (the peer the gateway connects to). Only applicable when
vpnTypeis 'wireguard-client'. - String
- An optional WireGuard pre-shared key (PSK) for an additional layer of symmetric-key security with the peer. Keep this value secret. The controller may not return this value on read, so it is computed to avoid spurious drift. Only applicable when
vpnTypeis 'wireguard-client'. - Boolean
- Whether a WireGuard pre-shared key is used with the peer. Only applicable when
vpnTypeis 'wireguard-client'. - wireguard
Interface String - The WAN interface the WireGuard tunnel egresses from. One of
wanorwan2. Only applicable whenvpnTypeis 'wireguard-client'. - wireguard
Public StringKey - The gateway's own WireGuard public key for this VPN client. The controller does not return it, so the provider derives it from the private key (Curve25519). Add this key as a peer on the remote WireGuard server. Only set when
vpnTypeis 'wireguard-client'. - x
Wan StringPassword - Password for WAN authentication.
- Required for PPPoE connections
- May be needed for some ISP configurations
- Must be kept secret
- x
Wireguard StringPrivate Key - The gateway's own WireGuard private key for this VPN client. If omitted, a key pair is generated for you and the public key is exposed via
wireguardPublicKey. Keep this value secret. Only applicable whenvpnTypeis 'wireguard-client'.
Import
The pulumi import command can be used, for example:
import from provider configured site
$ pulumi import unifi:index/network:Network mynetwork 5dc28e5e9106d105bdc87217
import from another site
$ pulumi import unifi:index/network:Network mynetwork bfa2l6i7:5dc28e5e9106d105bdc87217
import network by name
$ pulumi import unifi:index/network:Network mynetwork name=LAN
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- unifi pulumiverse/pulumi-unifi
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
unifiTerraform Provider.
published on Wednesday, Jul 8, 2026 by Pulumiverse