#!/bin/sh PPP_IFACE="$1" PPP_TTY="$2" PPP_SPEED="$3" PPP_LOCAL="$4" PPP_REMOTE="$5" PPP_IPPARAM="$6" if [ ${PPP_LOCAL} = '89.234.186.11' ]; then exit 0 fi prefix_interco=$(awk '$1 == "Framed-IPv6-Prefix" { print $2 }' /run/radattr.$PPP_IFACE) prefix_deleg=$(awk '$1 == "Delegated-IPv6-Prefix" { print $2 }' /run/radattr.$PPP_IFACE) ip -6 addr add ${prefix_interco%/64}1/64 dev ${PPP_IFACE} ip -6 route add $prefix_deleg via $PPP_REMOTE dev $PPP_IFACE if [ ! -d /run/vpn/ ]; then mkdir /run/vpn/ fi echo " interface $PPP_IFACE { AdvSendAdvert on; IgnoreIfMissing on; prefix $prefix_interco {}; }; # $PPP_LOCAL $PPP_REMOTE " > /run/vpn/radvd-user.${PPP_IFACE}.conf cat /etc/radvd.conf.base > /etc/radvd.conf cat /run/vpn/radvd-user.*.conf >> /etc/radvd.conf kill -HUP $(cat /run/radvd/radvd.pid) sed \ -e "s|#IFACE#|${PPP_IFACE}|" \ -e "s|#PF_INTERCO#|${prefix_interco}|" \ -e "s|#INET6_INTERCO#|${prefix_interco%/64}|g" \ -e "s|#PF_PD#|${prefix_deleg%/48}|" \ /etc/kea/kea-dhcp6-ppp.conf > /run/vpn/kea-dhcpd6-${PPP_IFACE}.conf /usr/sbin/kea-dhcp6 -c/run/vpn/kea-dhcpd6-${PPP_IFACE}.conf & # Forcer un RA après le démarage du DHCPv6 kill -HUP $(cat /run/radvd/radvd.pid)