0

I have OpenVPN server with clients with static IPs (192.168.1.0/24). When I access another device connected to VPN I get desired 192.168.1.2 static IP, however when I access proxy server on same machine via DNS I get my machine real IP without VPN. Simpler: I connect my laptop to VPN at example.com, I try access sub.example.com and from sub.example.com I see not my VPN static IP, but my real IP (provided by ISP). How to fix that so I see my VPN static IP from that subdomain site?

Here is my openvpn.conf:

server 192.168.1.0 255.255.255.0
verb 3
key /etc/openvpn/pki/private/...
ca /etc/openvpn/pki/ca.crt
cert /etc/openvpn/pki/issued/...
dh /etc/openvpn/pki/dh.pem
tls-auth /etc/openvpn/pki/ta.key
key-direction 0
keepalive 10 60
persist-key
persist-tun
client-to-client
client-config-dir ccd
topology subnet
proto udp
port 22
dev tun0
status /tmp/openvpn-status.log
user nobody
group nogroup
comp-lzo no

route 192.168.0.0 255.255.0.0
route 10.0.0.0 255.0.0.0
route 172.16.0.0 255.240.0.0

push "topology subnet"
push "comp-lzo no"
push "dhcp-option DNS 10.1.0.3"
push "route 10.0.0.0 255.0.0.0"
push "route 192.168.0.0 255.255.0.0"
push "route 172.16.0.0 255.240.0.0"

1 Answers1

0

Solved by configuring my DNS server to route desired query to local proxy address, e.g. 10.1.0.2 sub.domain.com, this makes it so requested traffic goes to local server via VPN's local ip, so my proxy thinks it is being accessed from 10.1.0.4 - ip of VPN server. FYI it can also be done by modifying hosts file on your machine, too.