Documentation
¶
Index ¶
- func Apply(cfg Config) error
- func ApplyRules(iptablesRules rules.RuleSet) error
- func BlockInputFromInterface(proto string, iface Link) rules.Rule
- func Forward(in, out Link) rules.Rule
- func ForwardToSubnet(in, out Link, dst Addr) rules.Rule
- func Masquerade(out Link) rules.Rule
- func OpenPort(proto string, port int) rules.Rule
- func OpenPortOnInterface(proto string, port int, iface Link) rules.Rule
- type Addr
- type Config
- type Link
- type LinkString
- type StaticRoute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyRules ¶
Applies a set of iptables rules in order.
func BlockInputFromInterface ¶
Blocks input (local connections) from a specific network interface. This is specific to L4/transport-layer (TCP/UDP currently, other protos may be added in the future) assuming things like ICMP shouldn't be blocked.
func Forward ¶
Allows traffic to be forwarded from in to out. Note that this doesn't affect the routing rules at all.
func ForwardToSubnet ¶
Allows traffic to be forwarded from in to out when directed to a specific subnet. Note that this doesn't affect the routing rules at all.
Types ¶
type Config ¶
type Config interface { // Link connected to the network with local clients. LAN() Link // Link connected to a broader network (possibly the internet) that will // be used to masquerade outbound connections from LAN(). Uplink() Link // Other networks that can be routed to from LAN without masquerading. The // static route will not be established in the reverse direction. FlatNetworks() []StaticRoute ExtraRules() rules.RuleSet }
type LinkString ¶ added in v0.2.0
type LinkString string
func (LinkString) Name ¶ added in v0.2.0
func (l LinkString) Name() string
type StaticRoute ¶
Union of a subnet specified in CIDR and the Link it can be reached on.
Click to show internal directories.
Click to hide internal directories.