OpenVPN behind HTTP PROXY Authenticate Successfully But Can’t Use Internet

networkingopenvpnPROXYsshvpn

Hey I want to figure out how openvpn can be used behind http proxy to direct all my traffic.

I was able to do it using other tech different than openvpn for TCP connections but UDP not . Before I did them:

1-I used redsocks smoothly to direct all tcp conenctions. But could't do it for UDP.
2- I used ssh dynamic tunneling and created a socks proxy. I used it with redsocks. But still couldnt do it for UDP.

So I considered using openvpn to get all my traffic and use internet for UDP and TCP behind dorm proxy.

I used http-proxy settings to use my dorm proxy once. It could be Authenticated and sequenced succesfully but couldn't use internet.

I used socks-proxy settings to use my ssh dynamic tunnel through dorm proxy. It could be Authenticated and sequenced succesfully but couldn't use internet, either.

I am forcing my openvpn to use TCP only because I know the restrictions about using udp with proxies.

I can use my openvpn server with cellphone internet smoothly but can't connect internet with dorm network.

It is my last week in my school and I never tried to do anything forbidden. I just want to know HOW in my last week. If you help, I appreciate you !

it is my client.ovpn's critic part.

remote amazon-ec2-ip 443 tcp
route amazon-ec2-ip 255.255.255.255 net_gateway 

dev tun
dev-type tun
http-proxy school-proxy-ip 3128 ntlm ntlm // it use ntlm auth. so I prepare ntlm file to auth it, it works dont worry.
http-proxy-timeout 5m
http-proxy-retry

allow-pull-fqdn
redirect-gateway def1

it is what openvpn says(only critic parts):

Thu Aug  5 11:12:22 2021 ROUTE_GATEWAY 10.10.120.1/255.255.248.0 IFACE=wlp5s0 HWADDR=MY_MAC_ADDRESS
Thu Aug  5 11:12:22 2021 TUN/TAP device tun0 opened
Thu Aug  5 11:12:22 2021 TUN/TAP TX queue length set to 100
Thu Aug  5 11:12:22 2021 /sbin/ip link set dev tun0 up mtu 1500
Thu Aug  5 11:12:22 2021 /sbin/ip addr add dev tun0 172.27.224.54/20 broadcast 172.27.239.255
Thu Aug  5 11:12:27 2021 ROUTE remote_host is NOT LOCAL
Thu Aug  5 11:12:27 2021 /sbin/ip route add SCHOOL-PROXY-IP/32 via 10.10.120.1
Thu Aug  5 11:12:27 2021 /sbin/ip route add 0.0.0.0/1 via 172.27.224.1
Thu Aug  5 11:12:27 2021 /sbin/ip route add 128.0.0.0/1 via 172.27.224.1
Thu Aug  5 11:12:27 2021 /sbin/ip route add AMAZON-EC2-IP**strong text**/32 metric 101 via 10.10.120.1
Thu Aug  5 11:12:27 2021 Initialization Sequence Completed

This is traceroute to 8.8.8.8

 1 172.27.224.1 (172.27.224.1)  57.290 ms  57.311 ms  57.314 ms
 2  54.93.0.97 (54.93.0.97)  94.617 ms 54.93.0.171 (54.93.0.171)  94.624 ms 54.93.0.169 (54.93.0.169)  60.720 ms
 3  100.65.17.96 (100.65.17.96)  94.636 ms 240.0.92.15 (240.0.92.15)  60.357 ms 100.65.17.0 (100.65.17.0)  94.598 ms
 4  240.0.92.18 (240.0.92.18)  60.371 ms 100.66.8.90 (100.66.8.90)  61.530 ms 100.66.8.86 (100.66.8.86)  94.482 ms
 5  100.66.10.164 (100.66.10.164)  64.702 ms 100.66.10.34 (100.66.10.34)  65.567 ms 242.1.92.97 (242.1.92.97)  60.323 ms
 6  100.95.4.5 (100.95.4.5)  60.569 ms 240.0.92.3 (240.0.92.3)  44.600 ms 100.95.20.5 (100.95.20.5)  44.854 ms
 7  100.100.2.100 (100.100.2.100)  44.514 ms 100.100.4.96 (100.100.4.96)  44.780 ms 240.0.92.29 (240.0.92.29)  48.207 ms
 8  242.1.92.241 (242.1.92.241)  44.622 ms 142.250.166.10 (142.250.166.10)  82.156 ms 142.250.166.96 (142.250.166.96)  82.126 ms
 9  100.95.4.5 (100.95.4.5)  48.917 ms 100.95.4.7 (100.95.4.7)  48.893 ms 100.95.20.8 (100.95.20.8)  48.769 ms
10  8.8.8.8 (8.8.8.8)  48.160 ms 100.100.4.96 (100.100.4.96)  48.705 ms 100.100.6.8 (100.100.6.8)  48.077 ms

EDIT :
I use same client.ovpn file with Windows 10 ruther than Linux Mint. I works smoothly in Windows 10. I am totally sure, as you see in davidgo'comments, it is about linux dns configuration. I can't override openvpn dns settings to my local network settings. Do you know how can I do that ?

Best Answer

I worked it out !! DNS works different between linux and windows.In windows, when our vpn server push dns settings to the tun0 interface(which openvpn creates) it works !

you can set different DNS server ip for different adaptor in windows. But in linux, you can use only single DNS server for every adaptor.

You use whatever writed in etc/resolve.conf in linux as a DNS server(example nameservers DORM_DNS_SERVER_IP).

So you need to override NetworkManager.It could be possible by means of 3 method. There is no alternative to achive it:

1- Install openresolv(download it for your linux.).

2- edit /etc/resolveconf.conf(add nameservers DNS_IP_YOU_WANT)

3-edit client.ovpn (add this 2 line up up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf)

3.directive makes new resolve.conf using openresolve app and resolveconf.conf file automatically. OpenVPN linux client capable of using openresolve with openvpn build-in */etc/openvpn/update-resolv-conf script

If /etc/openvpn/update-resolv-conf doesnt exists, find in internet and paste them in that directory.

So it works !!!

I am shocked because nobody told it anywhere before in internet.

Thanks to @davidgo

Related Question