Skip to content

Commit b34d7ac

Browse files
authored
Merge pull request kubernetes#77458 from grayluck/agent-v2.3.0
Bump ip-masq-agent version to v2.3.0. Enable nomasq for reserved IPs.
2 parents 1ce103a + 1059a71 commit b34d7ac

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
@@ -116,9 +116,16 @@ function config-ip-firewall {
116116
iptables -w -t nat -N IP-MASQ
117117
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
118118
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
119-
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
120-
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
121-
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
119+
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
120+
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
121+
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
122+
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
123+
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
124+
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
125+
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
126+
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
127+
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
128+
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
122129
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
123130
fi
124131

0 commit comments

Comments
 (0)