1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
TP-Link_Archer-XR500v/EN7526G_3.18Kernel_SDK/filesystem/usr/etc/ppp/ipv6-up
2024-07-22 01:58:46 -03:00

52 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
#
# This script is called with the following parameters:
# interface tty speed local-address prefix-length remote-address ipparam
#
WAN_IF=$1
IF_CONFFILE=/var/run/$WAN_IF/interface.conf
if [ -f $IF_CONFFILE ] ; then
chmod 777 $IF_CONFFILE
. $IF_CONFFILE
fi
#if/*TCSUPPORT_COMPILE*/ defined(TCSUPPORT_CT_WAN_CHILD_PREFIX)
PROFILE_CFG=/userfs/profile.cfg
if [ -f $PROFILE_CFG ] ; then
. $PROFILE_CFG
fi
if [ "$TCSUPPORT_CT_WAN_CHILD_PREFIX" != "" ] ;then
if [ "$ChildPrefixBits" != "" ] ; then
echo $ChildPrefixBits > /proc/sys/net/ipv6/conf/$WAN_IF/child_prefix
fi
if [ "$DHCPv6" = "Yes" ] ; then
echo 2 > /proc/sys/net/ipv6/conf/$WAN_IF/child_prefix_orign
elif [ "$DHCPv6" = "No" ] ; then
echo 1 > /proc/sys/net/ipv6/conf/$WAN_IF/child_prefix_orign
elif [ "$DHCPv6" = "N/A" ] ; then
echo 3 > /proc/sys/net/ipv6/conf/$WAN_IF/child_prefix_orign
else
echo 0 > /proc/sys/net/ipv6/conf/$WAN_IF/child_prefix_orign
fi
fi
#if/*TCSUPPORT_COMPILE*/ defined($TCSUPPORT_CT_PPPERRCODE_ENHANCE)
#Set IPv6CP flag
if [ "$TCSUPPORT_CT_PPPERRCODE_ENHANCE" != "" ]; then
echo "up" > /var/run/$WAN_IF/ipv6cp
fi
#endif/*TCSUPPORT_COMPILE*/
#endif/*TCSUPPORT_COMPILE*/
#Enable SLAAC mode
if [ "$DHCPv6" != "Yes" ]; then
echo 1 > /proc/sys/net/ipv6/conf/$WAN_IF/autoconf
fi
#Start up dhcp6c
/userfs/bin/dhcp6c -c /var/run/$WAN_IF/dhcp6c.conf -p /var/run/$WAN_IF/dhcp6c.pid -x /var/run/$WAN_IF/pd6 -X /var/run/$WAN_IF/orgpd6 -u /var/run/$WAN_IF/pd6_ptime -v /var/run/$WAN_IF/pd6_vtime $WAN_IF &