fix mesh and prov raito
This commit is contained in:
parent
cc99c25966
commit
6aee4ab033
3 changed files with 17 additions and 3 deletions
|
@ -36,9 +36,9 @@ let
|
|||
if4 = {
|
||||
"mesh-${shorten peerName}-${toString remoteZone}-${toString remoteId}" = {
|
||||
ips = [
|
||||
"172.19.${toString myId}.${toString myId}/32"
|
||||
"172.19.0.${toString myId}/32"
|
||||
"172.19.${toString myId}.${toString remoteId}/32"
|
||||
"fc00::${toString myId}:${toString myId}/128"
|
||||
"fc00::${toString myId}/128"
|
||||
"fc00::${toString myId}:${toString remoteId}/128"
|
||||
];
|
||||
privateKeyFile = config.age.secrets."wg-private-zone-${toString myZone}-id-${toString myId}".path;
|
||||
|
@ -48,6 +48,7 @@ let
|
|||
publicKey = peerConfig.wg-pub;
|
||||
allowedIPs = [
|
||||
# Allow mesh trafic
|
||||
"172.19.0.${toString peerConfig.id}/32"
|
||||
"172.19.${toString peerConfig.id}.0/24"
|
||||
"fc00::${toString peerConfig.id}:0/96"
|
||||
# Allow mgmt transport
|
||||
|
@ -71,6 +72,10 @@ let
|
|||
${pkgs.iproute2}/bin/ip route replace 172.19.${toString peerConfig.id}.0/24 dev mesh-${shorten peerName}-${toString peerConfig.zone}-${toString peerConfig.id} scope link
|
||||
${pkgs.iproute2}/bin/ip -6 route replace fc00::${toString peerConfig.id}:0/112 dev mesh-${shorten peerName}-${toString peerConfig.zone}-${toString peerConfig.id} scope link
|
||||
|
||||
# Nodes self ip
|
||||
${pkgs.iproute2}/bin/ip route replace 172.19.0.${toString peerConfig.id}/32 dev mesh-${shorten peerName}-${toString peerConfig.zone}-${toString peerConfig.id} scope link
|
||||
${pkgs.iproute2}/bin/ip -6 route replace fc00::${toString peerConfig.id}/128 dev mesh-${shorten peerName}-${toString peerConfig.zone}-${toString peerConfig.id} scope link
|
||||
|
||||
# Return path for mgmt trafic
|
||||
${if lib.elem peerName mapping.bastion then ''
|
||||
${pkgs.iproute2}/bin/ip route replace 172.19.${toString (peerConfig.zone + 127)}.0/24 via 172.19.${toString peerConfig.id}.${toString myId} dev mesh-${shorten peerName}-${toString peerConfig.zone}-${toString peerConfig.id}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue