Skip to content

Commit

Permalink
Merge pull request #2784 from gravitl/master
Browse files Browse the repository at this point in the history
master
  • Loading branch information
abhishek9686 authored Jan 23, 2024
2 parents 058338f + 2d2cfe3 commit 32598a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ services:
env_file: ./netmaker.env
depends_on:
- netmaker
restart: always
volumes:
- dnsconfig:/root/dnsconfig
mq:
Expand Down
7 changes: 7 additions & 0 deletions logic/extpeers.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ func GetEgressRangesOnNetwork(client *models.ExtClient) ([]string, error) {
}
}
}
extclients := GetGwExtclients(client.IngressGatewayID, client.Network)
for _, extclient := range extclients {
if extclient.ClientID == client.ClientID {
continue
}
result = append(result, extclient.ExtraAllowedIPs...)
}

return result, nil
}
Expand Down
5 changes: 3 additions & 2 deletions logic/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package logic

import (
"errors"
"fmt"
"time"

"github.com/gravitl/netmaker/database"
Expand Down Expand Up @@ -89,7 +88,9 @@ func CreateEgressGateway(gateway models.EgressGatewayRequest) (models.Node, erro
for i := len(gateway.Ranges) - 1; i >= 0; i-- {
// check if internet gateway IPv4
if gateway.Ranges[i] == "0.0.0.0/0" || gateway.Ranges[i] == "::/0" {
return models.Node{}, fmt.Errorf("create internet gateways on the remote client gateway")
// remove inet range
gateway.Ranges = append(gateway.Ranges[:i], gateway.Ranges[i+1:]...)
continue
}
normalized, err := NormalizeCIDR(gateway.Ranges[i])
if err != nil {
Expand Down

0 comments on commit 32598a2

Please sign in to comment.