Documentation ¶
Index ¶
- Constants
- func AddCatchAllRoute(l nl.Link, dst net.IPNet, config *lib.Config) error
- func AddDevice(instance string, config *lib.Config) error
- func AddDeviceRoutes(instance string, config *lib.Config) error
- func ConfigureDevice(instance string, config *lib.Config, replacePeers bool) error
- func DeleteDevice(instance string) error
- func GetDevice(ifname string) (*wgtypes.Device, nl.Link, error)
- func ParsePeer(p *lib.Peer) wgtypes.PeerConfig
- func SetDevice(instance string, config wgtypes.Config, replacePeers bool) error
- func SetFWMark(instance string, fwmark int) error
- func SetRPFilter() error
- type WGLink
Constants ¶
View Source
const (
// NetlinkName is the Netlink name for WireGuard
NetlinkName = "wireguard"
)
Variables ¶
This section is empty.
Functions ¶
func AddCatchAllRoute ¶
AddCatchAllRoute sets up routing to forward all traffic
func AddDeviceRoutes ¶
AddDeviceRoutes sets up the routes for all AllowedIPs in the peer configuration
func ConfigureDevice ¶
ConfigureDevice sets all WireGuard parameter in a Config
func DeleteDevice ¶
DeleteDevice deleted a WireGuard device and all routes and rules linked to it'
func GetDevice ¶
GetDevice returns the WireGuard interface and the link device for an interface name
func ParsePeer ¶
func ParsePeer(p *lib.Peer) wgtypes.PeerConfig
ParsePeer creates a Netlink-compatible view of a peer
func SetDevice ¶
SetDevice sets individual properties on a wireguard device without creating low-level interfaces.
func SetRPFilter ¶
func SetRPFilter() error
SetRPFilter sets the rp_filter of all interaces that are set to 1, to 2
Types ¶
Click to show internal directories.
Click to hide internal directories.