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 ¶
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 // 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 ¶
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 ¶
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>