Route through openvpn based on source ip

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


Joined: 23 May 2012
Posts: 1

PostPosted: Wed May 23, 2012 9:13    Post subject: Route through openvpn based on source ip Reply with quote
Hello!

I have been setting up my home network lately, and almost everything is working perfect now.

Im using a wrt54gl with V24 SP1.

I have two subnets, 192.168.1.0/24 and 192.168.11.0/24.

192.168.11.0/24 is separated from the other subnets, it only has internet access, and everything is working fine. I have setup a port on the switch for vlan11, and attached vlan11 to the bridge br1 that is configured with ip 192.168.11.1.

I also have a openvpn connection to a server on the internet, and i can ping the servers vpn address (10.50.0.1) when the connection is up.

Now i want to route traffic from my subnet 192.168.11.0/24 through the vpn connection before it reaches the internet.

I have tried the following commands that i found on the internet:

Quote:
ip rule add from [source IP]/[netmask] table 200
ip route add default via [gateway] dev [interface] table 200
ip route flush cache

so for my network i ran:
Quote:
ip rule add from 192.168.11.0/24 table 200
ip route add default via 10.50.0.1 dev tap0 table 200
ip route flush cache


but all that happens is that the clients on that subnet loses the connection to the internet.

I have a tcpdump on the VPN server, and i cant see any traffic gets sent to it.

Im a network newbie, and i have already spent three days on trying to get this to work, and the girlfriend is starting to be annoyed of me just sitting infront of the computer when i come home from work Wink I need some help!

ANY tips would be greatly appreciated.

Thanks in advance
Sponsor
rnio
DD-WRT User


Joined: 21 Apr 2012
Posts: 94

PostPosted: Wed May 23, 2012 18:32    Post subject: Reply with quote
trying the same thing ... the QUESTIONS is if the DD-WRT kernel is compiled with the "IP: advanced router" and "IP: policy routing" features ?!

If you do loose connection than at least it does something. When I telnet into the router I can not get any of the IP commands show anything ... bringing up the question if the features are fully implemented.

Anyone knows ?
rnio
DD-WRT User


Joined: 21 Apr 2012
Posts: 94

PostPosted: Wed May 23, 2012 19:01    Post subject: Reply with quote
Lets work together ... look here:

Posted: Wed May 23, 2012 6:59 pm Post subject: Source policy routing problems ...


http://www.dd-wrt.com/phpBB2/viewtopic.php?t=155043
routvol
DD-WRT User


Joined: 02 Feb 2009
Posts: 87

PostPosted: Fri May 25, 2012 12:44    Post subject: Reply with quote
rnio wrote:
trying the same thing ... the QUESTIONS is if the DD-WRT kernel is compiled with the "IP: advanced router" and "IP: policy routing" features ?!

If you do loose connection than at least it does something. When I telnet into the router I can not get any of the IP commands show anything ... bringing up the question if the features are fully implemented.

Anyone knows ?


i asked myself the same question.
sometimes it works .. sometimes it doesn't .. i have yet to find out the reason.
which ip command do you use?
the one from /opt/.. or the one from /usr/..?

_________________
my dd-wrt configuration:
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=682296
rnio
DD-WRT User


Joined: 21 Apr 2012
Posts: 94

PostPosted: Fri May 25, 2012 15:13    Post subject: Reply with quote
See my answer here:

http://www.dd-wrt.com/phpBB2/viewtopic.php?t=155043

Try to consolidate all info in one place Smile
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT 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