1. Packages
  2. Libvirt Provider
  3. API Docs
  4. Network
libvirt 0.8.3 published on Tuesday, Mar 4, 2025 by dmacvicar

libvirt.Network

Explore with Pulumi AI

Manages a VM network resource within libvirt. For more information see the official documentation.

Example Usage

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

const kubeNetwork = new libvirt.Network("kubeNetwork", {
    addresses: [
        "10.17.3.0/24",
        "2001:db8:ca2:2::1/64",
    ],
    dns: {
        enabled: true,
        localOnly: true,
    },
    dnsmasqOptions: {},
    domain: "k8s.local",
    mode: "nat",
});
Copy
import pulumi
import pulumi_libvirt as libvirt

kube_network = libvirt.Network("kubeNetwork",
    addresses=[
        "10.17.3.0/24",
        "2001:db8:ca2:2::1/64",
    ],
    dns={
        "enabled": True,
        "local_only": True,
    },
    dnsmasq_options={},
    domain="k8s.local",
    mode="nat")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := libvirt.NewNetwork(ctx, "kubeNetwork", &libvirt.NetworkArgs{
			Addresses: pulumi.StringArray{
				pulumi.String("10.17.3.0/24"),
				pulumi.String("2001:db8:ca2:2::1/64"),
			},
			Dns: &libvirt.NetworkDnsArgs{
				Enabled:   pulumi.Bool(true),
				LocalOnly: pulumi.Bool(true),
			},
			DnsmasqOptions: &libvirt.NetworkDnsmasqOptionsArgs{},
			Domain:         pulumi.String("k8s.local"),
			Mode:           pulumi.String("nat"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Libvirt = Pulumi.Libvirt;

return await Deployment.RunAsync(() => 
{
    var kubeNetwork = new Libvirt.Network("kubeNetwork", new()
    {
        Addresses = new[]
        {
            "10.17.3.0/24",
            "2001:db8:ca2:2::1/64",
        },
        Dns = new Libvirt.Inputs.NetworkDnsArgs
        {
            Enabled = true,
            LocalOnly = true,
        },
        DnsmasqOptions = null,
        Domain = "k8s.local",
        Mode = "nat",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.libvirt.Network;
import com.pulumi.libvirt.NetworkArgs;
import com.pulumi.libvirt.inputs.NetworkDnsArgs;
import com.pulumi.libvirt.inputs.NetworkDnsmasqOptionsArgs;
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 kubeNetwork = new Network("kubeNetwork", NetworkArgs.builder()
            .addresses(            
                "10.17.3.0/24",
                "2001:db8:ca2:2::1/64")
            .dns(NetworkDnsArgs.builder()
                .enabled(true)
                .localOnly(true)
                .build())
            .dnsmasqOptions()
            .domain("k8s.local")
            .mode("nat")
            .build());

    }
}
Copy
resources:
  kubeNetwork:
    type: libvirt:Network
    properties:
      # list of subnets the addresses allowed for domains connected
      #     // also derived to define the host addresses
      #     // also derived to define the addresses served by the DHCP server
      addresses:
        - 10.17.3.0/24
        - 2001:db8:ca2:2::1/64
      # (Optional) DNS configuration
      dns:
        enabled: true
        localOnly: true
      # (Optional) Dnsmasq options configuration
      dnsmasqOptions: {}
      # the domain used by the DNS server in this network
      domain: k8s.local
      # mode can be: "nat" (default), "none", "route", "open", "bridge"
      mode: nat
Copy

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: Optional[NetworkArgs] = None,
            opts: Optional[ResourceOptions] = None)

@overload
def Network(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            addresses: Optional[Sequence[str]] = None,
            autostart: Optional[bool] = None,
            bridge: Optional[str] = None,
            dhcp: Optional[NetworkDhcpArgs] = None,
            dns: Optional[NetworkDnsArgs] = None,
            dnsmasq_options: Optional[NetworkDnsmasqOptionsArgs] = None,
            domain: Optional[str] = None,
            mode: Optional[str] = None,
            mtu: Optional[float] = None,
            name: Optional[str] = None,
            network_id: Optional[str] = None,
            routes: Optional[Sequence[NetworkRouteArgs]] = None,
            xml: Optional[NetworkXmlArgs] = None)
func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: libvirt:Network
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 NetworkArgs
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 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. 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 Libvirt.Network("networkResource", new()
{
    Addresses = new[]
    {
        "string",
    },
    Autostart = false,
    Bridge = "string",
    Dhcp = new Libvirt.Inputs.NetworkDhcpArgs
    {
        Enabled = false,
    },
    Dns = new Libvirt.Inputs.NetworkDnsArgs
    {
        Enabled = false,
        Forwarders = new[]
        {
            new Libvirt.Inputs.NetworkDnsForwarderArgs
            {
                Address = "string",
                Domain = "string",
            },
        },
        Hosts = new[]
        {
            new Libvirt.Inputs.NetworkDnsHostArgs
            {
                Hostname = "string",
                Ip = "string",
            },
        },
        LocalOnly = false,
        Srvs = new[]
        {
            new Libvirt.Inputs.NetworkDnsSrvArgs
            {
                Domain = "string",
                Port = "string",
                Priority = "string",
                Protocol = "string",
                Service = "string",
                Target = "string",
                Weight = "string",
            },
        },
    },
    DnsmasqOptions = new Libvirt.Inputs.NetworkDnsmasqOptionsArgs
    {
        Options = new[]
        {
            new Libvirt.Inputs.NetworkDnsmasqOptionsOptionArgs
            {
                OptionName = "string",
                OptionValue = "string",
            },
        },
    },
    Domain = "string",
    Mode = "string",
    Mtu = 0,
    Name = "string",
    NetworkId = "string",
    Routes = new[]
    {
        new Libvirt.Inputs.NetworkRouteArgs
        {
            Cidr = "string",
            Gateway = "string",
        },
    },
    Xml = new Libvirt.Inputs.NetworkXmlArgs
    {
        Xslt = "string",
    },
});
Copy
example, err := libvirt.NewNetwork(ctx, "networkResource", &libvirt.NetworkArgs{
Addresses: pulumi.StringArray{
pulumi.String("string"),
},
Autostart: pulumi.Bool(false),
Bridge: pulumi.String("string"),
Dhcp: &.NetworkDhcpArgs{
Enabled: pulumi.Bool(false),
},
Dns: &.NetworkDnsArgs{
Enabled: pulumi.Bool(false),
Forwarders: .NetworkDnsForwarderArray{
&.NetworkDnsForwarderArgs{
Address: pulumi.String("string"),
Domain: pulumi.String("string"),
},
},
Hosts: .NetworkDnsHostArray{
&.NetworkDnsHostArgs{
Hostname: pulumi.String("string"),
Ip: pulumi.String("string"),
},
},
LocalOnly: pulumi.Bool(false),
Srvs: .NetworkDnsSrvArray{
&.NetworkDnsSrvArgs{
Domain: pulumi.String("string"),
Port: pulumi.String("string"),
Priority: pulumi.String("string"),
Protocol: pulumi.String("string"),
Service: pulumi.String("string"),
Target: pulumi.String("string"),
Weight: pulumi.String("string"),
},
},
},
DnsmasqOptions: &.NetworkDnsmasqOptionsArgs{
Options: .NetworkDnsmasqOptionsOptionArray{
&.NetworkDnsmasqOptionsOptionArgs{
OptionName: pulumi.String("string"),
OptionValue: pulumi.String("string"),
},
},
},
Domain: pulumi.String("string"),
Mode: pulumi.String("string"),
Mtu: pulumi.Float64(0),
Name: pulumi.String("string"),
NetworkId: pulumi.String("string"),
Routes: .NetworkRouteArray{
&.NetworkRouteArgs{
Cidr: pulumi.String("string"),
Gateway: pulumi.String("string"),
},
},
Xml: &.NetworkXmlArgs{
Xslt: pulumi.String("string"),
},
})
Copy
var networkResource = new Network("networkResource", NetworkArgs.builder()
    .addresses("string")
    .autostart(false)
    .bridge("string")
    .dhcp(NetworkDhcpArgs.builder()
        .enabled(false)
        .build())
    .dns(NetworkDnsArgs.builder()
        .enabled(false)
        .forwarders(NetworkDnsForwarderArgs.builder()
            .address("string")
            .domain("string")
            .build())
        .hosts(NetworkDnsHostArgs.builder()
            .hostname("string")
            .ip("string")
            .build())
        .localOnly(false)
        .srvs(NetworkDnsSrvArgs.builder()
            .domain("string")
            .port("string")
            .priority("string")
            .protocol("string")
            .service("string")
            .target("string")
            .weight("string")
            .build())
        .build())
    .dnsmasqOptions(NetworkDnsmasqOptionsArgs.builder()
        .options(NetworkDnsmasqOptionsOptionArgs.builder()
            .optionName("string")
            .optionValue("string")
            .build())
        .build())
    .domain("string")
    .mode("string")
    .mtu(0)
    .name("string")
    .networkId("string")
    .routes(NetworkRouteArgs.builder()
        .cidr("string")
        .gateway("string")
        .build())
    .xml(NetworkXmlArgs.builder()
        .xslt("string")
        .build())
    .build());
Copy
network_resource = libvirt.Network("networkResource",
    addresses=["string"],
    autostart=False,
    bridge="string",
    dhcp={
        "enabled": False,
    },
    dns={
        "enabled": False,
        "forwarders": [{
            "address": "string",
            "domain": "string",
        }],
        "hosts": [{
            "hostname": "string",
            "ip": "string",
        }],
        "local_only": False,
        "srvs": [{
            "domain": "string",
            "port": "string",
            "priority": "string",
            "protocol": "string",
            "service": "string",
            "target": "string",
            "weight": "string",
        }],
    },
    dnsmasq_options={
        "options": [{
            "option_name": "string",
            "option_value": "string",
        }],
    },
    domain="string",
    mode="string",
    mtu=0,
    name="string",
    network_id="string",
    routes=[{
        "cidr": "string",
        "gateway": "string",
    }],
    xml={
        "xslt": "string",
    })
Copy
const networkResource = new libvirt.Network("networkResource", {
    addresses: ["string"],
    autostart: false,
    bridge: "string",
    dhcp: {
        enabled: false,
    },
    dns: {
        enabled: false,
        forwarders: [{
            address: "string",
            domain: "string",
        }],
        hosts: [{
            hostname: "string",
            ip: "string",
        }],
        localOnly: false,
        srvs: [{
            domain: "string",
            port: "string",
            priority: "string",
            protocol: "string",
            service: "string",
            target: "string",
            weight: "string",
        }],
    },
    dnsmasqOptions: {
        options: [{
            optionName: "string",
            optionValue: "string",
        }],
    },
    domain: "string",
    mode: "string",
    mtu: 0,
    name: "string",
    networkId: "string",
    routes: [{
        cidr: "string",
        gateway: "string",
    }],
    xml: {
        xslt: "string",
    },
});
Copy
type: libvirt:Network
properties:
    addresses:
        - string
    autostart: false
    bridge: string
    dhcp:
        enabled: false
    dns:
        enabled: false
        forwarders:
            - address: string
              domain: string
        hosts:
            - hostname: string
              ip: string
        localOnly: false
        srvs:
            - domain: string
              port: string
              priority: string
              protocol: string
              service: string
              target: string
              weight: string
    dnsmasqOptions:
        options:
            - optionName: string
              optionValue: string
    domain: string
    mode: string
    mtu: 0
    name: string
    networkId: string
    routes:
        - cidr: string
          gateway: string
    xml:
        xslt: string
Copy

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:

Addresses List<string>
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
Autostart bool
Set to true to start the network on host boot up. If not specified false is assumed.
Bridge string
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
Dhcp NetworkDhcp
Dns NetworkDns
configuration of DNS specific settings for the network
DnsmasqOptions NetworkDnsmasqOptions
Domain string
The domain used by the DNS server.
Mode string
One of:
Mtu double
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
Name string
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
NetworkId string
a unique identifier for the resource
Routes List<NetworkRoute>
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
Xml NetworkXml
Addresses []string
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
Autostart bool
Set to true to start the network on host boot up. If not specified false is assumed.
Bridge string
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
Dhcp NetworkDhcpArgs
Dns NetworkDnsArgs
configuration of DNS specific settings for the network
DnsmasqOptions NetworkDnsmasqOptionsArgs
Domain string
The domain used by the DNS server.
Mode string
One of:
Mtu float64
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
Name string
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
NetworkId string
a unique identifier for the resource
Routes []NetworkRouteArgs
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
Xml NetworkXmlArgs
addresses List<String>
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
autostart Boolean
Set to true to start the network on host boot up. If not specified false is assumed.
bridge String
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
dhcp NetworkDhcp
dns NetworkDns
configuration of DNS specific settings for the network
dnsmasqOptions NetworkDnsmasqOptions
domain String
The domain used by the DNS server.
mode String
One of:
mtu Double
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
name String
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
networkId String
a unique identifier for the resource
routes List<NetworkRoute>
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
xml NetworkXml
addresses string[]
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
autostart boolean
Set to true to start the network on host boot up. If not specified false is assumed.
bridge string
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
dhcp NetworkDhcp
dns NetworkDns
configuration of DNS specific settings for the network
dnsmasqOptions NetworkDnsmasqOptions
domain string
The domain used by the DNS server.
mode string
One of:
mtu number
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
name string
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
networkId string
a unique identifier for the resource
routes NetworkRoute[]
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
xml NetworkXml
addresses Sequence[str]
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
autostart bool
Set to true to start the network on host boot up. If not specified false is assumed.
bridge str
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
dhcp NetworkDhcpArgs
dns NetworkDnsArgs
configuration of DNS specific settings for the network
dnsmasq_options NetworkDnsmasqOptionsArgs
domain str
The domain used by the DNS server.
mode str
One of:
mtu float
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
name str
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
network_id str
a unique identifier for the resource
routes Sequence[NetworkRouteArgs]
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
xml NetworkXmlArgs
addresses List<String>
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
autostart Boolean
Set to true to start the network on host boot up. If not specified false is assumed.
bridge String
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
dhcp Property Map
dns Property Map
configuration of DNS specific settings for the network
dnsmasqOptions Property Map
domain String
The domain used by the DNS server.
mode String
One of:
mtu Number
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
name String
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
networkId String
a unique identifier for the resource
routes List<Property Map>
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
xml Property Map

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.
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 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,
        addresses: Optional[Sequence[str]] = None,
        autostart: Optional[bool] = None,
        bridge: Optional[str] = None,
        dhcp: Optional[NetworkDhcpArgs] = None,
        dns: Optional[NetworkDnsArgs] = None,
        dnsmasq_options: Optional[NetworkDnsmasqOptionsArgs] = None,
        domain: Optional[str] = None,
        mode: Optional[str] = None,
        mtu: Optional[float] = None,
        name: Optional[str] = None,
        network_id: Optional[str] = None,
        routes: Optional[Sequence[NetworkRouteArgs]] = None,
        xml: Optional[NetworkXmlArgs] = None) -> Network
func 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: libvirt:Network    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:
Addresses List<string>
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
Autostart bool
Set to true to start the network on host boot up. If not specified false is assumed.
Bridge string
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
Dhcp NetworkDhcp
Dns NetworkDns
configuration of DNS specific settings for the network
DnsmasqOptions NetworkDnsmasqOptions
Domain string
The domain used by the DNS server.
Mode string
One of:
Mtu double
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
Name string
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
NetworkId string
a unique identifier for the resource
Routes List<NetworkRoute>
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
Xml NetworkXml
Addresses []string
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
Autostart bool
Set to true to start the network on host boot up. If not specified false is assumed.
Bridge string
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
Dhcp NetworkDhcpArgs
Dns NetworkDnsArgs
configuration of DNS specific settings for the network
DnsmasqOptions NetworkDnsmasqOptionsArgs
Domain string
The domain used by the DNS server.
Mode string
One of:
Mtu float64
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
Name string
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
NetworkId string
a unique identifier for the resource
Routes []NetworkRouteArgs
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
Xml NetworkXmlArgs
addresses List<String>
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
autostart Boolean
Set to true to start the network on host boot up. If not specified false is assumed.
bridge String
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
dhcp NetworkDhcp
dns NetworkDns
configuration of DNS specific settings for the network
dnsmasqOptions NetworkDnsmasqOptions
domain String
The domain used by the DNS server.
mode String
One of:
mtu Double
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
name String
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
networkId String
a unique identifier for the resource
routes List<NetworkRoute>
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
xml NetworkXml
addresses string[]
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
autostart boolean
Set to true to start the network on host boot up. If not specified false is assumed.
bridge string
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
dhcp NetworkDhcp
dns NetworkDns
configuration of DNS specific settings for the network
dnsmasqOptions NetworkDnsmasqOptions
domain string
The domain used by the DNS server.
mode string
One of:
mtu number
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
name string
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
networkId string
a unique identifier for the resource
routes NetworkRoute[]
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
xml NetworkXml
addresses Sequence[str]
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
autostart bool
Set to true to start the network on host boot up. If not specified false is assumed.
bridge str
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
dhcp NetworkDhcpArgs
dns NetworkDnsArgs
configuration of DNS specific settings for the network
dnsmasq_options NetworkDnsmasqOptionsArgs
domain str
The domain used by the DNS server.
mode str
One of:
mtu float
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
name str
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
network_id str
a unique identifier for the resource
routes Sequence[NetworkRouteArgs]
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
xml NetworkXmlArgs
addresses List<String>
A list of (0 or 1) IPv4 and (0 or 1) IPv6 subnets in CIDR notation. This defines the subnets associated to that network. This argument is also used to define the address on the real host. If dhcp { enabled = true } addresses is also used to define the address range served by the DHCP server. No DHCP server will be started if addresses is omitted.
autostart Boolean
Set to true to start the network on host boot up. If not specified false is assumed.
bridge String
The bridge device defines the name of a bridge device which will be used to construct the virtual network (when not provided, it will be automatically obtained by libvirt in none, nat, route and open modes).
dhcp Property Map
dns Property Map
configuration of DNS specific settings for the network
dnsmasqOptions Property Map
domain String
The domain used by the DNS server.
mode String
One of:
mtu Number
The MTU to set for the underlying network interfaces. When not supplied, libvirt will use the default for the interface, usually 1500. Libvirt version 5.1 and greater will advertise this value to nodes via DHCP.
name String
A unique name for the resource, required by libvirt. Changing this forces a new resource to be created.
networkId String
a unique identifier for the resource
routes List<Property Map>
a list of static routes. A cidr and a gateway must be provided. The gateway must be reachable via the bridge interface.
xml Property Map

Supporting Types

NetworkDhcp
, NetworkDhcpArgs

Enabled bool
when false, disable the DHCP server
Enabled bool
when false, disable the DHCP server
enabled Boolean
when false, disable the DHCP server
enabled boolean
when false, disable the DHCP server
enabled bool
when false, disable the DHCP server
enabled Boolean
when false, disable the DHCP server

NetworkDns
, NetworkDnsArgs

Enabled bool
when false, disable the DHCP server
Forwarders List<NetworkDnsForwarder>
Either address, domain, or both must be set
Hosts List<NetworkDnsHost>

a DNS host entry block. You can have one or more of these blocks in your DNS definition. You must specify both ip and hostname.

An advanced example of round-robin DNS (using DNS host templates) follows:

LocalOnly bool
true/false: true means 'do not forward unresolved requests for this domain to the part DNS server
Srvs List<NetworkDnsSrv>
a DNS SRV entry block. You can have one or more of these blocks in your DNS definition. You must specify service and protocol.
Enabled bool
when false, disable the DHCP server
Forwarders []NetworkDnsForwarder
Either address, domain, or both must be set
Hosts []NetworkDnsHost

a DNS host entry block. You can have one or more of these blocks in your DNS definition. You must specify both ip and hostname.

An advanced example of round-robin DNS (using DNS host templates) follows:

LocalOnly bool
true/false: true means 'do not forward unresolved requests for this domain to the part DNS server
Srvs []NetworkDnsSrv
a DNS SRV entry block. You can have one or more of these blocks in your DNS definition. You must specify service and protocol.
enabled Boolean
when false, disable the DHCP server
forwarders List<NetworkDnsForwarder>
Either address, domain, or both must be set
hosts List<NetworkDnsHost>

a DNS host entry block. You can have one or more of these blocks in your DNS definition. You must specify both ip and hostname.

An advanced example of round-robin DNS (using DNS host templates) follows:

localOnly Boolean
true/false: true means 'do not forward unresolved requests for this domain to the part DNS server
srvs List<NetworkDnsSrv>
a DNS SRV entry block. You can have one or more of these blocks in your DNS definition. You must specify service and protocol.
enabled boolean
when false, disable the DHCP server
forwarders NetworkDnsForwarder[]
Either address, domain, or both must be set
hosts NetworkDnsHost[]

a DNS host entry block. You can have one or more of these blocks in your DNS definition. You must specify both ip and hostname.

An advanced example of round-robin DNS (using DNS host templates) follows:

localOnly boolean
true/false: true means 'do not forward unresolved requests for this domain to the part DNS server
srvs NetworkDnsSrv[]
a DNS SRV entry block. You can have one or more of these blocks in your DNS definition. You must specify service and protocol.
enabled bool
when false, disable the DHCP server
forwarders Sequence[NetworkDnsForwarder]
Either address, domain, or both must be set
hosts Sequence[NetworkDnsHost]

a DNS host entry block. You can have one or more of these blocks in your DNS definition. You must specify both ip and hostname.

An advanced example of round-robin DNS (using DNS host templates) follows:

local_only bool
true/false: true means 'do not forward unresolved requests for this domain to the part DNS server
srvs Sequence[NetworkDnsSrv]
a DNS SRV entry block. You can have one or more of these blocks in your DNS definition. You must specify service and protocol.
enabled Boolean
when false, disable the DHCP server
forwarders List<Property Map>
Either address, domain, or both must be set
hosts List<Property Map>

a DNS host entry block. You can have one or more of these blocks in your DNS definition. You must specify both ip and hostname.

An advanced example of round-robin DNS (using DNS host templates) follows:

localOnly Boolean
true/false: true means 'do not forward unresolved requests for this domain to the part DNS server
srvs List<Property Map>
a DNS SRV entry block. You can have one or more of these blocks in your DNS definition. You must specify service and protocol.

NetworkDnsForwarder
, NetworkDnsForwarderArgs

Address string
Domain string
The domain used by the DNS server.
Address string
Domain string
The domain used by the DNS server.
address String
domain String
The domain used by the DNS server.
address string
domain string
The domain used by the DNS server.
address str
domain str
The domain used by the DNS server.
address String
domain String
The domain used by the DNS server.

NetworkDnsHost
, NetworkDnsHostArgs

Hostname string
Ip string
Hostname string
Ip string
hostname String
ip String
hostname string
ip string
hostname str
ip str
hostname String
ip String

NetworkDnsSrv
, NetworkDnsSrvArgs

Domain string
The domain used by the DNS server.
Port string
Priority string
Protocol string
Service string
Target string
Weight string
Domain string
The domain used by the DNS server.
Port string
Priority string
Protocol string
Service string
Target string
Weight string
domain String
The domain used by the DNS server.
port String
priority String
protocol String
service String
target String
weight String
domain string
The domain used by the DNS server.
port string
priority string
protocol string
service string
target string
weight string
domain str
The domain used by the DNS server.
port str
priority str
protocol str
service str
target str
weight str
domain String
The domain used by the DNS server.
port String
priority String
protocol String
service String
target String
weight String

NetworkDnsmasqOptions
, NetworkDnsmasqOptionsArgs

Options List<NetworkDnsmasqOptionsOption>

a Dnsmasq option entry block. You can have one or more of these blocks in your definition. You must specify option_name while option_value is optional to support value-less options.

An example of setting Dnsmasq options (using Dnsmasq option templates) follows:

Options []NetworkDnsmasqOptionsOption

a Dnsmasq option entry block. You can have one or more of these blocks in your definition. You must specify option_name while option_value is optional to support value-less options.

An example of setting Dnsmasq options (using Dnsmasq option templates) follows:

options List<NetworkDnsmasqOptionsOption>

a Dnsmasq option entry block. You can have one or more of these blocks in your definition. You must specify option_name while option_value is optional to support value-less options.

An example of setting Dnsmasq options (using Dnsmasq option templates) follows:

options NetworkDnsmasqOptionsOption[]

a Dnsmasq option entry block. You can have one or more of these blocks in your definition. You must specify option_name while option_value is optional to support value-less options.

An example of setting Dnsmasq options (using Dnsmasq option templates) follows:

options Sequence[NetworkDnsmasqOptionsOption]

a Dnsmasq option entry block. You can have one or more of these blocks in your definition. You must specify option_name while option_value is optional to support value-less options.

An example of setting Dnsmasq options (using Dnsmasq option templates) follows:

options List<Property Map>

a Dnsmasq option entry block. You can have one or more of these blocks in your definition. You must specify option_name while option_value is optional to support value-less options.

An example of setting Dnsmasq options (using Dnsmasq option templates) follows:

NetworkDnsmasqOptionsOption
, NetworkDnsmasqOptionsOptionArgs

OptionName string
OptionValue string
OptionName string
OptionValue string
optionName String
optionValue String
optionName string
optionValue string
optionName String
optionValue String

NetworkRoute
, NetworkRouteArgs

Cidr This property is required. string
Gateway This property is required. string
Cidr This property is required. string
Gateway This property is required. string
cidr This property is required. String
gateway This property is required. String
cidr This property is required. string
gateway This property is required. string
cidr This property is required. str
gateway This property is required. str
cidr This property is required. String
gateway This property is required. String

NetworkXml
, NetworkXmlArgs

Xslt string
Xslt string
xslt String
xslt string
xslt str
xslt String

Package Details

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