Added wireguard config

This commit is contained in:
famfo 2022-02-02 20:18:57 +00:00
parent 660e82bd67
commit 7d12b93b81
5 changed files with 91 additions and 2 deletions

71
LXC/config/bird/bird.conf Normal file
View file

@ -0,0 +1,71 @@
define AS = 4242421411;
define IPv6 = fd42:deca:fbad::1;
define NETv6 = fd42:deca:fbad::/48;
define NETSETv6 = [fd42:deca:fbad::/48+];
log "/var/log/bird.log" all;
roa6 table dn42_roa_v6;
function is_self_net() {
return net ~ NETSETv6;
}
function is_valid_network() {
return net ~ [
fd00::/8{44,64} # ULA address space as per RFC 4193
];
}
protocol device {
scan time 10;
}
protocol kernel {
scan time 20;
ipv6 {
import none;
export filter {
if source = RTS_STATIC then reject;
krt_prefsrc = IPv6;
accept;
};
};
};
protocol static {
roa6 { table dn42_roa_v6; };
include "/etc/bird/dn42_roa_bird2_6.conf";
};
protocol static {
ipv6;
route fd80::ade0/124 via "wg0";
}
protocol static {
route NETv6 reject;
ipv6 {
import all;
export none;
};
}
template bgp dnpeers {
local as AS;
path metric 1;
ipv6 {
import filter {
if is_valid_network() && !is_self_net() then {
if (roa_check(dn42_roa_v6, net, bgp_path.last) != ROA_VALID) then {
print "[dn42] ROA check failed for ", net, " ASN ", bgp_path.last;
reject;
} else accept;
} else reject;
};
export filter { if is_valid_network() && source ~ [RTS_STATIC, RTS_BGP] then accept; else reject; };
import limit 1000 action block;
};
}
include "/etc/bird/peers/*";

View file

@ -0,0 +1,3 @@
protocol bgp kioubit_v6 from dnpeers {
neighbor fe80::ade0%wg0 as 4242423914;
}

View file

@ -1,2 +0,0 @@
### Wireguard config
The config is made for the use with `wg-quick`.

View file

@ -0,0 +1,17 @@
# DN42 peer: Kioubit
[Interface]
FwMark = 42
PrivateKey = <private key>
ListenPort = 20103
Table = off
Address = fe80::ade1/48
PostUp = ip a add dev %i fd42:deca:fbad::1/128 peer fe80::ade0/48
PostUp = ip a add dev %i fd42:deca:fbad::1111:1/48
PostUp = ip a add dev %i fd42:deca:fbad::1111:2/48
PostUp = sysctl -w net.ipv6.conf.%i.autoconf=0
[Peer]
Endpoint = de2.g-load.eu:21411
PublicKey = B1xSG/XTJRLd+GrWDsB06BqnIq8Xud93YVh/LYYYtUY=
AllowedIPs = fd00::/8, fe80::/10