Connect to openvpn server but use local interface to browse internet on Windows client

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
desma
OpenVpn Newbie
Posts: 2
Joined: Thu Oct 20, 2022 3:28 pm

Connect to openvpn server but use local interface to browse internet on Windows client

Post by desma » Fri Oct 21, 2022 3:45 pm

Hello, I have this situation, I have a

Windows Server 2012 r2 running openvpn server

and 2 client computers

1- Windows 7
2- Linux Ubuntu 20.04

I would like to connect them to my openvpn server for sharing files but not for internet browsing.

On the Linux clent after connects to openvpn I can ping my server on 10.7.0.1 but I can also browse internet, my ip is the one assigned by my ISP, not the server public ip, which is what I want.

The Windows 7 client instead (tested also on a Windows 10 pc) after connecting to my vpn can't browse internet, despite the lan network interface says "Internet access"

Does anyone have some experience on this? How can I solve? I'm asking becouse I did not find clear answers atlist for me. I tried to add client option "route-nopull" but did not help.

The following are the options in the configs:

Server Config
port 1194
proto udp4
dev tun
topology subnet
server 10.7.0.0 255.255.255.0
keepalive 10 120
persist-key
persist-tun
verb 3
explicit-exit-notify 1


client, both linux and windows clients with same options

client
dev tun
proto udp4
remote xxx.xxx-xxx-xxx 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
# don't push internet traffic to vpn
# route-nopull
verb 3
key-direction 1
Last edited by desma on Fri Oct 21, 2022 8:38 pm, edited 1 time in total.

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: Connect to openvpn server but use local interface to browse internet on Windows client

Post by openvpn_inc » Fri Oct 21, 2022 4:21 pm

Hello,

I haven't looked at the entire config yet, but, I notice you don't want to redirect Internet, and you're not pushing DNS. That makes sense, but then why are you implementing this rule to block outside DNS? That might lead to a non-working DNS situation, and you're not doing anything with DNS anyway.

> setenv opt block-outside-dns # Prevent Windows 10 DNS leak

On your Windows 7 client you might want to do things like 'ping 8.8.8.8' and 'ping google.com' and see what happens. If the first one works but the second fails, your Internet is working, but your DNS is broken. Perhaps related to that setting I mentioned.

Good luck,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

desma
OpenVpn Newbie
Posts: 2
Joined: Thu Oct 20, 2022 3:28 pm

Re: Connect to openvpn server but use local interface to browse internet on Windows client

Post by desma » Sat Oct 22, 2022 6:42 pm

openvpn_inc wrote:
Fri Oct 21, 2022 4:21 pm
why are you implementing this rule to block outside DNS? That might lead to a non-working DNS situation
> setenv opt block-outside-dns # Prevent Windows 10 DNS leak
Thank you for your help, removing that options solved my problem!

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: Connect to openvpn server but use local interface to browse internet on Windows client

Post by openvpn_inc » Sun Oct 23, 2022 1:25 pm

Hello desma,

Glad to hear my first hunch worked.

Kind regards,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

Post Reply