Main question: How to route all traffic without vpn, and only specific domains or ips with vpn?
All traffic BYPASS VPN, and certain sites routed through vpn
Hello. I'm noob in all this vpn stuff, but I got reasons to use it, as some sites are not accessible directly, without vpn.
I setup openvpn server on my ovh dedicated machine (using simple script by nyr) and now using client for windows I can use openvpn with almost no problems. But, speed isn't always the best, with vpn download speed may be 2MB/s, but without 10-15MB/s, so I got reason to ask, how do I route only certain traffic through vpn?
There are a lot of discussions on how to route all with vpn, and specific site without, but my question of opposite, how to route all without vpn, and certain sites with? I want to do this by editing client-side config. I saw some people write it's possible, but everytime I try something, it doesn't connect at all.
Can someone provide few lines I need to add to config for this? Like
route blockedsite.com vpn
route alltraffic notvpn
P.S. Minor problem. When I disconnect from openvpn and try to connect next day it doesn't connect, so I have to restart server side with "sudo service openvpn restart", and then it works. I'm running xubuntu 14.04 on server.
How to use vpn for specific domains?
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 3
- Joined: Tue Jun 06, 2017 7:10 pm
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: How to use vpn for specific domains?
Sollembum78 wrote:All traffic BYPASS VPN, and certain sites routed through vpn
Like soSollembum78 wrote:Can someone provide few lines I need to add to config for this? Like
route blockedsite.com vpn
route alltraffic notvpn
- Remove all --redirect-gateway options from server and client
- Add routes for domain to use VPN either pushed from server or in client config
eg:orserverroute 10.11.12.0 255.255.255.0
push "route 10.11.12.0 255.255.255.0"serverroute 10.11.12.0 255.255.255.0clientroute 10.11.12.0 255.255.255.0
- clientroute my.domain.org
Please read the howto.
Please see:Sollembum78 wrote:P.S. Minor problem. When I disconnect from openvpn and try to connect next day it doesn't connect, so I have to restart server side with "sudo service openvpn restart", and then it works. I'm running xubuntu 14.04 on server.
HOWTO: Request Help !
-
- OpenVpn Newbie
- Posts: 3
- Joined: Tue Jun 06, 2017 7:10 pm
Re: How to use vpn for specific domains?
Hello, sorry for late response. What are exactly those numbers? I tried to write this:
route 10.11.12.0 255.255.255.0
On both client and server and when I use openvpn this way, it connects to nothing, sites don't open, only my vpn hosting is accesible. Is it suppose to be some exact number, or maybe ip of website I need to access or what? I believe 255.. is like, what network to use, and 10.11.. is what?
route 10.11.12.0 255.255.255.0
On both client and server and when I use openvpn this way, it connects to nothing, sites don't open, only my vpn hosting is accesible. Is it suppose to be some exact number, or maybe ip of website I need to access or what? I believe 255.. is like, what network to use, and 10.11.. is what?
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: How to use vpn for specific domains?
The numbers in my post are an example only !
I don't know what you want to route via the VPN so how would I know the numbers .. ?
I don't know what you want to route via the VPN so how would I know the numbers .. ?
-
- OpenVpn Newbie
- Posts: 3
- Joined: Tue Jun 06, 2017 7:10 pm
Re: How to use vpn for specific domains?
So, this numbers are ips of websites which I get from dns?TinCanTech wrote:The numbers in my post are an example only !
I don't know what you want to route via the VPN so how would I know the numbers .. ?