networkbridge

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNetworker

func NewNetworker() network.Networker

Types

type T

type T struct {
	network.T
}

func New

func New() *T

func (*T) AllocatableRange

func (t *T) AllocatableRange(_ string) (*net.IPNet, error)

AllocatableRange returns the whole subnet of the network.

A bridge network is node local and its addresses are not routable: the bridge is per node, nothing carries the subnet between nodes, and the same address on two nodes never meets. So every node draws from all of it, and the slicing a routed_bridge needs would only make the range smaller for no gain.

func (*T) BackendDevName

func (t *T) BackendDevName() string

func (*T) CNIConfigData

func (t *T) CNIConfigData() (interface{}, error)

CNIConfigData returns a cni network configuration, like

{
  "bridge": "cni0",
  "cniVersion": "0.3.0",
  "ipMasq": false,
  "name": "mynet",
  "ipam": {
    "routes": [
      {"dst": "0.0.0.0/0"}
    ],
    "subnet": "10.22.0.0/16",
    "type": "host-local"
  },
  "isGateway": true,
  "type": "bridge"
}

func (*T) IsIP6

func (t *T) IsIP6() bool

func (*T) IsNodeLocal

func (t *T) IsNodeLocal() bool

IsNodeLocal says the addresses of a bridge network are node local: every node holds the whole subnet on a bridge of its own, and nothing routes it between them. The traffic leaving it for another network is masqueraded, for the answers to come back.

func (*T) Setup

func (t *T) Setup() error

func (*T) Teardown

func (t *T) Teardown() error

Teardown deletes the bridge of the network, when om named it: a bridge the dev keyword names may be one of the node the network only uses.

Jump to

Keyboard shortcuts

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