You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 4, 2020. It is now read-only.
If I make and commit any changes to the wireguard interface (for example, changing the mtu), all ipv6 addresses defined on the interface (it doesn't matter how many I add) are removed from the interface and I need to manually add them back to the interface using standard iproute2 commands.
The text was updated successfully, but these errors were encountered:
#!/bin/bash
scriptname=$(basename $0)
confdir=/opt/vyatta/config/active/interfaces/wireguard
commithookdir=/etc/commit/post-hooks.d
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ "${scriptdir}" != "${commithookdir}" ]; then
if [ ! -h "${commithookdir}/${scriptname}" ]; then
ln -s "${scriptdir}/${scriptname}" "${commithookdir}"
fi
fi
shopt -s nullglob
for ifaceconf in ${confdir}/*;do
dev="$(basename "${ifaceconf}")"
conffile="${confdir}/${dev}/address/node.val"
[ -f "${conffile}" ] || continue
for addr in $(sed -ne '/^[0-9a-f:]\+\/[0-9]\+$/p' ${conffile});do
ip addr show dev ${dev} | \
grep -q "inet6 ${addr} scope global" \
|| ip -6 addr add ${addr} dev ${dev}
done
done
Install into /config/scripts/post-config.d. After boot (or if you run it manually), it will symlink itself into /etc/commit/post-hooks.d/, so that it's run after every commit. (/etc/commit/post-hooks.d/ is cleared on reboot)
Edit: I hereby grant unrestricted usage of the above script, including @Lochnair if they decide to use it, or a variation of it within the vyatta-wireguard package.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In my config I have the following:
If I make and commit any changes to the wireguard interface (for example, changing the mtu), all ipv6 addresses defined on the interface (it doesn't matter how many I add) are removed from the interface and I need to manually add them back to the interface using standard
iproute2
commands.The text was updated successfully, but these errors were encountered: