ndmz

package
v0.4.5-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//BridgeNDMZ is the name of the ipv4 routing bridge in the ndmz namespace
	BridgeNDMZ = "br-ndmz"
	//NetNSNDMZ name of the dmz namespace
	NetNSNDMZ = "ndmz"

	// DMZPub4 ipv4 public interface
	DMZPub4 = "npub4"
	// DMZPub6 ipv6 public interface
	DMZPub6 = "npub6"
)

Variables

This section is empty.

Functions

func FindIPv6Master added in v0.4.0

func FindIPv6Master() (master string, err error)

FindIPv6Master finds which interface to use as master for NDMZ npub6 interface

Types

type DHCPMon added in v0.4.9

type DHCPMon struct {
	// contains filtered or unexported fields
}

DHCPMon monitor a network interface status and force renew of DHCP lease if needed

func NewDHCPMon added in v0.4.9

func NewDHCPMon(iface, namespace string, z *zinit.Client) *DHCPMon

NewDHCPMon create a new DHCPMon object managing interface iface namespace is then network namespace name to use. it can be empty.

func (*DHCPMon) Start added in v0.4.9

func (d *DHCPMon) Start(ctx context.Context) error

Start creates a zinit service for a DHCP client and start monitoring it this method is blocking, start is in a goroutine if needed. cancel the context to start it.

type DMZ added in v0.4.0

type DMZ interface {
	// create the ndmz network namespace and all requires network interfaces
	Create(ctx context.Context) error
	// delete the ndmz network namespace and clean up all network interfaces
	Delete() error
	// link a network resource from a user network to ndmz
	AttachNR(networkID string, nr *nr.NetResource, ipamLeaseDir string) error
	// Return the interface used by ndmz to router public ipv6 traffic
	IP6PublicIface() string
	//configure an address on the public IPv6 interface
	SetIP6PublicIface(net.IPNet) error
}

DMZ is an interface used to create an DMZ network namespace

type DualStack added in v0.4.0

type DualStack struct {
	// contains filtered or unexported fields
}

DualStack implement DMZ interface using dual stack ipv4/ipv6

func NewDualStack added in v0.4.0

func NewDualStack(nodeID string) *DualStack

NewDualStack creates a new DMZ DualStack

func (*DualStack) AttachNR added in v0.4.0

func (d *DualStack) AttachNR(networkID string, nr *nr.NetResource, ipamLeaseDir string) error

AttachNR links a network resource to the NDMZ

func (*DualStack) Create added in v0.4.0

func (d *DualStack) Create(ctx context.Context) error

Create create the NDMZ network namespace and configure its default routes and addresses

func (*DualStack) Delete added in v0.4.0

func (d *DualStack) Delete() error

Delete deletes the NDMZ network namespace

func (*DualStack) IP6PublicIface added in v0.4.0

func (d *DualStack) IP6PublicIface() string

IP6PublicIface implements DMZ interface

func (*DualStack) SetIP6PublicIface added in v0.4.0

func (d *DualStack) SetIP6PublicIface(subnet net.IPNet) error

SetIP6PublicIface implements DMZ interface

type Hidden added in v0.4.0

type Hidden struct {
	// contains filtered or unexported fields
}

Hidden implement DMZ interface using ipv4 only

func NewHidden added in v0.4.0

func NewHidden(nodeID string) *Hidden

NewHidden creates a new DMZ Hidden

func (*Hidden) AttachNR added in v0.4.0

func (d *Hidden) AttachNR(networkID string, nr *nr.NetResource, ipamLeaseDir string) error

AttachNR links a network resource to the NDMZ

func (*Hidden) Create added in v0.4.0

func (d *Hidden) Create(ctx context.Context) error

Create create the NDMZ network namespace and configure its default routes and addresses

func (*Hidden) Delete added in v0.4.0

func (d *Hidden) Delete() error

Delete deletes the NDMZ network namespace

func (*Hidden) IP6PublicIface added in v0.4.0

func (d *Hidden) IP6PublicIface() string

IP6PublicIface implements DMZ interface

func (*Hidden) SetIP6PublicIface added in v0.4.0

func (d *Hidden) SetIP6PublicIface(subnet net.IPNet) error

SetIP6PublicIface implements DMZ interface

Jump to

Keyboard shortcuts

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