From ff12302b7dfb83876a412719d95a4cb856494c00 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Thu, 28 May 2015 15:17:04 -0300 Subject: [PATCH] reverseproxy_ssh_setup: skip sysctl call on containers --- utils/reverseproxy_ssh_setup | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/reverseproxy_ssh_setup b/utils/reverseproxy_ssh_setup index f55efe1..37ec202 100755 --- a/utils/reverseproxy_ssh_setup +++ b/utils/reverseproxy_ssh_setup @@ -35,4 +35,7 @@ iptables -F -t nat # Setup port redirect iptables -t nat -A PREROUTING -d $reverseproxy_ip/32 -p tcp -m tcp --dport 22 -j DNAT --to-destination $integration_ip:22 iptables -t nat -A POSTROUTING -d $integration_ip/32 -p tcp -m tcp --dport 22 -j SNAT --to-source $reverseproxy_ip -sysctl -w net.ipv4.ip_forward=1 +if ! grep -q '/$' /proc/1/cgroup; then + # only on non-containers + sysctl -w net.ipv4.ip_forward=1 +fi -- libgit2 0.21.2