networkd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package networkd handles the network interface configuration on a host. If no configuration is provided, automatic configuration via dhcp will be performed on interfaces ( eth, en, bond ).

Index

Constants

View Source
const (
	DefaultPrimaryResolver   = "1.1.1.1"
	DefaultSecondaryResolver = "8.8.8.8"
)

Set up default nameservers

Variables

This section is empty.

Functions

This section is empty.

Types

type Networkd

type Networkd struct {
	Interfaces map[string]*nic.NetworkInterface
	Config     runtime.Configurator

	sync.Mutex
	// contains filtered or unexported fields
}

Networkd provides the high level interaction to configure network interfaces on a host system. This currently supports addressing configuration via dhcp and/or a specified configuration file.

func New

func New(config runtime.Configurator) (*Networkd, error)

New takes the supplied configuration and creates an abstract representation of all interfaces (as nic.NetworkInterface). nolint: gocyclo

func (*Networkd) Configure

func (n *Networkd) Configure() (err error)

Configure handles the lifecycle for an interface. This includes creation, configuration, and any addressing that is needed. We care about ordering here so that we can ensure any links that make up a bond will be in the correct state when we get to bonding configuration.

nolint: gocyclo

func (*Networkd) Hostname

func (n *Networkd) Hostname() (err error)

Hostname returns the first hostname found from the addressing methods. Create /etc/hosts and set hostname. Priority is: 1. Config (explicitly defined by the user) 2. Kernel arg 3. Platform 4. DHCP 5. Default with the format: talos-<ip addr>

func (*Networkd) Ready added in v0.4.0

func (n *Networkd) Ready() bool

Ready exposes the readiness state of networkd.

func (*Networkd) Renew

func (n *Networkd) Renew()

Renew sets up a long running loop to refresh a network interfaces addressing configuration. Currently this only applies to interfaces configured by DHCP.

func (*Networkd) Reset added in v0.3.0

func (n *Networkd) Reset()

Reset handles removing addresses from previously configured interfaces.

func (*Networkd) SetReady added in v0.4.0

func (n *Networkd) SetReady()

SetReady sets the readiness state of networkd.

Jump to

Keyboard shortcuts

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