K
K
Kwad2021-02-07 22:02:45
openvpn
Kwad, 2021-02-07 22:02:45

How to force OpenVPN to use a proxy?

Good evening, I have a VPN server on Ubuntu 20.10, everything is up by auto script ( https://github.com/angristan/openvpn-install ) - works great! For a regular VPN, I used this particular script for more than two years. Now there is a need to force the VPN server to drive traffic through my HTTP proxies (I can SOCKS5), and so, I found something in Google, entered my proxy - but the VPN stopped hiding IP, there is just a tunnel, I returned the config to the second version - the same as regular VPN, no proxy IP at the output.

server.conf
port 1111
proto tcp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 1.0.0.1"
push "dhcp-option DNS 1.1.1.1"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key
crl-verify crl.pem
ca ca.crt
cert server_x6KXQxl2PFzX74qe.crt
key server_x6KXQxl2PFzX74qe.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
verb 3


server.conf - with proxy option
port 1111
proto tcp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 1.0.0.1"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option PROXY_HTTP 82.xxx.xxx.xxx 3251"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key
crl-verify crl.pem
ca ca.crt
cert server_x6KXQxl2PFzX74qe.crt
key server_x6KXQxl2PFzX74qe.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
verb 3

xxx - I commented out the ip because I don't want to leak my proxies to the public :)

Who can help me configure OpenVPN to work through a proxy?

There are many questions, I will be glad who will help solve other additional problems with VPN not for free in tg - @makf1n

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nicholas, 2021-02-08
@romancelover

https://forums.openvpn.net/viewtopic.php?t=15299
there was already such a question.
what you can try:
1) add HTTPS_PROXY in addition to HTTP_PROXY
2) make a transparent proxy on the VPN server side via iptables
3) set the proxy in the settings on the client side

T
toxa189, 2021-05-30
@toxa189

in the client config, write the local IP and http-proxy ip port # of your proxy
, you can also set http-proxy-option....if necessary

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question