Skip to content

Commit c11612b

Browse files
committed
Add debug to routes.sh. #98
1 parent b9d4c39 commit c11612b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bin/routes.sh

100755100644
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ if [[ ${STATE} = "up" ]]; then
1919
echo ${PRIMARY_IFACE} > /home/${USER}/.meile-gui/iface
2020

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

@@ -32,14 +33,22 @@ if [[ ${STATE} = "up" ]]; then
3233
TUNID=${RANDOM}
3334
TUNIFACE="tun"${TUNID}
3435
echo ${TUNIFACE} > /home/${USER}/.meile-gui/tuniface
36+
echo "Adding tun interface..."
37+
echo "ip tuntap add mode tun dev ${TUNIFACE}"
3538
ip tuntap add mode tun dev ${TUNIFACE}
39+
echo "ip addr add 10.10.10.10/24 dev ${TUNIFACE}"
3640
ip addr add 10.10.10.10/24 dev ${TUNIFACE}
41+
echo "ip link set dev ${TUNIFACE} up"
3742
ip link set dev ${TUNIFACE} up
3843

3944
# add default route for tun
45+
echo "Adding default route for tun..."
46+
echo "ip route add default via 10.10.10.10 dev ${TUNIFACE} metric 1"
4047
ip route add default via 10.10.10.10 dev ${TUNIFACE} metric 1
4148

4249
# add normal route for proxy IP
50+
echo "Add normal route for proxy..."
51+
echo "ip route add ${PROXY_IP} via ${GATEWAY}"
4352
ip route add ${PROXY_IP} via ${GATEWAY}
4453

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

5160
# start tun2socks
61+
echo "Starting tun2socks..."
5262
/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
5363

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

0 commit comments

Comments
 (0)