netconf

package
v0.0.0-...-b25b90c Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package netconf brings up the first virtio-net interface and obtains an address via DHCPv4. The cmdline `ip=` parameter is also supported (static).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteResolvConf

func WriteResolvConf(ips []net.IP)

WriteResolvConf is the public hook for overriding /etc/resolv.conf after netconf.Setup has already run with DHCP-supplied DNS. cloud- boot-init uses it to honour `cloudboot.dns=` from the kernel cmdline (early) and the plan's `dns = [...]` field (after plan parse). Empty `ips` is a no-op so the DHCP default keeps its place.

Types

type Config

type Config struct {
	Iface   string
	Addr    net.IPNet
	Gateway net.IP
	DNS     []net.IP
}

Config describes the resolved L3 settings for an interface.

func Setup

func Setup(cmdlineIP string) (*Config, error)

Setup configures lo and the first non-loopback link with carrier. If cmdlineIP is non-empty in the form "addr::gw:mask::iface:..." (klibc syntax), it is used; otherwise DHCPv4 is attempted.

Jump to

Keyboard shortcuts

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