Skip to content

Commit 1059a71

Browse files
committed
Bump ip-masq-agent version to v2.3.0. Enable nomasq for reserved IPs.
Added the non-masq ranges to configure-helper.sh so that GCE clusters will have the non-masq IP ranges aligned with GKE clusters.
1 parent df29573 commit 1059a71

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

cluster/addons/ip-masq-agent/ip-masq-agent.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
kubernetes.io/cluster-service: "true"
99
addonmanager.kubernetes.io/mode: Reconcile
1010
---
11-
# https://github.com/kubernetes-incubator/ip-masq-agent/blob/v2.0.0/README.md
11+
# https://github.com/kubernetes-incubator/ip-masq-agent/blob/v2.3.0/README.md
1212
apiVersion: apps/v1
1313
kind: DaemonSet
1414
metadata:
@@ -32,9 +32,10 @@ spec:
3232
hostNetwork: true
3333
containers:
3434
- name: ip-masq-agent
35-
image: k8s.gcr.io/ip-masq-agent-amd64:v2.2.1
35+
image: k8s.gcr.io/ip-masq-agent-amd64:v2.3.0
3636
args:
3737
- --masq-chain=IP-MASQ
38+
- --nomasq-all-reserved-ranges
3839
resources:
3940
requests:
4041
cpu: 10m

cluster/gce/gci/configure-helper.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,16 @@ function config-ip-firewall {
9898
iptables -w -t nat -N IP-MASQ
9999
iptables -w -t nat -A POSTROUTING -m comment --comment "ip-masq: ensure nat POSTROUTING directs all non-LOCAL destination traffic to our custom IP-MASQ chain" -m addrtype ! --dst-type LOCAL -j IP-MASQ
100100
iptables -w -t nat -A IP-MASQ -d 169.254.0.0/16 -m comment --comment "ip-masq: local traffic is not subject to MASQUERADE" -j RETURN
101-
iptables -w -t nat -A IP-MASQ -d 10.0.0.0/8 -m comment --comment "ip-masq: local traffic is not subject to MASQUERADE" -j RETURN
102-
iptables -w -t nat -A IP-MASQ -d 172.16.0.0/12 -m comment --comment "ip-masq: local traffic is not subject to MASQUERADE" -j RETURN
103-
iptables -w -t nat -A IP-MASQ -d 192.168.0.0/16 -m comment --comment "ip-masq: local traffic is not subject to MASQUERADE" -j RETURN
101+
iptables -w -t nat -A IP-MASQ -d 10.0.0.0/8 -m comment --comment "ip-masq: RFC 1918 reserved range is not subject to MASQUERADE" -j RETURN
102+
iptables -w -t nat -A IP-MASQ -d 172.16.0.0/12 -m comment --comment "ip-masq: RFC 1918 reserved range is not subject to MASQUERADE" -j RETURN
103+
iptables -w -t nat -A IP-MASQ -d 192.168.0.0/16 -m comment --comment "ip-masq: RFC 1918 reserved range is not subject to MASQUERADE" -j RETURN
104+
iptables -w -t nat -A IP-MASQ -d 100.64.0.0/10 -m comment --comment "ip-masq: RFC 6598 reserved range is not subject to MASQUERADE" -j RETURN
105+
iptables -w -t nat -A IP-MASQ -d 192.0.0.0/24 -m comment --comment "ip-masq: RFC 6890 reserved range is not subject to MASQUERADE" -j RETURN
106+
iptables -w -t nat -A IP-MASQ -d 192.0.2.0/24 -m comment --comment "ip-masq: RFC 5737 reserved range is not subject to MASQUERADE" -j RETURN
107+
iptables -w -t nat -A IP-MASQ -d 192.88.99.0/24 -m comment --comment "ip-masq: RFC 7526 reserved range is not subject to MASQUERADE" -j RETURN
108+
iptables -w -t nat -A IP-MASQ -d 198.18.0.0/15 -m comment --comment "ip-masq: RFC 2544 reserved range is not subject to MASQUERADE" -j RETURN
109+
iptables -w -t nat -A IP-MASQ -d 203.0.113.0/24 -m comment --comment "ip-masq: RFC 5737 reserved range is not subject to MASQUERADE" -j RETURN
110+
iptables -w -t nat -A IP-MASQ -d 240.0.0.0/4 -m comment --comment "ip-masq: Former Class E range obsoleted by RFC 3232 is not subject to MASQUERADE" -j RETURN
104111
iptables -w -t nat -A IP-MASQ -m comment --comment "ip-masq: outbound traffic is subject to MASQUERADE (must be last in chain)" -j MASQUERADE
105112
fi
106113

0 commit comments

Comments
 (0)