snat

package
v1.4.55 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnatBridgeName = "azSnatbr"
	ImdsIP         = "169.254.169.254/32"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	SnatBridgeIP           string
	SkipAddressesFromBlock []string
	// contains filtered or unexported fields
}

func NewSnatClient

func NewSnatClient(hostIfName string,
	contIfName string,
	localIP string,
	snatBridgeIP string,
	hostPrimaryMac string,
	skipAddressesFromBlock []string,
	nl netlink.NetlinkInterface,

	plClient platform.ExecClient,
) Client

func (*Client) AllowIPAddressesOnSnatBridge

func (client *Client) AllowIPAddressesOnSnatBridge() error

AllowIPAddressesOnSnatBridge adds iptables rules that allows only specific Private IPs via linux bridge

func (*Client) AllowInboundFromHostToNC

func (client *Client) AllowInboundFromHostToNC() error

*

This function adds iptables rules that allows only host to NC communication and not the other way

*

func (*Client) AllowInboundFromNCToHost

func (client *Client) AllowInboundFromNCToHost() error

*

This function adds iptables rules that allows only NC to Host communication and not the other way

*

func (*Client) BlockIPAddressesOnSnatBridge

func (client *Client) BlockIPAddressesOnSnatBridge() error

BlockIPAddressesOnSnatBridge adds iptables rules that blocks all private IPs flowing via linux bridge

func (*Client) ConfigureSnatContainerInterface

func (client *Client) ConfigureSnatContainerInterface() error

func (*Client) CreateSnatEndpoint

func (client *Client) CreateSnatEndpoint() error

func (*Client) DeleteInboundFromHostToNC

func (client *Client) DeleteInboundFromHostToNC() error

func (*Client) DeleteInboundFromNCToHost

func (client *Client) DeleteInboundFromNCToHost() error

func (*Client) DeleteSnatEndpoint

func (client *Client) DeleteSnatEndpoint() error

func (*Client) DropArpForSnatBridgeApipaRange

func (client *Client) DropArpForSnatBridgeApipaRange(snatBridgeIP, azSnatVethIfName string) error

func (*Client) MoveSnatEndpointToContainerNS

func (client *Client) MoveSnatEndpointToContainerNS(netnsPath string, nsID uintptr) error

*

Move container veth inside container network namespace

*

func (*Client) SetupSnatContainerInterface

func (client *Client) SetupSnatContainerInterface() error

*

Configure Routes and setup name for container veth

*

Jump to

Keyboard shortcuts

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