netplan

package
v0.1.0-latest-stable Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply() error

Types

type Bridge

type Bridge struct {
	Ethernet   `yaml:",inline"`
	Interfaces []string `yaml:"interfaces,omitempty"`
}

type Config

type Config struct {
	Network Network `yaml:"network"`
}

Config represents the netplan configuration structure

func (Config) WriteToFile

func (n Config) WriteToFile(filePath string) error

type DHCPOverrides

type DHCPOverrides struct {
	UseMTU *bool `yaml:"use-mtu,omitempty"`
}

type Ethernet

type Ethernet struct {
	DHCP4 *bool `yaml:"dhcp4,omitempty"`
	DHCP6 *bool `yaml:"dhcp6,omitempty"`
	// AcceptRA controls whether to accept IPv6 Router Advertisements (SLAAC).
	// When false, the interface will not autoconfigure IPv6 addresses or routes from RAs.
	AcceptRA       *bool          `yaml:"accept-ra,omitempty"`
	MTU            *int32         `yaml:"mtu,omitempty"`
	Addresses      []string       `yaml:"addresses,omitempty"`
	DHCP4Overrides *DHCPOverrides `yaml:"dhcp4-overrides,omitempty"`
	DHCP6Overrides *DHCPOverrides `yaml:"dhcp6-overrides,omitempty"`
	// LinkLocal configures the link-local addresses to bring up.
	// A pointer is used to distinguish between nil (not specified) and empty slice
	// Quote from netplan documentation:
	// * If this field is not defined, the default is to enable only IPv6 link-local addresses
	// * If the field is defined but configured as an empty set, IPv6 link-local addresses are disabled as well as IPv4 link- local addresses
	LinkLocal *[]string `yaml:"link-local,omitempty"`
	Optional  *bool     `yaml:"optional,omitempty"`
}

type Network

type Network struct {
	Version   int                 `yaml:"version"`
	Renderer  string              `yaml:"renderer,omitempty"`
	Ethernets map[string]Ethernet `yaml:"ethernets,omitempty"`
	Bridges   map[string]Bridge   `yaml:"bridges,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL