I have OpenVPN client configured and working with Witopia. I added the data in Services, VPN and added the following to the firewall: iptables -A POSTROUTING -t nat -o tun0 -j MASQUERADE
I want to allow certain IPs (192.168.1.105 in my script below) from my LAN to go through the VPN and the rest of the traffic to go through my ISP.
I read through the manuals and the posts and came up with the following startup script:
#!/bin/sh
sleep 120
PPTPSERVER=$(/usr/sbin/nvram get pptpd_client_srvip)
PPTPGWY=$(/usr/sbin/nvram get wan_gateway)
/sbin/route add -host $PPTPSERVER gw $PPTPGWY dev eth0
/sbin/route del default
/sbin/route add default gw $PPTPGWY metric 100
ip rule add from 192.168.1.105 table 200
/sbin/route add default dev tun0 table 200
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
What am I doing wrong here?
I think I have eth0, tun0, etc totally wrong so please advice as I'm confused.