network

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBridgeUp

func CheckBridgeUp(name string) (bool, error)

CheckBridgeUp check whether the bridge is up

func IPExists

func IPExists(ip net.IP) (bool, error)

IPExists checks IP is used or not

func LinkAddAddr

func LinkAddAddr(linkName, ip string) error

LinkAddAddr adds an IP address to the link device

func LinkAddGateway

func LinkAddGateway(linkName, gatewayIP string) error

LinkAddGateway adds route for the system set gateway for the link device

func LinkRename

func LinkRename(old, new string) error

LinkRename sets the name of the link device

func LinkSetMaster

func LinkSetMaster(linkName, masterName string) error

LinkSetMaster sets the master of the link device

func LinkSetNSByFile

func LinkSetNSByFile(filename, linkName string) error

LinkSetNSByFile puts link device into a new network namespace

func LinkSetup

func LinkSetup(linkName string) error

LinkSetup finds and enables the link device

func MountNetNS

func MountNetNS(nsTarget string) (filesystem.Unmounter, error)

MountNetNS creates and mounts a new network namespace, then return a function to unmount

func SetupBridge

func SetupBridge(name, ip string) error

SetupBridge sets up the default bridge interface. To keep things simple, assign ip 172.69.0.1 to it (yeah, I fixed it!) which is from the range of IPs which will also use for the containers

func SetupVirtualEthernet

func SetupVirtualEthernet(name, peer string) error

SetupVirtualEthernet creates and configures a virtual ethernet on host

Types

type Unsetter

type Unsetter func() error

func SetNetNSByFile

func SetNetNSByFile(filename string) (Unsetter, error)

Jump to

Keyboard shortcuts

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