Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶ added in v1.2.5
type Chain struct {
// contains filtered or unexported fields
}
Chain contains a chain name and a transport protocol
type Portforward ¶
type Portforward struct {
// contains filtered or unexported fields
}
Portforward is a utility for managing portforwarding
func New ¶
func New(chainPrefix string, ipsetTableIPv4 string, ipsetTableIPv6 string, location string) (*Portforward, error)
New validates the addresses, ensures that the iptables portforwarding chains exists, and returns a new Portforward instance
func (*Portforward) AddPortforwarding ¶
func (p *Portforward) AddPortforwarding(peer api.WireguardPeer)
AddPortforwarding tries to add portforwarding rules for a peer without checking existing ones
func (*Portforward) RemovePortforwarding ¶
func (p *Portforward) RemovePortforwarding(peer api.WireguardPeer)
RemovePortforwarding tries to remove portforwarding rules for a peer without checking existing ones
func (*Portforward) UpdatePortforwarding ¶
func (p *Portforward) UpdatePortforwarding(peers api.WireguardPeerList)
UpdatePortforwarding updates the iptables rules for portforwarding to match the given list of peers
func (*Portforward) UpdateSinglePeerPortforwarding ¶ added in v1.2.6
func (p *Portforward) UpdateSinglePeerPortforwarding(peer api.WireguardPeer)
UpdateSinglePeerPortforwarding tries to add portforwarding rules for a peer while also trying to remove old rules for said peer