Documentation
¶
Overview ¶
Package rait provides the core logic of rait
Index ¶
- func RenderTemplate(in string, out string, ifnames []string) error
- type Instance
- func (instance *Instance) InterfaceConfig(peer *Peer) (*isolation.LinkAttrs, *wgtypes.Config, error)
- func (instance *Instance) IsManagedInterface(attrs *isolation.LinkAttrs) bool
- func (instance *Instance) ListInterfaceName() ([]string, error)
- func (instance *Instance) LoadPeers() ([]*Peer, error)
- func (instance *Instance) SyncInterfaces(up bool) error
- type Peer
- type RAIT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Instance ¶
type Instance struct { PrivateKey string `validate:"required,base64"` // required, the private key of current node AddressFamily string `validate:"required,oneof=ip4 ip6"` // required, [ip4]/ip6, the address family of current node SendPort int `validate:"required,min=1,max=65535"` // required, the sending (destination) port of wireguard sockets BindAddress string `validate:"omitempty,ip"` // the local address for wireguard sockets to bind to InterfacePrefix string `validate:"required"` // [rait], the common prefix to name the wireguard interfaces InterfaceGroup int `validate:"min=0,max=2147483647"` // [54], the ifgroup for the wireguard interfaces MTU int `validate:"required,min=1280,max=65535"` // [1400], the MTU of the wireguard interfaces FwMark int `validate:"min=0,max=4294967295"` // [0x36], the fwmark on packets sent by wireguard sockets DynamicListenPort bool // false, use dynamic listen ports instead of pre-defined ones Isolation string `validate:"required,oneof=netns vrf"` // [netns]/vrf, the isolation method to separate overlay from underlay InterfaceNamespace string // the netns or vrf to move wireguard interface into TransitNamespace string // the netns or vrf to create wireguard sockets in Peers string // [/etc/rait/peers.conf], the url of the peer list }
Instance is at the heart of rait it serves as the single source of truth for subsequent configuration of wireguard tunnels
func InstanceFromPath ¶
func (*Instance) InterfaceConfig ¶ added in v2.4.0
func (*Instance) IsManagedInterface ¶
func (*Instance) ListInterfaceName ¶ added in v2.4.0
func (*Instance) SyncInterfaces ¶
type Peer ¶
type Peer struct { PublicKey string `validate:"required,base64"` // required, the public key of the peer AddressFamily string `validate:"required,oneof=ip4 ip6"` // required, [ip4]/ip6, the address family of this node Endpoint string `validate:"omitempty,ip|hostname_rfc1123"` // the endpoint ip address or resolvable hostname SendPort int `validate:"required,min=1,max=65535"` // required, the sending port of the peer }
Peer represents a single rait node which corresponds to a wireguard interface
func PeersFromPath ¶
type RAIT ¶ added in v2.4.0
type RAIT struct {
Instances []*Instance
}
func RAITFromPaths ¶ added in v2.4.0
func (*RAIT) ListInterfaceName ¶ added in v2.4.0
func (*RAIT) RenderTemplate ¶ added in v2.4.0
func (*RAIT) SyncInterfaces ¶ added in v2.4.0
Click to show internal directories.
Click to hide internal directories.