Skip to content

Commit a85f933

Browse files
authored
Merge pull request #10 from danhiris/main
fix google's UDP load balancers DSR implementation
2 parents 1461f0e + 5864c15 commit a85f933

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ resource "google_compute_instance_template" "accesstier_template" {
125125
"modprobe nf_conntrack \n",
126126
"echo '65536' > /proc/sys/net/netfilter/nf_conntrack_buckets \n",
127127
"echo '262144' > /proc/sys/net/netfilter/nf_conntrack_max \n",
128+
"# Setting up an iptables DNAT to fix google's UDP load balancers DSR implementation, which forward the traffic with an untranslated destination \n",
129+
"mkdir /etc/iptables \n",
130+
"iptables -t nat -I PREROUTING -p udp --dport 51820 -j DNAT --to-destination $(hostname -i) \n",
131+
"iptables-save > /etc/iptables/rules.v4 \n",
128132
var.datadog_api_key != null ? "curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script.sh | DD_AGENT_MAJOR_VERSION=7 DD_API_KEY=${var.datadog_api_key} DD_SITE=datadoghq.com bash -v \n" : "",
129133
"curl https://www.banyanops.com/onramp/deb-repo/banyan.key | apt-key add -\n",
130134
var.staging_repo != null ? "apt-add-repository \"deb https://www-stage.bnntest.com/onramp/deb-repo xenial main\" \n" : "apt-add-repository \"deb https://www.banyanops.com/onramp/deb-repo xenial main\" \n",

0 commit comments

Comments
 (0)