Documentation
¶
Index ¶
Constants ¶
const CurrentNetns = ""
CurrentNetns can be passed to L3Segment.AddHost to indicate that the host lives in the current network namespace (eg. where dockerd runs).
Variables ¶
This section is empty.
Functions ¶
func SetFilterForwardPolicies ¶
SetFilterForwardPolicies sets the default policy for the FORWARD chain in the filter tables for both IPv4 and IPv6. The original policy is restored using t.Cleanup().
There's only one filter-FORWARD policy, so this won't behave well if used by tests running in parallel in a single network namespace that expect different behaviour.
Types ¶
type Host ¶
type Host struct { Iface string // Iface is the interface name in the host network namespace. // contains filtered or unexported fields }
type L3Segment ¶
L3Segment simulates a switched, dual-stack capable network that interconnects multiple hosts running in their own network namespace.
func NewL3Segment ¶
NewL3Segment creates a new L3Segment. The bridge interface interconnecting all the hosts is created in a new network namespace named nsName and it's assigned one or more IP addresses. Those need to be unmasked netip.Prefix.