iptables

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForwardExists

func ForwardExists(t *testing.T, ipt *iptables.IPTables, chain, containerIP string, port int) bool

ForwardExists check that at least 2 rules are present in the CNI-HOSTPORT-DNAT chain and checks for regex matches in the list of rules

func GetRedirectedChain

func GetRedirectedChain(t *testing.T, ipt *iptables.IPTables, chain, namespace, containerID string) string

GetRedirectedChain returns the chain where the traffic is being redirected. This is how libcni manage its port maps. Suppose you have the following rule: -A CNI-HOSTPORT-DNAT -p tcp -m comment --comment "dnat name: \"bridge\" id: \"default-YYYYYY\"" -m multiport --dports 9999 -j CNI-DN-XXXXXX So the chain where the traffic is redirected is CNI-DN-XXXXXX Returns an empty string in case nothing was found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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