/etc/miredo/client-hook is in miredo 1.2.6-4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70  | #! /bin/sh
#
# Miredo client hook script for Linux/iproute2
# Copyright © 2007 Rémi Denis-Courmont.
# Distributed under the terms of the GNU General Public License version 2.
# Linux iproute2 path:
IP="/sbin/ip"
# Linux default route default metric is 1024
# (we put 1029 so that Teredo is used as a last resort):
METRIC=1029
# Linux routing table ID
# (possible values: 1-252 from /etc/iproute/rt_tables):
TABLE="teredo"
# Linux routing rule priority
# (possible values: 1-32765, lowest number is highest priority):
PRIO=32765
# MTU for the tunnel interface
# (default: specified by the Teredo server, or 1280)
#MTU=1400
if ! test -x "$IP"; then
	echo "$0: iproute2 is required! Please install it." >&2
	exit 1
fi
# Nothing to do with destroy event
if test "$STATE" = "destroy"; then exit 0; fi
# If the source routing table is not configured, ignore it.
if ! "$IP" route show table "$TABLE" >/dev/null 2>&1; then
	unset TABLE
else
	if test "$OLD_ADDRESS"; then
		"$IP" -6 rule del from "$OLD_ADDRESS" \
			prio "$PRIO" table "$TABLE" 2>/dev/null
	fi
	"$IP" -6 route flush table "$TABLE" 2>/dev/null
fi
"$IP" -6 route flush dev "$IFACE" 2>/dev/null
"$IP" -6 address flush dev "$IFACE" 2>/dev/null
"$IP" -6 link set dev "$IFACE" "$STATE"
if test "$MTU"; then
	"$IP" link set dev "$IFACE" mtu "$MTU"
fi
case "$STATE" in
	up)
		"$IP" -6 address add "${LLADDRESS}/64" dev "$IFACE"
		"$IP" -6 address add "${ADDRESS}/32" dev "$IFACE"
		"$IP" -6 route add default dev "$IFACE" metric "$METRIC"
		if test "$TABLE"; then
			"$IP" -6 route add default dev "$IFACE" table "$TABLE"
			"$IP" -6 rule add from "$ADDRESS" \
				prio "$PRIO" table "$TABLE"
		fi
esac
# This should be required when changing policy routing rules, but it
# seems to confuse certain kernels into removing our default route!
#"$IP" -6 route flush cache 2>/dev/null
exit 0
 |