2023-08-10 16:34:04 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
if [ ${MODE} == "start" ]
|
|
|
|
then
|
|
|
|
set -ue
|
|
|
|
elif [ ${MODE} == "stop" ]
|
|
|
|
then
|
|
|
|
set -u
|
|
|
|
else
|
|
|
|
echo "$(basename ${0}): mode must be one of either 'start' or 'stop'" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case ${PHASE} in
|
|
|
|
"pre-up")
|
|
|
|
/usr/sbin/ip link add ${IFACE} type bridge
|
2023-08-12 10:50:14 +02:00
|
|
|
/usr/sbin/ip link set dev ${IFACE} type bridge forward_delay 0
|
2023-08-10 16:34:04 +02:00
|
|
|
|
2023-08-13 23:47:03 +02:00
|
|
|
/usr/sbin/sysctl -q -w net.ipv6.conf.${IFACE}.autoconf=0
|
2023-08-10 16:34:04 +02:00
|
|
|
|
|
|
|
/usr/sbin/ip -4 address add {{ vpn_bridge_inet_address }}/{{ vpn_bridge_inet_prefixlen }} dev ${IFACE}
|
|
|
|
/usr/sbin/ip -6 address add {{ vpn_bridge_inet6_address }}/{{ vpn_bridge_inet6_prefixlen }} dev ${IFACE} nodad
|
|
|
|
;;
|
|
|
|
"post-up")
|
|
|
|
;;
|
|
|
|
"pre-down")
|
|
|
|
;;
|
|
|
|
"post-down")
|
|
|
|
/usr/sbin/ip -6 address flush dev ${IFACE}
|
|
|
|
/usr/sbin/ip -4 address flush dev ${IFACE}
|
|
|
|
|
2023-08-12 10:50:14 +02:00
|
|
|
/usr/sbin/ip link delete dev ${IFACE}
|
2023-08-10 16:34:04 +02:00
|
|
|
;;
|
|
|
|
esac
|