Partitial traffic routing via PPTP/OpenVPN

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


Joined: 29 May 2017
Posts: 3
Location: Dnepropetrovsk, Ukraine

PostPosted: Mon May 29, 2017 7:12    Post subject: Partitial traffic routing via PPTP/OpenVPN Reply with quote
Hello everyone!

I'm a new to dd-wrt. Recently upgraded my TP-Link TL-WR1043ND to a latest dd-wrt firmware with some reason. I need to route traffic to special resources (networks) on Internet via PPTP or OpenVPN, but other common traffic needs to be routed via default gateway of my ISP. What should I do?
I have already set up a PPTP connection to some VPN server, so I have some intranet address and gateway from this service. But I don't know how to route traffic for xxx.xxx.xxx.xxx/xx like networks via this VPN connection.

So please help me with any advice. Thank you.
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Mon May 29, 2017 9:42    Post subject: Reply with quote
http://www.dd-wrt.com/wiki/index.php/Policy_Based_Routing

You can enter Policy Based Routes directly in the GUI for OpenVPN.
Novo1981
DD-WRT Novice


Joined: 29 May 2017
Posts: 3
Location: Dnepropetrovsk, Ukraine

PostPosted: Mon May 29, 2017 11:50    Post subject: Reply with quote
O.k. Thank you. But maybe I didn't give enough information. So I will try to explain what I need...
All the clients (all of my domestic network without any expetions) of my router (wired or wi-fi) must go via default ISP gateway but if destination address equals some criteria (for example 95.142.200.0/24) the router must inject these packets into the tunnel (PPTP or OpenVPN).
If my router were Cisco this should be seen like:
Code:
enable
configure terminal
ip route 0.0.0.0 0.0.0.0 <isp_gateway_ip_address>
ip route 95.142.200.0 255.255.255.0 Tunnel0
end

So it is not a source based routing but some kind of destination one. I don't know how to say right. Rolling Eyes
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6868
Location: Romerike, Norway

PostPosted: Mon May 29, 2017 12:28    Post subject: Reply with quote
Routes are entered the same way.

For OpenVPN, the push-route directive in the configuration file will push routes to the client.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Mon May 29, 2017 13:19    Post subject: Reply with quote
In the additional config field of the openVPN client,
First you add:
Code:
route-noexec

This wil prevent the use of the VPN as default

Next add something like:
Code:
route 208.64.38.55 255.255.255.255 vpn_gateway  #whatsmyip.org

This will redirect trafic for that IP address through the VPN

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Novo1981
DD-WRT Novice


Joined: 29 May 2017
Posts: 3
Location: Dnepropetrovsk, Ukraine

PostPosted: Mon May 29, 2017 13:39    Post subject: Reply with quote
And if I use PPTP will my actions be the same? Cause PPTP configuration is different to PPTPs one.
And where should I eneter that route string? SSH session? Is that dd-wrt syntax of command?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Mon May 29, 2017 13:54    Post subject: Reply with quote
Use OpenVPN if possible it is more safe and easier.
With PPTP you have to use a script see: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=307422&postdays=0&postorder=asc&start=0

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
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