add ingress GW address to route info

This commit is contained in:
Abhishek Kondur 2023-02-01 13:40:15 +04:00
parent 5e9798bb05
commit 2ffd3cab72
2 changed files with 5 additions and 0 deletions

View file

@ -441,6 +441,10 @@ func GetPeerUpdateForHost(host *models.Host) (models.HostPeerUpdate, error) {
}
hostPeerUpdate.IngressInfo.ExtPeers[extPeerIdAndAddr.ID] = models.ExtClientInfo{
Masquerade: true,
IngGwAddr: net.IPNet{
IP: net.ParseIP(node.PrimaryAddress()),
Mask: net.CIDRMask(32, 32),
},
ExtPeerAddr: net.IPNet{
IP: net.ParseIP(extPeerIdAndAddr.Address),
Mask: net.CIDRMask(32, 32),

View file

@ -42,6 +42,7 @@ type PeerExtInfo struct {
}
type ExtClientInfo struct {
IngGwAddr net.IPNet `json:"ingress_gw_addr" yaml:"ingress_gw_addr"`
Masquerade bool `json:"masquerade" yaml:"masquerade"`
ExtPeerAddr net.IPNet `json:"ext_peer_addr" yaml:"ext_peer_addr"`
ExtPeerKey string `json:"ext_peer_key" yaml:"ext_peer_key"`