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/script/dslite_start.sh
2024-07-22 01:58:46 -03:00

23 lines
722 B
Bash
Executable File

#!/bin/sh
#To build dslite tunnel
#Usage:./dslite_start.sh local_wan_ipv6_address tunnel_ipv6_address wan_if_name
if [ $# != 3 ] ; then
echo "usage: $0 local_wan_ipv6_address remote_tunnel_ipv6_address wan_if_name"
exit 0
fi
LOCAL_ADDR=$1
REMOTE_ADDR=$2
WAN_IF=$3
DSLITE_NAME=ds.$WAN_IF
/usr/bin/ip -6 tunnel del $DSLITE_NAME
/usr/bin/ip -6 tunnel add $DSLITE_NAME mode ipip6 local $LOCAL_ADDR remote $REMOTE_ADDR encaplimit none
/usr/bin/ip link set up $DSLITE_NAME
echo 1 > /var/run/$WAN_IF/dslite_on
/usr/bin/iptables -D FORWARD -o $DSLITE_NAME -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
/usr/bin/iptables -A FORWARD -o $DSLITE_NAME -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu