What's new

Tutorial OpenVPN over stunnel with Web Interface in B315

Status
Not open for further replies.
Zain otg 2019 stable . Walang bug yung update ni sir jerome laliag .
585452
 

Attachments

Boss jeromelaliagg eto suggestion ko na ADD on. Instead na auto 10.x.x.x sana LIVE IP HUNTER nalang po. Para pwede sa ibang network at config.

585494


Tested ko na po yan napaka gandang feature.
Kinalikot ko ng onti script nyo ipscan.cgi

Code:
#!/system/bin/busybox sh

# Script Created by Jerome Laliag <jeromelaliag@yahoo.com>

echo Content-type: text/html
echo
while true
do
VPNIP=`ifconfig tun0 | grep "inet addr:" | busybox cut -d: -f2 | busybox awk '{print $1}'`
IPADDRESS=`ip addr show wan0 2> /dev/null | grep inet | busybox awk '{print $4}'`
if [ -n "$VPNIP" ]; then
echo "Your OVPN is CONNECTED"
exit 0
else

#Stop VPN
iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o wan0 -j MASQUERADE
findovpn=`ps | grep openvpn-cli`
if [ -n "$findovpn" ]; then
busybox pkill openvpn-cli
rm /tmp/openvpn.log
STKILL=`cat /tmp/stabler.pid`
busybox kill -9 $STKILL
cat /tmp/stabler2.pid | while read LINE; do
busybox kill -9 $LINE
done
rm /tmp/stabler.pid
rm /tmp/stabler2.pid
echo Disconnected.
else
STKILL=`cat /tmp/stabler.pid`
busyboxx kill -9 $STKILL
cat /tmp/stabler2.pid | while read LINE; do
busyboxx kill -9 $LINE
done
rm /tmp/stabler.pid
rm /tmp/stabler2.pid
echo OpenVPN is not running.
fi

sleep 10
#Disconnect Connect
atc AT+CFUN=0 > /dev/null
atc AT+CFUN=1 > /dev/null

#Start VPN
procss=`ps | grep openvpn-cli`
if [ -n "$procss" ]; then
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
echo Already running.
else
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
check=`cat /online/pass.txt | busybox sed -n '1p;2p'`
if [ -n "$check" ]; then
sleep 0
else
rm /online/pass.txt
echo none >> /online/pass.txt
echo none >> /online/pass.txt
fi
find=`find /online -name *.ovpn`
if [ -n "$find" ]; then
/system/bin/openvpn /online/config.ovpn &
else
echo Please upload OVPN Config first.
fi
fi


fi
sleep 15
done
 

Attachments

yup, using SUN sim with TU50 wa epek ang auto start-up

using GLOBE sim with GOSURF50(may mb pa na data) SWAK si auto start-up

iisang 936 modem lang ang nilagyan ko

Huawie reloaded final 2019... using tu50, 150, 200 tested yan gumagana yung start up niya. Kaya pag on pa lang ng modem automatic kumokonek ang vpn. No need na manual setup sa date & time.
 
Huawie reloaded final 2019... using tu50, 150, 200 tested yan gumagana yung start up niya. Kaya pag on pa lang ng modem automatic kumokonek ang vpn. No need na manual setup sa date & time.
na try ko na din reload 2019 pati zain go 2019, wa epek using TU50
 
Status
Not open for further replies.
Back
Top