Skip to content

Commit

Permalink
Merge pull request #4599 from kyrtapz/masq_subnet
Browse files Browse the repository at this point in the history
Use 169.254.0.0/17 as the default masquerade subnet
  • Loading branch information
trozet authored Aug 8, 2024
2 parents 4b9a741 + 296c5f9 commit 88b4a99
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contrib/kind-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set_default_params() {
export KUBECONFIG=${KUBECONFIG:-${HOME}/${KIND_CLUSTER_NAME}.conf}

# Validated params that work
export MASQUERADE_SUBNET_IPV4=${MASQUERADE_SUBNET_IPV4:-169.254.0.0/16}
export MASQUERADE_SUBNET_IPV4=${MASQUERADE_SUBNET_IPV4:-169.254.0.0/17}
export MASQUERADE_SUBNET_IPV6=${MASQUERADE_SUBNET_IPV6:-fd69::/112}

# Input not currently validated. Modify outside script at your own risk.
Expand Down
2 changes: 1 addition & 1 deletion contrib/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ set_default_params() {
SVC_CIDR_IPV6=${SVC_CIDR_IPV6:-fd00:10:96::/112}
JOIN_SUBNET_IPV4=${JOIN_SUBNET_IPV4:-100.64.0.0/16}
JOIN_SUBNET_IPV6=${JOIN_SUBNET_IPV6:-fd98::/64}
MASQUERADE_SUBNET_IPV4=${MASQUERADE_SUBNET_IPV4:-169.254.0.0/16}
MASQUERADE_SUBNET_IPV4=${MASQUERADE_SUBNET_IPV4:-169.254.0.0/17}
MASQUERADE_SUBNET_IPV6=${MASQUERADE_SUBNET_IPV6:-fd69::/112}
TRANSIT_SWITCH_SUBNET_IPV4=${TRANSIT_SWITCH_SUBNET_IPV4:-100.88.0.0/16}
TRANSIT_SWITCH_SUBNET_IPV6=${TRANSIT_SWITCH_SUBNET_IPV6:-fd97::/64}
Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/generator/udn/masquerade_ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func allocateMasqueradeIPs(idName string, masqueradeSubnet string, networkID int
return nil, fmt.Errorf("failed initializing generation of network id '%d' %s IPs: %w", networkID, idName, err)
}
// Let's illustrate the expected IPs for networkID 1 and 2
// with userDefinedNetworkMasqueradeIPBase=10 and subnet=169.254.0.0/16
// with userDefinedNetworkMasqueradeIPBase=10 and subnet=169.254.0.0/17
// networkID=1
// GatewayRouter: 169.254.0.11
// ManagementPort: 169.254.0.12
Expand Down
8 changes: 4 additions & 4 deletions go-controller/pkg/generator/udn/masquerade_ips_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ func TestAllocateMasqueradeIPs(t *testing.T) {
{
description: "with proper network id 2 should return expected subnets",
networkID: 2,
subnet: "169.254.0.0/16",
expectedIPs: masqueradeIPs{GatewayRouter: "169.254.0.13/16", ManagementPort: "169.254.0.14/16"},
subnet: "169.254.0.0/17",
expectedIPs: masqueradeIPs{GatewayRouter: "169.254.0.13/17", ManagementPort: "169.254.0.14/17"},
},
{
description: "with proper network id 3 should return expected subnets",
networkID: 3,
subnet: "169.254.0.0/16",
expectedIPs: masqueradeIPs{GatewayRouter: "169.254.0.15/16", ManagementPort: "169.254.0.16/16"},
subnet: "169.254.0.0/17",
expectedIPs: masqueradeIPs{GatewayRouter: "169.254.0.15/17", ManagementPort: "169.254.0.16/17"},
},
{
description: "with one of the two address beyond the subne should return an error",
Expand Down

0 comments on commit 88b4a99

Please sign in to comment.