1. Packages
  2. Openwrt Provider
  3. API Docs
  4. DhcpDhcp
openwrt 0.0.20 published on Friday, Mar 7, 2025 by joneshf

openwrt.DhcpDhcp

Explore with Pulumi AI

Per interface lease pools and settings for serving DHCP requests.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as openwrt from "@pulumi/openwrt";

const brTesting = new openwrt.NetworkDevice("brTesting", {
    networkDeviceId: "br_testing",
    ports: [
        "eth0",
        "eth1",
        "eth2.20",
    ],
    type: "bridge",
});
const testingNetworkInterface = new openwrt.NetworkInterface("testingNetworkInterface", {
    device: brTesting.name,
    dns: [
        "9.9.9.9",
        "1.1.1.1",
    ],
    networkInterfaceId: "testing",
    ipaddr: "192.168.3.1",
    netmask: "255.255.255.0",
    proto: "static",
});
const testingDhcpDhcp = new openwrt.DhcpDhcp("testingDhcpDhcp", {
    dhcpv4: "server",
    dhcpv6: "server",
    dhcpDhcpId: "testing",
    "interface": testingNetworkInterface.networkInterfaceId,
    leasetime: "12h",
    limit: 150,
    raFlags: [
        "managed-config",
        "other-config",
    ],
    start: 100,
});
Copy
import pulumi
import pulumi_openwrt as openwrt

br_testing = openwrt.NetworkDevice("brTesting",
    network_device_id="br_testing",
    ports=[
        "eth0",
        "eth1",
        "eth2.20",
    ],
    type="bridge")
testing_network_interface = openwrt.NetworkInterface("testingNetworkInterface",
    device=br_testing.name,
    dns=[
        "9.9.9.9",
        "1.1.1.1",
    ],
    network_interface_id="testing",
    ipaddr="192.168.3.1",
    netmask="255.255.255.0",
    proto="static")
testing_dhcp_dhcp = openwrt.DhcpDhcp("testingDhcpDhcp",
    dhcpv4="server",
    dhcpv6="server",
    dhcp_dhcp_id="testing",
    interface=testing_network_interface.network_interface_id,
    leasetime="12h",
    limit=150,
    ra_flags=[
        "managed-config",
        "other-config",
    ],
    start=100)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/openwrt/openwrt"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		brTesting, err := openwrt.NewNetworkDevice(ctx, "brTesting", &openwrt.NetworkDeviceArgs{
			NetworkDeviceId: pulumi.String("br_testing"),
			Ports: pulumi.StringArray{
				pulumi.String("eth0"),
				pulumi.String("eth1"),
				pulumi.String("eth2.20"),
			},
			Type: pulumi.String("bridge"),
		})
		if err != nil {
			return err
		}
		testingNetworkInterface, err := openwrt.NewNetworkInterface(ctx, "testingNetworkInterface", &openwrt.NetworkInterfaceArgs{
			Device: brTesting.Name,
			Dns: pulumi.StringArray{
				pulumi.String("9.9.9.9"),
				pulumi.String("1.1.1.1"),
			},
			NetworkInterfaceId: pulumi.String("testing"),
			Ipaddr:             pulumi.String("192.168.3.1"),
			Netmask:            pulumi.String("255.255.255.0"),
			Proto:              pulumi.String("static"),
		})
		if err != nil {
			return err
		}
		_, err = openwrt.NewDhcpDhcp(ctx, "testingDhcpDhcp", &openwrt.DhcpDhcpArgs{
			Dhcpv4:     pulumi.String("server"),
			Dhcpv6:     pulumi.String("server"),
			DhcpDhcpId: pulumi.String("testing"),
			Interface:  testingNetworkInterface.NetworkInterfaceId,
			Leasetime:  pulumi.String("12h"),
			Limit:      pulumi.Float64(150),
			RaFlags: pulumi.StringArray{
				pulumi.String("managed-config"),
				pulumi.String("other-config"),
			},
			Start: pulumi.Float64(100),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Openwrt = Pulumi.Openwrt;

return await Deployment.RunAsync(() => 
{
    var brTesting = new Openwrt.NetworkDevice("brTesting", new()
    {
        NetworkDeviceId = "br_testing",
        Ports = new[]
        {
            "eth0",
            "eth1",
            "eth2.20",
        },
        Type = "bridge",
    });

    var testingNetworkInterface = new Openwrt.NetworkInterface("testingNetworkInterface", new()
    {
        Device = brTesting.Name,
        Dns = new[]
        {
            "9.9.9.9",
            "1.1.1.1",
        },
        NetworkInterfaceId = "testing",
        Ipaddr = "192.168.3.1",
        Netmask = "255.255.255.0",
        Proto = "static",
    });

    var testingDhcpDhcp = new Openwrt.DhcpDhcp("testingDhcpDhcp", new()
    {
        Dhcpv4 = "server",
        Dhcpv6 = "server",
        DhcpDhcpId = "testing",
        Interface = testingNetworkInterface.NetworkInterfaceId,
        Leasetime = "12h",
        Limit = 150,
        RaFlags = new[]
        {
            "managed-config",
            "other-config",
        },
        Start = 100,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openwrt.NetworkDevice;
import com.pulumi.openwrt.NetworkDeviceArgs;
import com.pulumi.openwrt.NetworkInterface;
import com.pulumi.openwrt.NetworkInterfaceArgs;
import com.pulumi.openwrt.DhcpDhcp;
import com.pulumi.openwrt.DhcpDhcpArgs;
import java.util.List;
import java.util.ArrayList;
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) {
        var brTesting = new NetworkDevice("brTesting", NetworkDeviceArgs.builder()
            .networkDeviceId("br_testing")
            .ports(            
                "eth0",
                "eth1",
                "eth2.20")
            .type("bridge")
            .build());

        var testingNetworkInterface = new NetworkInterface("testingNetworkInterface", NetworkInterfaceArgs.builder()
            .device(brTesting.name())
            .dns(            
                "9.9.9.9",
                "1.1.1.1")
            .networkInterfaceId("testing")
            .ipaddr("192.168.3.1")
            .netmask("255.255.255.0")
            .proto("static")
            .build());

        var testingDhcpDhcp = new DhcpDhcp("testingDhcpDhcp", DhcpDhcpArgs.builder()
            .dhcpv4("server")
            .dhcpv6("server")
            .dhcpDhcpId("testing")
            .interface_(testingNetworkInterface.networkInterfaceId())
            .leasetime("12h")
            .limit(150)
            .raFlags(            
                "managed-config",
                "other-config")
            .start(100)
            .build());

    }
}
Copy
resources:
  brTesting:
    type: openwrt:NetworkDevice
    properties:
      networkDeviceId: br_testing
      ports:
        - eth0
        - eth1
        - eth2.20
      type: bridge
  testingNetworkInterface:
    type: openwrt:NetworkInterface
    properties:
      device: ${brTesting.name}
      dns:
        - 9.9.9.9
        - 1.1.1.1
      networkInterfaceId: testing
      ipaddr: 192.168.3.1
      netmask: 255.255.255.0
      proto: static
  testingDhcpDhcp:
    type: openwrt:DhcpDhcp
    properties:
      dhcpv4: server
      dhcpv6: server
      dhcpDhcpId: testing
      interface: ${testingNetworkInterface.networkInterfaceId}
      leasetime: 12h
      limit: 150
      raFlags:
        - managed-config
        - other-config
      start: 100
Copy

Create DhcpDhcp Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new DhcpDhcp(name: string, args: DhcpDhcpArgs, opts?: CustomResourceOptions);
@overload
def DhcpDhcp(resource_name: str,
             args: DhcpDhcpArgs,
             opts: Optional[ResourceOptions] = None)

@overload
def DhcpDhcp(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             dhcp_dhcp_id: Optional[str] = None,
             dhcpv4: Optional[str] = None,
             dhcpv6: Optional[str] = None,
             force: Optional[bool] = None,
             ignore: Optional[bool] = None,
             interface: Optional[str] = None,
             leasetime: Optional[str] = None,
             limit: Optional[float] = None,
             ra: Optional[str] = None,
             ra_flags: Optional[Sequence[str]] = None,
             start: Optional[float] = None)
func NewDhcpDhcp(ctx *Context, name string, args DhcpDhcpArgs, opts ...ResourceOption) (*DhcpDhcp, error)
public DhcpDhcp(string name, DhcpDhcpArgs args, CustomResourceOptions? opts = null)
public DhcpDhcp(String name, DhcpDhcpArgs args)
public DhcpDhcp(String name, DhcpDhcpArgs args, CustomResourceOptions options)
type: openwrt:DhcpDhcp
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DhcpDhcpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DhcpDhcpArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DhcpDhcpArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DhcpDhcpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DhcpDhcpArgs
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 dhcpDhcpResource = new Openwrt.DhcpDhcp("dhcpDhcpResource", new()
{
    DhcpDhcpId = "string",
    Dhcpv4 = "string",
    Dhcpv6 = "string",
    Force = false,
    Ignore = false,
    Interface = "string",
    Leasetime = "string",
    Limit = 0,
    Ra = "string",
    RaFlags = new[]
    {
        "string",
    },
    Start = 0,
});
Copy
example, err := openwrt.NewDhcpDhcp(ctx, "dhcpDhcpResource", &openwrt.DhcpDhcpArgs{
	DhcpDhcpId: pulumi.String("string"),
	Dhcpv4:     pulumi.String("string"),
	Dhcpv6:     pulumi.String("string"),
	Force:      pulumi.Bool(false),
	Ignore:     pulumi.Bool(false),
	Interface:  pulumi.String("string"),
	Leasetime:  pulumi.String("string"),
	Limit:      pulumi.Float64(0),
	Ra:         pulumi.String("string"),
	RaFlags: pulumi.StringArray{
		pulumi.String("string"),
	},
	Start: pulumi.Float64(0),
})
Copy
var dhcpDhcpResource = new DhcpDhcp("dhcpDhcpResource", DhcpDhcpArgs.builder()
    .dhcpDhcpId("string")
    .dhcpv4("string")
    .dhcpv6("string")
    .force(false)
    .ignore(false)
    .interface_("string")
    .leasetime("string")
    .limit(0)
    .ra("string")
    .raFlags("string")
    .start(0)
    .build());
Copy
dhcp_dhcp_resource = openwrt.DhcpDhcp("dhcpDhcpResource",
    dhcp_dhcp_id="string",
    dhcpv4="string",
    dhcpv6="string",
    force=False,
    ignore=False,
    interface="string",
    leasetime="string",
    limit=0,
    ra="string",
    ra_flags=["string"],
    start=0)
Copy
const dhcpDhcpResource = new openwrt.DhcpDhcp("dhcpDhcpResource", {
    dhcpDhcpId: "string",
    dhcpv4: "string",
    dhcpv6: "string",
    force: false,
    ignore: false,
    "interface": "string",
    leasetime: "string",
    limit: 0,
    ra: "string",
    raFlags: ["string"],
    start: 0,
});
Copy
type: openwrt:DhcpDhcp
properties:
    dhcpDhcpId: string
    dhcpv4: string
    dhcpv6: string
    force: false
    ignore: false
    interface: string
    leasetime: string
    limit: 0
    ra: string
    raFlags:
        - string
    start: 0
Copy

DhcpDhcp 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 DhcpDhcp resource accepts the following input properties:

DhcpDhcpId This property is required. string
Name of the section. This name is only used when interacting with UCI directly.
Dhcpv4 string
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
Dhcpv6 string
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
Force bool
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
Ignore bool
Specifies whether dnsmasq should ignore this pool.
Interface string
Leasetime string
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
Limit double
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
Ra string
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
RaFlags List<string>
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
Start double
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
DhcpDhcpId This property is required. string
Name of the section. This name is only used when interacting with UCI directly.
Dhcpv4 string
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
Dhcpv6 string
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
Force bool
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
Ignore bool
Specifies whether dnsmasq should ignore this pool.
Interface string
Leasetime string
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
Limit float64
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
Ra string
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
RaFlags []string
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
Start float64
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
dhcpDhcpId This property is required. String
Name of the section. This name is only used when interacting with UCI directly.
dhcpv4 String
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
dhcpv6 String
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
force Boolean
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
ignore Boolean
Specifies whether dnsmasq should ignore this pool.
interface_ String
leasetime String
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
limit Double
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
ra String
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
raFlags List<String>
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
start Double
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
dhcpDhcpId This property is required. string
Name of the section. This name is only used when interacting with UCI directly.
dhcpv4 string
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
dhcpv6 string
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
force boolean
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
ignore boolean
Specifies whether dnsmasq should ignore this pool.
interface string
leasetime string
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
limit number
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
ra string
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
raFlags string[]
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
start number
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
dhcp_dhcp_id This property is required. str
Name of the section. This name is only used when interacting with UCI directly.
dhcpv4 str
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
dhcpv6 str
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
force bool
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
ignore bool
Specifies whether dnsmasq should ignore this pool.
interface str
leasetime str
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
limit float
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
ra str
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
ra_flags Sequence[str]
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
start float
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
dhcpDhcpId This property is required. String
Name of the section. This name is only used when interacting with UCI directly.
dhcpv4 String
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
dhcpv6 String
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
force Boolean
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
ignore Boolean
Specifies whether dnsmasq should ignore this pool.
interface String
leasetime String
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
limit Number
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
ra String
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
raFlags List<String>
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
start Number
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.

Outputs

All input properties are implicitly available as output properties. Additionally, the DhcpDhcp resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing DhcpDhcp Resource

Get an existing DhcpDhcp 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?: DhcpDhcpState, opts?: CustomResourceOptions): DhcpDhcp
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        dhcp_dhcp_id: Optional[str] = None,
        dhcpv4: Optional[str] = None,
        dhcpv6: Optional[str] = None,
        force: Optional[bool] = None,
        ignore: Optional[bool] = None,
        interface: Optional[str] = None,
        leasetime: Optional[str] = None,
        limit: Optional[float] = None,
        ra: Optional[str] = None,
        ra_flags: Optional[Sequence[str]] = None,
        start: Optional[float] = None) -> DhcpDhcp
func GetDhcpDhcp(ctx *Context, name string, id IDInput, state *DhcpDhcpState, opts ...ResourceOption) (*DhcpDhcp, error)
public static DhcpDhcp Get(string name, Input<string> id, DhcpDhcpState? state, CustomResourceOptions? opts = null)
public static DhcpDhcp get(String name, Output<String> id, DhcpDhcpState state, CustomResourceOptions options)
resources:  _:    type: openwrt:DhcpDhcp    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
DhcpDhcpId string
Name of the section. This name is only used when interacting with UCI directly.
Dhcpv4 string
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
Dhcpv6 string
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
Force bool
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
Ignore bool
Specifies whether dnsmasq should ignore this pool.
Interface string
Leasetime string
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
Limit double
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
Ra string
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
RaFlags List<string>
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
Start double
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
DhcpDhcpId string
Name of the section. This name is only used when interacting with UCI directly.
Dhcpv4 string
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
Dhcpv6 string
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
Force bool
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
Ignore bool
Specifies whether dnsmasq should ignore this pool.
Interface string
Leasetime string
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
Limit float64
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
Ra string
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
RaFlags []string
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
Start float64
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
dhcpDhcpId String
Name of the section. This name is only used when interacting with UCI directly.
dhcpv4 String
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
dhcpv6 String
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
force Boolean
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
ignore Boolean
Specifies whether dnsmasq should ignore this pool.
interface_ String
leasetime String
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
limit Double
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
ra String
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
raFlags List<String>
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
start Double
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
dhcpDhcpId string
Name of the section. This name is only used when interacting with UCI directly.
dhcpv4 string
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
dhcpv6 string
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
force boolean
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
ignore boolean
Specifies whether dnsmasq should ignore this pool.
interface string
leasetime string
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
limit number
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
ra string
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
raFlags string[]
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
start number
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
dhcp_dhcp_id str
Name of the section. This name is only used when interacting with UCI directly.
dhcpv4 str
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
dhcpv6 str
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
force bool
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
ignore bool
Specifies whether dnsmasq should ignore this pool.
interface str
leasetime str
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
limit float
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
ra str
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
ra_flags Sequence[str]
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
start float
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.
dhcpDhcpId String
Name of the section. This name is only used when interacting with UCI directly.
dhcpv4 String
The mode of the DHCPv4 server. Must be one of: "disabled", "server".
dhcpv6 String
The mode of the DHCPv6 server. Must be one of: "disabled", "relay", "server".
force Boolean
Forces DHCP serving on the specified interface even if another DHCP server is detected on the same network segment.
ignore Boolean
Specifies whether dnsmasq should ignore this pool.
interface String
leasetime String
The lease time of addresses handed out to clients. E.g. 12h, or 30m. Required if ignore is not true.
limit Number
Specifies the size of the address pool. E.g. With start = 100, and limit = 150, the maximum address will be 249. Required if ignore is not true.
ra String
The mode of Router Advertisements. Must be one of: "disabled", "relay", "server".
raFlags List<String>
Router Advertisement flags to include in messages. Must be one of: "home-agent", "managed-config", "none", "other-config".
start Number
Specifies the offset from the network address of the underlying interface to calculate the minimum address that may be leased to clients. It may be greater than 255 to span subnets. Required if ignore is not true.

Import

Find the Terraform id from LuCI’s JSON-RPC API.

One way to find this information is with curl and jq:

curl \

--data '{"id": 0, "method": "foreach", "params": ["dhcp", "dhcp"]}' \

http://192.168.1.1/cgi-bin/luci/rpc/uci?auth=$AUTH_TOKEN \

| jq '.result | map({name: .[".name"]})'

This command will output something like:

[

{

"name": "lan",

},

{

"name": "guest",

}

]

We’d then use the information to import the appropriate resource:

$ pulumi import openwrt:index/dhcpDhcp:DhcpDhcp lan lan
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
openwrt joneshf/terraform-provider-openwrt
License
Notes
This Pulumi package is based on the openwrt Terraform Provider.