cluster: change wg0.conf to allow ring0/32 and ring1/32 on each peer

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2024-07-29 18:04:25 +00:00
parent 8db87c6102
commit 3a586ecaf2
+4 -7
View File
@@ -205,14 +205,11 @@ func (r *Ring) AddPeer(p *Machine) bool {
}
func (r *Ring) setRingZeroAllowedIPs(rp *RingPeer) {
regionID, zoneID, _, _ := r.Decode(rp.Address)
// everyone on ring0 is a gateway to ring1
subnet, _ := rings.RingOnePrefix(regionID, zoneID)
rp.AllowSubnet(subnet)
// peer
// ring0 peer
rp.AllowCIDR(rp.Address, 32)
// everyone on ring0 has a leg on ring1
rp.AllowCIDR(rp.Node.RingOneAddress(), 32)
}
func (r *Ring) setRingOneGatewayAllowedIPs(rp *RingPeer) {