HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: //proc/23796/root/etc/ppp/ipv6-up
#!/bin/sh

echo 2 > /proc/sys/net/ipv6/conf/${IFNAME}/accept_ra

. /etc/ppp/ip-function
SYNONETD_TOOL="/usr/syno/sbin/synonetdtool"

gen_lease_file ()
{
	if [ -z $1 ]; then
		return 1
	fi

	local base=$(/usr/syno/bin/synogetkeyvalue /etc/ppp/pppoe_1.conf ETH)
	echo default-duid \"`/usr/syno/sbin/synonetdtool --gen-DUID "${base}"`\"\; > /etc/dhclient/ipv6/dhcpv6.lease.$1
}

set_gateway_info()
{
	local priority=$1
	local class=$2
	local gateway="NULL"
	local ip="${IPLOCAL}"

	logger -p user.err -t "/etc/ppp/ipv6-up" "${class} ${IFNAME} is up"

	if [ -n "${LLREMOTE}" ]; then
		gateway="${LLREMOTE}"
	fi

	${SYNONETD_TOOL} --add-gateway-info -6 ${priority} ${IFNAME} ${gateway} NULL ${class}
	${SYNONETD_TOOL} --refresh-gateway -6

	local ipv6="${LLLOCAL}"
	local enable_multi_gateway=`/bin/get_key_value /etc/synoinfo.conf multi_gateway`
	if [ "xyes" = "x${enable_multi_gateway}" ]; then
		${SYNONETD_TOOL} --add-policy-route-rule -6 multi-gateway ${IFNAME} NULL NULL ${gateway}
		${SYNONETD_TOOL} --refresh-route-table -6 ${IFNAME} ${ipv6}
	fi

}

TC_SCRIPT="/usr/syno/bin/synotc_common"
RELAYDAEMON="/usr/syno/sbin/synorelayd"
PPPOE_CONF="/etc/ppp/pppoe_1.conf"

if [ -n "${IFNAME}" ]; then
	check_is_pppoe ${PPPD_PID}
	if [ 0 -eq $? ]; then
		default_route=`/usr/syno/bin/synogetkeyvalue ${PPPOE_CONF} DEFAULTROUTE`
		priority="-1"
		class="pppoe"

		if [ "xyes" = "x${default_route}" ]; then
			priority="0"
		fi

		set_gateway_info ${priority} ${class}

		# This is workaround of the network framework, which
		# SYNONetIPv6ConfSet() skips settings to PPPoE. So here force it to
		# start dhclient6 for info, even the server do not support it. It will
		# have problem if the server uses IPv6 stateful mode.
		/bin/systemctl start dhclient6@${IFNAME}-info
	fi
fi

if [ -x "${TC_SCRIPT}" ]; then
	${TC_SCRIPT} restart /etc/tc
fi

${SYNONETD_TOOL} --refresh-static-route-rules -6

${RELAYDAEMON} -U