OpenVPN policy based routing help

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking
Author Message
znegotiator
DD-WRT Novice


Joined: 22 Dec 2010
Posts: 7

PostPosted: Thu Dec 23, 2010 17:46    Post subject: OpenVPN policy based routing help Reply with quote
Hi There,
My setup is as follows:

Buffalo WZR-HP-G300NH
DD-WRT v24-sp2 (08/07/10) std - build 14896

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.

Thanks!
Sponsor
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17638
Location: Hesse/Germany

PostPosted: Thu Jul 28, 2011 17:14    Post subject: Reply with quote
tun0 is the server not the client in ddwrt
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum