BIRD + networkd configuration generation utility for DN42 peerings
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
fox.cpp a412937fe9
Add support for per-peer local link address override
7 months ago
example_output Add option to override local WG port 7 months ago
.gitignore Add example_output 8 months ago
LICENSE Initial commit 9 months ago
README.md Rollback dn42_all change, fix IP addresses parsing mess 8 months ago
alpha.example.toml Add option to override local WG port 7 months ago
go.mod Initial commit 9 months ago
go.sum Initial commit 9 months ago
peergen.go Add support for per-peer local link address override 7 months ago

README.md

peergen

BIRD + networkd configuration generation utility for DN42 peerings

Supports only Wireguard now. Assumes BIRD configuration from https://git.hexanet.dev/foxcpp/chicken-coop

Compilation

As usual for Go.

go build

Configuration templates used

The whole thing is IPv6-only. Encourage proper IPv6 support and annoy people who have broken or missing IPv6!

peergen generates .netdev and .network files for use by systemd-networkd and drop-in .conf files for use by BIRD 2.

systemd-networkd configuration files contain inline private key for compatibilty with old systemd versions. Unless disabled via CLI flag, permissions are adjusted to make .netdev files accessible only for networkd. Generated files use 30000-39999 port range for tunnels.

BIRD 2 configuration is generated with the assumption that you have the function dn42_auth and dn42_all defined as below

function dn42_auth(int link_latency; int link_bandwidth; int link_crypto)
function dn42_all(int link_latency; int link_bandwidth; int link_crypto)

Usable implementations of this function can be found in https://git.hexanet.dev/foxcpp/chicken-coop/src/branch/master/common/dn42_filters.conf

Additionally, it expects you to have dn42_peer protocol template defined with shared configuration directives.

Again, here is the example from our configuration: https://git.hexanet.dev/foxcpp/chicken-coop/src/branch/master/common/dn42.conf

peergen generates a separate configuration file defining each protocol instance and places it in a directory specified via configuration flags. You can include all files from the directory in your main configuration using something like include "/etc/bird/dn42_peers/*.conf";

peergen renames all files ending in .conf from the used directory to have ~ suffix. Files with manual_ prefix are never touched. Same logic is applied for networkd, but all files with dn42 prefix are affected.

peergen configuration

See alpha.example.toml. It should not be hard to figure out.

Run:

# ./peergen -cfg alpha.example.toml
# networkctl reload 
# birdc configure