OpenVPN with Proxy

Hello everyone,

one thing in advance, I’m a greenhorn :wink:

I would like to use OpenVPN (on my smartphone) with the proxy on the IPfire, so that the set URL filter also works on the smartphone.

I already tried that, without success:

As described I added the line to/in the ovpn file.

Because I don’t have a public IP address, I use a dynamic DNS service.

Error messages.

Does anyone have any idea how I can fix it?

Thanks in advance!

Cheers,
Marco

I wish the OpenVPN documentation would be more clear about this business of proxy setting.

That document explains how to connect to an OpenVPN server that is operating behind a proxy server. What you want to do is different: you want to connect to your OpenVPN server (no proxy here) and once you become part of the network, to use the proxy that is (likely) running on the same machine.

This is pretty much dependent on the OpenVPN client and the operating system you are using. The standard way for OpenVPN server to communicate to the client the use of a proxy server when browsing the web, is to push the message by adding the following lines to /var/ipfire/ovpn/scripts/server.conf.local (you need first to check the box “Additional Configuration” in the Web User Interface):

push dhcp-option PROXY_HTTP proxy_ip 800
push dhcp-option PROXY_HTTPS proxy_ip 800

Or in alternative you can add the following lines in the .ovpn configuration file that will be imported by the client:

dhcp-option PROXY_HTTP proxy_ip 800
dhcp-option PROXY_HTTPS proxy_ip 800

However, it is up to the operating system and the OpenVPN client to honor the request. For mobile devices, iOS will oblige the request, but Android does not allow a OpenVPN client to change the network configuration, therefore you will need to configure the proxy in android WIFI or APN connection setting that you will use when connecting to the proxy with OpenVPN connect client.

The proxy ip is the local ip, e.g 192.168.1.1

See my tutorial for a complete configuration howto for mobile devices.

5 Likes

Hey,

thanks a lot for your answer.

Unfortunately, it somehow does not work for me.

If I add the following two lines to file /var/ipfire/ovpn/scripts/server.conf.local

push dhcp-option PROXY_HTTP proxy_ip 800
push dhcp-option PROXY_HTTPS proxy_ip 800

I cannot start OpenVPN at all.

The alternative, adding the following two lines to the .ovpn file

dhcp-option PROXY_HTTP proxy_ip 800
dhcp-option PROXY_HTTPS proxy_ip 800

generates this and these error messages:

I tried with UDP and TCP as well.

When I turn on proxy in APN settings on my android device with Graphene OS, internet works but proxy does not.

What am I doing wrong?

did you change proxy_ip with the ip address of your server, like 192.168.1.1? Also, did you remove the (wrong) proxy setting form OpenVPN connect?

First, you need to have a successful OpenVPN connection working fine without using the proxy, before you can work on the proxy use. The guide I linked in my previous post, for android has been tested with grapheneOS and it worked correctly in my tests.

1 Like

Yes, I have.

Without proxy everything works fine.

However, for the setting I only needed the following two files:
.p12
.ovpn

If it works, then you should only set the APN of the grapheneOS with the proxy server “192.168.4.1” or whatever is the OpenVPN address for the IPFire machine, as OpenVPN connect will not do it for you anyway.