run: Add IPv6 forwarding if default route

* Enable IPv6 forwarding if docker daemon provided a default route
* For now this requires the --privileged flag, but this could be hacked
  around using `ip netns` madness.
This commit is contained in:
Kyle Manna 2015-07-05 21:07:06 -07:00
parent 6aca273d89
commit e6f7904344

View File

@ -43,6 +43,16 @@ if [ -r "$EASYRSA_PKI/crl.pem" ]; then
ARGS=("--crl-verify" "$OPENVPN/crl.pem")
fi
ip -6 route show default 2>/dev/null
if [ $? = 0 ]; then
echo "Enabling IPv6 Forwarding"
# If this fails, ensure the docker container is run with --privileged
# Could be side stepped with `ip netns` madness to drop privileged flag
sysctl net.ipv6.conf.default.forwarding=1
sysctl net.ipv6.conf.all.forwarding=1
fi
if [ "$#" -gt 0 ]; then
exec openvpn "$@"
else