netwrangler

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

README

Netwrangler

Netwrangler is a one-shot network interface configuration utility that is mostly compatible with https://netplan.io configuration files. Key differences are:

  • It only supports systemd-networkd and old-style Redhat network configurations as output formats. Debian style is a planned on, and NetworkManager style is a lower priority.
  • No support for configuring wireless interfaces. This tool is mainly intended for servers and other devices that do not have wireless interfaces.
  • No daemons, dynamic configuration, or other long-lived operations. This tool is intended to be run as part of device provisioning, where we expect to set the desired network interface config once and then forget about it until it is time to reprovision the box.
  • No support for hierarchical config files. We use the netplan.io YAML for its schema, not to allow additional layered customization.
  • No support for NIC renaming or MAC address reassignment. Support may be added at a later date.
  • No support for per-interface backend renderers. This just doesn't seem like a good idea if you don;t care about dynamic interface reconfiguration.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The input formats we accept.  internal is the intermediate format netwrangler uses.
	SrcFormats = []string{"netplan", "internal"}
	// The output formats we can handle.  internal is the intermediate format netwrangler uses.
	DestFormats = []string{"systemd", "rhel", "internal"}
)

Functions

func Compile

func Compile(phys []util.Phy, srcFmt, destFmt, srcLoc, destLoc string, bindMacs bool) error

Compile transforms network configuration settings from srcLoc in srcFmt into destFmt at destLoc, using phys as the base physical interfaces to build on. if bindMacs is true, the generated format will bind to interface MAC addresses (or other unique physical addresses), otherwise the interface names at srcLoc must match what is present on the system at the time netwrangler is run.

func GatherPhys

func GatherPhys() ([]util.Phy, error)

GatherPhys gathers the physical nics that the system knows about. It is currently only supported on Linux systems.

func GatherPhysFromFile

func GatherPhysFromFile(src string) (phys []util.Phy, err error)

GatherPhysFromFile gathers the physical nic information from a saved file. This can be used for unit testing or buld offline operations.

Types

This section is empty.

Directories

Path Synopsis
Package netplan implements support for reading Netplan.io compatible yaml formatted config files.
Package netplan implements support for reading Netplan.io compatible yaml formatted config files.
Package rhel implements support for writing out Redhat network config files in /etc/sysconfig/network-scripts/ifcfg-*
Package rhel implements support for writing out Redhat network config files in /etc/sysconfig/network-scripts/ifcfg-*
Package systemd implements support for writing out a systemd-networkd compatible set of network config files.
Package systemd implements support for writing out a systemd-networkd compatible set of network config files.
Package util defines common models and utility functions.
Package util defines common models and utility functions.

Jump to

Keyboard shortcuts

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