Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Static-routes, openvpn, and squid
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Captain_Loser
Tux's lil' helper
Tux's lil' helper


Joined: 19 Mar 2003
Posts: 106

PostPosted: Tue Jan 21, 2014 12:10 am    Post subject: Static-routes, openvpn, and squid Reply with quote

I'm having a little trouble getting a static route to work.

I have an openvpn connection and my goal is to route only specific domains through the VPN while the remainder of my network traffic goes out my normal internet connection. I already run a squid proxy and am able to use the tcp_outgoing_address to make requests for the domains that I want to send through the VPN come from a single IP address. My question is, how do I build a static route to send a single IP address only through my VPN.

Right now, when I connect to my VPN all my traffic is diverted through the VPN. I can disable this functionality by using the nopull option in openvpn, but then no traffic goes through the VPN.

Better explanation of my end goal: I want all traffic originating from the IP 10.0.0.222 for example, to go through my VPN while the remainder of my internet traffic goes through my normal gateway and does NOT use the VPN. How do I setup a static route to achieve this, and how do I prevent the openVPN gateway from becoming the default route on the system?

Thanks
_________________
KHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN!!!!!!!
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Tue Jan 21, 2014 10:37 am    Post subject: Reply with quote

Perhaps something like this could do the trick?
route add -host 10.0.0.222 dev vpn0
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3696
Location: Dallas area

PostPosted: Tue Jan 21, 2014 1:08 pm    Post subject: Reply with quote

There's probably some hints for what you want to do here http://openvpn.net/index.php/open-source/documentation/howto.html

I've set up my openvpn to only start the tun interface, but not set up a default route.
I only use it for deluge and point to the tun interface.

Actually I've got two setups depending on how I call it, one does set up a default route, for everything and the other is as described above.

I set up a route up and down script and have the openvpn config file point to it for specific routing.
_________________
Asus m5a99fx, FX 8320 - nouveau & radeon, oss4
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
4.14.62 kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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