diff --git a/Dockerfile b/Dockerfile index ea04935..297a8f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM ubuntu:14.04 +FROM ubuntu:16.04 RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade \ - && DEBIAN_FRONTEND=noninteractive apt-get -y install strongswan iptables uuid-runtime \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install strongswan iptables uuid-runtime ndppd openssl \ && rm -rf /var/lib/apt/lists/* # cache busted 20160406.1 RUN rm /etc/ipsec.secrets diff --git a/bin/start-vpn b/bin/start-vpn index 9efbe3a..4bfca83 100755 --- a/bin/start-vpn +++ b/bin/start-vpn @@ -26,8 +26,11 @@ # Continue reading: https://wiki.strongswan.org/projects/strongswan/wiki/VirtualIP sysctl net.ipv4.ip_forward=1 sysctl net.ipv6.conf.all.forwarding=1 +sysctl net.ipv6.conf.eth0.proxy_ndp=1 iptables -t nat -A POSTROUTING -s 10.8.0.0/16 -o eth0 -m policy --dir out --pol ipsec -j ACCEPT iptables -t nat -A POSTROUTING -s 10.8.0.0/16 -o eth0 -j MASQUERADE +ip6tables -t nat -A POSTROUTING -s 2a00:1450:400c:c05::/64 -o eth0 -m policy --dir out --pol ipsec -j ACCEPT +ip6tables -t nat -A POSTROUTING -s 2a00:1450:400c:c05::/64 -o eth0 -j MASQUERADE # hotfix for openssl `unable to write 'random state'` stderr SHARED_SECRET="123$(openssl rand -base64 32 2>/dev/null)" @@ -36,5 +39,6 @@ SHARED_SECRET="123$(openssl rand -base64 32 2>/dev/null)" # hotfix for https://github.com/gaomd/docker-ikev2-vpn-server/issues/7 rm -f /var/run/starter.charon.pid +service ndppd start # http://wiki.loopop.net/doku.php?id=server:vpn:strongswanonopenvz /usr/sbin/ipsec start --nofork diff --git a/etc/ipsec.conf b/etc/ipsec.conf index 042b913..e572870 100644 --- a/etc/ipsec.conf +++ b/etc/ipsec.conf @@ -16,9 +16,9 @@ conn %default conn rw # http://wiki.loopop.net/doku.php?id=server:vpn:strongswanonopenvz # https://wiki.strongswan.org/projects/strongswan/wiki/ForwardingAndSplitTunneling - leftsubnet=0.0.0.0/0 + leftsubnet=0.0.0.0/0,::/0 # end ref leftfirewall=yes right=%any - rightsourceip=10.8.0.0/16 + rightsourceip=10.8.0.0/16,fd6a:6ce3:c8d8:7caa::/64 auto=add diff --git a/etc/ndppd.conf b/etc/ndppd.conf new file mode 100644 index 0000000..5d1a539 --- /dev/null +++ b/etc/ndppd.conf @@ -0,0 +1,6 @@ +proxy eth0 { + rule fd6a:6ce3:c8d8:7caa::/64 { + static + } + +}