Skip to content

Commit

Permalink
Add debug to routes.sh. #98
Browse files Browse the repository at this point in the history
  • Loading branch information
freQniK committed May 9, 2024
1 parent b9d4c39 commit c11612b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bin/routes.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if [[ ${STATE} = "up" ]]; then
echo ${PRIMARY_IFACE} > /home/${USER}/.meile-gui/iface

# start v2ray
echo "Running v2ray: /home/${USER}/.meile-gui/bin/v2ray run -c /home/${USER}/.sentinelcli/v2ray_config.json &"
/home/${USER}/.meile-gui/bin/v2ray run -c /home/${USER}/.sentinelcli/v2ray_config.json &
sleep 3

Expand All @@ -32,14 +33,22 @@ if [[ ${STATE} = "up" ]]; then
TUNID=${RANDOM}
TUNIFACE="tun"${TUNID}
echo ${TUNIFACE} > /home/${USER}/.meile-gui/tuniface
echo "Adding tun interface..."
echo "ip tuntap add mode tun dev ${TUNIFACE}"
ip tuntap add mode tun dev ${TUNIFACE}
echo "ip addr add 10.10.10.10/24 dev ${TUNIFACE}"
ip addr add 10.10.10.10/24 dev ${TUNIFACE}
echo "ip link set dev ${TUNIFACE} up"
ip link set dev ${TUNIFACE} up

# add default route for tun
echo "Adding default route for tun..."
echo "ip route add default via 10.10.10.10 dev ${TUNIFACE} metric 1"
ip route add default via 10.10.10.10 dev ${TUNIFACE} metric 1

# add normal route for proxy IP
echo "Add normal route for proxy..."
echo "ip route add ${PROXY_IP} via ${GATEWAY}"
ip route add ${PROXY_IP} via ${GATEWAY}

#sysctl net.ipv4.conf.all.rp_filter=0
Expand All @@ -49,6 +58,7 @@ if [[ ${STATE} = "up" ]]; then
#sysctl net.ipv4.conf.${PRIMARY_IFACE}.forwarding=1

# start tun2socks
echo "Starting tun2socks..."
/home/${USER}/.meile-gui/bin/tun2socks -device tun://${TUNIFACE} -proxy socks5://127.0.0.1:1080 -interface ${PRIMARY_IFACE} -mtu 1500 -tcp-sndbuf 1024k -tcp-rcvbuf 1024k -tcp-auto-tuning

#tun2socks -device tun0 -proxy socks5://127.0.0.1:1080 -interface ${PRIMARY_IFACE} -loglevel debug &
Expand Down

0 comments on commit c11612b

Please sign in to comment.