networkutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AzureDNS  = "168.63.129.16"
	AzureIMDS = "169.254.169.254"
)

known IP's

Variables

This section is empty.

Functions

func AddSnatRule

func AddSnatRule(match string, ip net.IP) error

This fucntion adds rule which snat to ip passed filtered by match string.

func AllowIPAddresses

func AllowIPAddresses(bridgeName string, skipAddresses []string, action string) error

func BlockIPAddresses

func BlockIPAddresses(bridgeName, action string) error

Types

type NetworkUtils

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

func NewNetworkUtils

func NewNetworkUtils(nl netlink.NetlinkInterface, plClient platform.ExecClient) NetworkUtils

func (NetworkUtils) AssignIPToInterface

func (nu NetworkUtils) AssignIPToInterface(interfaceName string, ipAddresses []net.IPNet) error

func (NetworkUtils) CreateEndpoint

func (nu NetworkUtils) CreateEndpoint(hostVethName, containerVethName string, macAddress net.HardwareAddr) error

func (NetworkUtils) DisableRAForInterface

func (nu NetworkUtils) DisableRAForInterface(ifName string) error

func (NetworkUtils) EnableIPForwarding

func (nu NetworkUtils) EnableIPForwarding() error

This function enables ip forwarding in VM and allow forwarding packets from the interface

func (NetworkUtils) EnableIPV4Forwarding

func (nu NetworkUtils) EnableIPV4Forwarding() error

func (NetworkUtils) EnableIPV6Forwarding

func (nu NetworkUtils) EnableIPV6Forwarding() error

func (NetworkUtils) SetProxyArp

func (nu NetworkUtils) SetProxyArp(ifName string) error

func (NetworkUtils) SetupContainerInterface

func (nu NetworkUtils) SetupContainerInterface(containerVethName, targetIfName string) error

func (NetworkUtils) UpdateIPV6Setting

func (nu NetworkUtils) UpdateIPV6Setting(disable int) error

This functions enables/disables ipv6 setting based on enable parameter passed.

Jump to

Keyboard shortcuts

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