Server has IPv6 link (not routed) 2a01:cafe:babe:dead::1/64 on iface eth0
First, openvpn road warrior installer (https://github.com/Nyr/openvpn-install)
Additions to OpenVPN conf:
# Google Public DNS
push "dhcp-option DNS6 2001:4860:4860::8888"
push "dhcp-option DNS6 2001:4860:4860::8844"
# IPv6 addresses given to clients
server-ipv6 2a01:cafe:babe:dead:80::/112
# Probably some are redurant *shrug*
push "redirect-gateway-ipv6 def1 bypass-dhcp-ipv6"
push "route-ipv6 2000::/3"
push "redirect-gateway ipv6"
# without script-security openvpn won't start shell script
script-security 2
learn-address /etc/openvpn/ndp-proxy-setup.sh
The /etc/openvpn/ndp-proxy-setup.sh (don't forget chmod +x)
#!/bin/bash
# logger "ndp script: (euid:$EUID) $0 $@"
if [[ "$EUID" -ne 0 ]]; then
# To avoid waiting for password, use sudo's askpass feature
SUDO_ASKPASS=/bin/false sudo -A "$0" $@
exit $?
fi
action="$1"
addr="$2"
pubif="eth0"
if [[ "${addr//:/}" == "$addr" ]]
then
# not an ipv6 address
exit
fi
case "$action" in
add)
ip -6 neigh add proxy ${addr} dev ${pubif}
;;
update)
ip -6 neigh replace proxy ${addr} dev ${pubif}
;;
delete)
ip -6 neigh del proxy ${addr} dev ${pubif}
;;
esac
Since openvpn runs as nobody:nogroup, add to sudoers file (visudo):
nobody ALL=NOPASSWD: /etc/openvpn/ndp-proxy-setup.sh
Defaults!/etc/openvpn/ndp-proxy-setup.sh !requiretty
Add to/uncomment in /etc/sysctl.conf:
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.proxy_ndp=1
(Run sysctl -p
to apply)