[Solved] Proxying through OpenVPN interface

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
nogaff
OpenVpn Newbie
Posts: 2
Joined: Thu May 09, 2019 2:05 pm

[Solved] Proxying through OpenVPN interface

Post by nogaff » Thu May 09, 2019 3:11 pm

I'm trying to achieve something which is possibly a little unusual.

I've got the OpenVPN client connecting to a 3rd-party VPN but I don't want all my traffic forced through the VPN, so I'm using the pull-filter ignore "redirect-gateway" directive in my client config. That works fine.

The unusual part is, I want to set up a local Squid proxy, using its tcp_outgoing_address directive to force all proxied traffic through the VPN interface. That way I can selectively route specific applications through the VPN by configuring them to use the the proxy.

The Squid proxy itself works fine, but the proxied traffic only gets through the VPN to its destination if I remove the pull-filter ignore "redirect-gateway" from my OpenVPN client config. Therefore, I think I must be missing something in my OpenVPN client config to properly route the proxied traffic.

Any suggestions what that could be?
Last edited by nogaff on Fri May 10, 2019 10:52 am, edited 1 time in total.

nogaff
OpenVpn Newbie
Posts: 2
Joined: Thu May 09, 2019 2:05 pm

Re: Proxying through OpenVPN interface

Post by nogaff » Fri May 10, 2019 12:16 am

Nevermind, I figured it out myself!

It was simply a case of adding route 0.0.0.0 0.0.0.0 vpn_gateway to my client config. What I've actually ended up doing is putting the following in my config:

Client Config

pull-filter ignore "redirect-gateway"
route 0.0.0.0 0.0.0.0 vpn_gateway
script-security 2
up "C:\\Path\\To\\UpScript"
down "C:\\Path\\To\\DownScript"

Where the up script simply updates the tcp_outgoing_address in my Squid.conf then starts the Squid service, and the down script just stops the Squid service again.

All working perfectly now. I've also configured the "Proxy SwitchyOmega" extension for Chrome to automatically use the Squid proxy for certain websites.

Post Reply