diff --git a/logic/peers.go b/logic/peers.go index eda25965..24224373 100644 --- a/logic/peers.go +++ b/logic/peers.go @@ -405,6 +405,10 @@ func GetPeerUpdateForHost(host *models.Host) (models.HostPeerUpdate, error) { } } } + if node.IsIngressGateway && peer.IsEgressGateway { + hostPeerUpdate.IngressInfo.EgressRanges = append(hostPeerUpdate.IngressInfo.EgressRanges, + peer.EgressGatewayRanges...) + } nodePeerMap[peerHost.PublicKey.String()] = models.PeerRouteInfo{ PeerAddr: net.IPNet{ IP: net.ParseIP(peer.PrimaryAddress()), diff --git a/models/mqtt.go b/models/mqtt.go index 6b3caafa..ba0c61e2 100644 --- a/models/mqtt.go +++ b/models/mqtt.go @@ -31,7 +31,8 @@ type HostPeerUpdate struct { // IngressInfo - struct for ingress info type IngressInfo struct { - ExtPeers map[string]ExtClientInfo `json:"ext_peers" yaml:"ext_peers"` + ExtPeers map[string]ExtClientInfo `json:"ext_peers" yaml:"ext_peers"` + EgressRanges []string `json:"egress_ranges" yaml:"egress_ranges"` } // EgressInfo - struct for egress info