Page 5 of 5

Re: Spilt Tunnelling and Policy Routing

Posted: Thu Jul 16, 2015 10:15 am
by crows
Do I still need to do this if I can do as per jpeg?

Image
TiTex wrote:then create the folders somehere else and change the path of the scripts

Re: Spilt Tunnelling and Policy Routing

Posted: Thu Jul 16, 2015 11:03 am
by crows
TiTex wrote:then create the folders somehere else and change the path of the scripts
Why is it when I execute these commands manually via telnet, they all execute with no errors there is a tmp/pia directory and an up.sh file in there, however when I browse my 192.168.0.109 machine is using ISP not VPN? however I i execute the same commands without echo and any directory reference it works.

mkdir -p /tmp/pia/

echo "#!/bin/sh" > /tmp/pia/up.sh
echo "iptables -t nat -I POSTROUTING -o tun1 -j MASQUERADE" >> /tmp/pia/up.sh
echo "ip route show table main | grep -Ev ^default | while read ROUTE ; do ip route add table 25 $ROUTE; done" >> /tmp/pia/up.sh
echo "gvip=$(ifconfig | grep -A 1 tun1 | grep inet | cut -d: -f3 | cut -d' ' -f1)" >> /tmp/pia/up.sh
echo "ip route add table 25 default via $gvip dev tun1" >> /tmp/pia/up.sh
echo "ip rule add from 192.168.0.109 table 25" >> /tmp/pia/up.sh
echo "ip rule add to 66.171.248.172 table main" >> /tmp/pia/up.sh
echo "ip route flush cache" >> /tmp/pia/up.sh

Re: Spilt Tunnelling and Policy Routing

Posted: Thu Jul 16, 2015 11:46 am
by crows
I'm sorry for all the posts, i cannot edit my posts...i understand what the script does, i.e creates the tmp directories and files within pia, up and down.sh. These files run manually but dont have any effect on the output. We know it works because i can execute them manually and it works.

I have also identified to execute scripts in my build you need this format ./up.sh

Re: Spilt Tunnelling and Policy Routing

Posted: Fri Jul 17, 2015 1:01 am
by crows
Is the most effective way to re-run scripts to use the cron command? I'm finding that my VPN provider drops connection once to twice a day making my rules inadequate.

I cant believe how much trouble this has been.

Re: Spilt Tunnelling and Policy Routing

Posted: Tue Jul 21, 2015 4:50 am
by crows
I just like to thank Eddie and Titex for helping me get this working. I am ever grateful for their help and patience and not giving up on me.

Thanks

Re: Spilt Tunnelling and Policy Routing

Posted: Tue Jul 21, 2015 7:37 am
by TiTex
i also learned a few things in the process , so you're welcome :)