network

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Subnet = "10.200.0.0/16"

Subnet is the internal IP range used for Firecracker microVMs.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap() error

Bootstrap dynamically configures the host's networking stack to allow the MicroVMs to reach the internet via NAT and IP Forwarding.

func CreatePointToPointTap

func CreatePointToPointTap(name, hostIP, guestIP string) error

CreatePointToPointTap creates a new TAP interface and establishes a Point-to-Point peer route. Uses netlink syscalls directly to avoid fork/exec overhead and kernel RTNL lock contention from concurrent `ip` command invocations.

func CreateTap

func CreateTap(name, ipAddr string) error

CreateTap creates a new TAP interface and assigns it an IP.

func DeleteTap

func DeleteTap(name string) error

DeleteTap removes a TAP interface.

func Teardown

func Teardown() error

Teardown safely reverses the NAT setup.

Types

type IPAM

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

IPAM manages the allocation of /32 point-to-point IP addresses for Firecracker MicroVMs out of a given CIDR block.

func NewIPAM

func NewIPAM(cidr string) (*IPAM, error)

NewIPAM creates a new IP address manager from a CIDR string.

func (*IPAM) Acquire

func (i *IPAM) Acquire() (string, error)

Acquire gets an unused /32 guest IP from the configured subnet block.

func (*IPAM) Release

func (i *IPAM) Release(ip string)

Release returns the IP to the pool.

Jump to

Keyboard shortcuts

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