Documentation ¶
Index ¶
- func CreateBridge(bridgeName string) (*netlink.Bridge, error)
- func CreateMacvtapInterfaceDocker(master string) (net.IP, net.IP, net.IPMask, string, string, error)
- func CreateTapInterface(tapName string, ip *net.IP, mask *net.IPMask) error
- func CreateTapInterfaceDocker(tapName string, master string) (net.IP, net.IP, net.IPMask, string, error)
- func MaskCIDR(mask net.IPMask) int
- func RemoveTapDevice(tapName string) error
- func SetupTunDev() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBridge ¶
CreateBridge creates and returns a netklink.Bridge
func CreateMacvtapInterfaceDocker ¶
func CreateMacvtapInterfaceDocker(master string) ( net.IP, net.IP, net.IPMask, string, string, error)
CreateMacvtapInterfaceDocker creates a Macvtap interface associated with master (usually "eth0"). Returns the assigned IP/mask and gateway IP (previously owned by master) and the MAC of the Macvtap interface that has to be used by the unikernel's NIC.
Got the idea of using macvtap's and the fix for the inability to get the right index in a network namespace from the Kata containers repository: https://github.com/kata-containers/runtime/blob/593bd44f207aa7b21e561184ca1b3fb79da47eb6/virtcontainers/network.go
func CreateTapInterface ¶
CreateTapInterface creates a new TAP interface and assignes it ip/mask as the new address. nil pointers to ip/mask indicates not to set ip/mask
func CreateTapInterfaceDocker ¶
func CreateTapInterfaceDocker(tapName string, master string) ( net.IP, net.IP, net.IPMask, string, error)
CreateTapInterfaceDocker creates a new TAP interface and a bridge, adds both the TAP and the master link (usually eth0) to the bridge, and unsets the IP of the master link to be used by the unikernel NIC. Returns the assigned IP/mask and gateway IP.
func RemoveTapDevice ¶
RemoveTapDevices removes the tap device with name tapName
func SetupTunDev ¶
func SetupTunDev() error
SetupTunDev sets up the /dev/net/tun device if it doesn't exists
Types ¶
This section is empty.