iptables

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainRamaPostRouting = "RAMA-POSTROUTING"
	ChainRamaForward     = "RAMA-FORWARD"
	ChainRamaPreRouting  = "RAMA-PREROUTING"
)
View Source
const (
	TableNAT    = "nat"
	TableFilter = "filter"
	TableMangle = "mangle"

	ChainPostRouting = "POSTROUTING"
	ChainPreRouting  = "PREROUTING"
	ChainForward     = "FORWARD"

	CustomChainPrefix = "HYBRIDNET-"

	ChainHybridnetPostRouting = CustomChainPrefix + "POSTROUTING"
	ChainHybridnetForward     = CustomChainPrefix + "FORWARD"
	ChainHybridnetPreRouting  = CustomChainPrefix + "PREROUTING"

	ChainHybridnetFromRuleSkip         = CustomChainPrefix + "FROM-RULE-SKIP"
	ChainHybridnetPodToNodeTrafficMark = CustomChainPrefix + "POD-TO-NODE-MARK"

	HybridnetOverlayNetSetName       = "HYBR-OVERLAY-NET"
	HybridnetAllIPSetName            = "HYBR-ALL"
	HybridnetNodeIPSetName           = "HYBR-NODE-IP"
	HybridnetLocalPodIPSetName       = "HYBR-LOCAL-POD-IP"
	HybridnetLocalUnderlayNetSetName = "HYBR-LOCAL-UNDERLAY-NET"

	PodToNodeBackTrafficMarkString = "0x20"
	FullNATedPodTrafficMarkString  = "0x40"
	PodToNodeBackTrafficMark       = 0x20
	FullNATedPodTrafficMark        = 0x40

	KubeProxyMasqueradeMark       = 0x4000
	KubeProxyMasqueradeMarkString = "0x4000"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func CreateIPtablesManager

func CreateIPtablesManager(protocol Protocol) (*Manager, error)

func (*Manager) RecordLocalNodeIP added in v0.7.6

func (mgr *Manager) RecordLocalNodeIP(nodeIP net.IP)

func (*Manager) RecordLocalPodIP added in v0.4.0

func (mgr *Manager) RecordLocalPodIP(podIP net.IP)

func (*Manager) RecordNodeIP

func (mgr *Manager) RecordNodeIP(nodeIP net.IP)

func (*Manager) RecordRemoteNodeIP added in v0.3.0

func (mgr *Manager) RecordRemoteNodeIP(nodeIP net.IP)

func (*Manager) RecordRemoteSubnet added in v0.3.0

func (mgr *Manager) RecordRemoteSubnet(subnetCidr *net.IPNet, isOverlay bool)

func (*Manager) RecordSubnet

func (mgr *Manager) RecordSubnet(subnetCidr *net.IPNet, isOverlay, isLocal bool)

func (*Manager) RecordVlanForwardIfName added in v0.8.1

func (mgr *Manager) RecordVlanForwardIfName(vlanForwardIfName string)

func (*Manager) Reset

func (mgr *Manager) Reset()

func (*Manager) SetBgpIfName added in v0.4.0

func (mgr *Manager) SetBgpIfName(bgpIfName string)

func (*Manager) SetOverlayIfName

func (mgr *Manager) SetOverlayIfName(overlayIfName string)

func (*Manager) SyncRules

func (mgr *Manager) SyncRules() error

type Protocol

type Protocol byte

Protocol defines the ip protocol either ipv4 or ipv6

const (
	// ProtocolIpv4 represents ipv4 protocol in iptables
	ProtocolIpv4 Protocol = iota + 1
	// ProtocolIpv6 represents ipv6 protocol in iptables
	ProtocolIpv6
)

Jump to

Keyboard shortcuts

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