|
@@ -7,6 +7,7 @@ import (
|
|
|
"net"
|
|
|
"net/http"
|
|
|
"strconv"
|
|
|
+ "strings"
|
|
|
|
|
|
"github.com/gorilla/mux"
|
|
|
"github.com/gravitl/netmaker/database"
|
|
@@ -216,27 +217,6 @@ func getExtClientConf(w http.ResponseWriter, r *http.Request) {
|
|
|
} else {
|
|
|
gwendpoint = fmt.Sprintf("%s:%d", host.EndpointIP.String(), host.ListenPort)
|
|
|
}
|
|
|
- var newAllowedIPs string
|
|
|
- if logic.IsInternetGw(gwnode) {
|
|
|
- egressrange := "0.0.0.0/0"
|
|
|
- if gwnode.Address6.IP != nil && client.Address6 != "" {
|
|
|
- egressrange += "," + "::/0"
|
|
|
- }
|
|
|
- newAllowedIPs = egressrange
|
|
|
- } else {
|
|
|
- newAllowedIPs = network.AddressRange
|
|
|
- if newAllowedIPs != "" && network.AddressRange6 != "" {
|
|
|
- newAllowedIPs += ","
|
|
|
- }
|
|
|
- if network.AddressRange6 != "" {
|
|
|
- newAllowedIPs += network.AddressRange6
|
|
|
- }
|
|
|
- if egressGatewayRanges, err := logic.GetEgressRangesOnNetwork(&client); err == nil {
|
|
|
- for _, egressGatewayRange := range egressGatewayRanges {
|
|
|
- newAllowedIPs += "," + egressGatewayRange
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
defaultDNS := ""
|
|
|
if client.DNS != "" {
|
|
@@ -266,7 +246,7 @@ Endpoint = %s
|
|
|
defaultMTU,
|
|
|
defaultDNS,
|
|
|
host.PublicKey,
|
|
|
- newAllowedIPs,
|
|
|
+ strings.Join(logic.GetExtclientAllowedIPs(client), ","),
|
|
|
gwendpoint,
|
|
|
keepalive)
|
|
|
|