bootstrap

package
v0.4.0-rc9-a Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultBridge

func CreateDefaultBridge(name string) (*netlink.Bridge, error)

CreateDefaultBridge creates the default bridge of the node that will received the management interface

func DefaultBridgeValid

func DefaultBridgeValid() error

DefaultBridgeValid validates default bridge exists and of correct type

func SelectZOS

func SelectZOS(cfgs []IfaceConfig) (string, error)

SelectZOS decide which interface should be assigned to the ZOS bridge if multiple interfaces receives an IP from DHCP we prefer a interfaces that has the smallest IP and private IP gateway if none is found, then we pick the interface that has the smallest IP and any IP gateway

Types

type IfaceConfig

type IfaceConfig struct {
	Name    string
	Addrs4  []netlink.Addr
	Addrs6  []netlink.Addr
	Routes4 []netlink.Route
	Routes6 []netlink.Route
}

IfaceConfig contains all the IP address and routes of an interface

func InspectIfaces

func InspectIfaces() ([]IfaceConfig, error)

InspectIfaces is used to gather the IP that each interfaces would be from DHCP and SLAAC it returns the IPs and routes for each interfaces for both IPv4 and IPv6

It will list all the physical interfaces that have a cable plugged in it create a network namespace per interfaces start a DHCP probe on each interfaces and gather the IPs and routes received

Jump to

Keyboard shortcuts

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