Can't trust any VPN these days
blog.orhun.dev
blog.orhun.dev
DNS leaks are easy to miss.
A VPN (in this context) is hardly a VPN if it doesn't traffic dns requests, and it's probably the false advertising by the "you need a vpn to securely access the internet" companies that misinformed OP what type of VPN they were setting up.
The title should be more like "can't trust not reading the manual these days", or "can't trust sane defaults"
Quoting key points from TFA:
- (DNS leak happens)
- The DNS changes are not automatically applied by the OpenVPN client on Linux.
- You need to configure up and down scripts for managing the DNS updates.
- The recommended script is update-resolv-conf, which modifies DNS settings when the VPN connects and restores them upon disconnection.
- That script consists of a bunch of arcane bash commands that I don't understand.
Iow, OpenVPN decided to not mess with system scripting.
For Linux, the OpenVPN client can receive DNS host information from the server, but the client expects an external command to act on this information. No such commands are configured by default. They must be specified with the up and down options. There are a few alternatives for what scripts to use, but none are officially recognised by OpenVPN, so in order for any of them to work, script-security must be set to 2. The down-root plugin can be used instead of the down option if running as an unprivileged user.
Otoh, it could at least signal that somehow in the ui/cli. Does it not? I’m pretty sure there’s no dns leaks on my kubuntu boxes with ovpn profiles, but can’t test right now. If so, it’s probably an even narrower Arch + network manager problem.
They have two options: a) use the mouse-friendly way in NetworkManager to configure their VPN client (yes, it handles VPN DNS too; if you have systemd-resolved, it can also do split-horizon DNS over specific links) or b) funble around with tools and scripts they have no idea how they work, complain how complicated it is, and either get lucky so it works somehow or break their system entirely.
With a current desktop linux system, they should take the option a). They can use command line if they insist, nmcli is also here.
OP could have solved their problem by rtfming... It is literally the first paragraph on DNS. We're talking about "turn it off and on again" style issues.
Before you reach for GPT, check the man pages and check the Arch wiki, you'll save a lot of time and get more information.
Anyway, NetworkManager can be managed using cli for those that insist, so all that was needed was:
nmcli connection import type openvpn file <filename.ovpn>
Even Arch wiki says:> By default networkmanager-openvpn plugin appends DNS servers provided by OpenVPN to /etc/resolv.conf.
(which is not really true. Yes, it does the right thing with DNS info, but the specific action depends on the resolver backend NetworkManager is configured to use; for systemd-resolved and dnsmasq it configures these services instead).
> Arch wiki
It looks like their solution was following the config in 9.3. So this is why I made a snipe at reaching for GPT when the Wiki is there.[0] The analogy I'll give is that often a novice works harder than an expert when doing the same task, even if the task is simple. This is often because the expert is doing very minute things that they might not even notice that they can leverage. I know coders rock climb, so I'll use that as an example: this may be something like a subtle finger placement or how center of gravity is placed. The practiced person has more strength, but they will literally use less energy to get up a wall than a novice (and then it can be easy to overestimate what a novice can do because they judge what energy they use)
It makes sense if UDP is blocked, but in this case OP is clearly using UDP for OpenVPN.
Idk about wg, but ovpn ticks all these boxes.
Mobile users simply scan a QR code and are good to go.
My relative has an android device that can’t run ovpn but may work with this.
And then there are many different solutions built on top of Wireguard, like Tailscale, which simplify some other aspects of setting up tunnels.
I don't have access to that VPS anymore, but I was already using Wireguard but had to use OpenVPN here, so I can't tell you if this is still a widespread problem or a historical curiosity.
Also sometimes, especially cross-organization, the chance that OpenVPN is already in use is much higher (if they're not doing Open/StrongSWAN anyway).
Depending on the ISP setup, sometimes WG can be less reliable due to MTU and/or UDP filtering, I remember an ISP from years ago where WG don't work only on certain hours, while OpenVPN running on the same server still work.
Changing the MTU for Wireguard to 1280 usually helps a lot with reliability and throughput.
Wireguard is good for places like Europe and North America. But if in Mainland China, Russia, Iran and countries like that, you need use OpenVPN.
Not sure why Wireguard would be less useful in the mentioned countries, but I guess it is because of blocking of UDP traffic? And as far as I know, China and Russia does not block UDP traffic.
Previously HN discussion: https://news.ycombinator.com/item?id=39067213
I would expect my laptop to use my local DNS server if the VPN is up. My local DNS server is the one I have on my home network. The rest of my traffic, I would expect to go through the VPN tunnel.
Problem of course is that VPNs used to be expert-level stuff. This kind of "avoid government blocks" use of VPN wasn't even common when I started fiddling with OpenVPN around 2001/2002.
No, a correct configured VPN-tunnel is tunneling all data from one point to another (zero exceptions) if vpn is de-connected no data should be transferred (aka interface down).
If you want something else work with per-application proxy's.
>Problem of course is that VPNs used to be expert-level stuff.
And it still should be that way, VPN's where made so you can securely work inside your enterprise/home network while sitting anywhere in the world, all services are provided from local servers and if external, go through the enterprise-firewall (traffic-audit, IDS, and maybe other VPN-tunnels to other external locations subnet's etc).
>VPN's where made so you can securely work inside your enterprise network
Discord.com is not your enterprise network.
Ok?
This does not seem to agree what you previously said: "VPN's where made so you can securely work inside your enterprise network"
If you're connecting to the internet, route to the internet. If you're connecting to "inside your enterprise network", route through the VPN.
>EnterpriseFirewall HTTPS
If you're talking about forced https interception, then it sounds like an excellent way to make something secure (https) insecure.
Block-lists, traffic-audit/amount, not allowed ports, protocol/packet inspection, mail-scanning and archival (aka have a hint how in-house data leaves your corporation)...enterprise stuff, you can do that on the endpoint, inside your "server-farm", or both, most enterprises distrust endpoints (for good reason), and completely trust the internal infrastructure (for often not so good reasons).
I know we are in that HN bubble but ~97% of enterprise don't work in IT but need lots of it.
>If you're talking about forced https interception,
No i don't, but some company's absolutely want that (sometimes for good reasons)
But you can also argue that an endpoint-firewall is just allowed to connect to one external ip (VPN-gateway) is also not a bad thing.
If you ever work for something critical (Financial/Defend/Insurance) you see 1000 points for securing/restricting the traffic (especially port 80/443) of endpoints and one for the opposite (that grumpy dev/ceo who wants admin right on his laptop and wants to use it "privately" too...btw even worse with smartphones).
I use wireguard to access my home network while I’m not at home for instance. I have homelab stuff at *.lan.mydomain.example, and in my ideal world, my iPhone would only connect on-demand when I try to connect to something in that domain. (Currently you can only configure connect-on-demand per IP prefix in the iOS wireguard app, even though iOS NetworkExtension.framework allows domain-based configuration… I should send the author a patch some day…)
Point is, I don’t think of VPNs as something that prevents anyone from seeing my traffic. I use it to get access to stuff that is normally behind a firewall, and a split-tunnel VPN that only sends the minimum amount of traffic over the tunnel is what I want.
This idea of VPNs as privacy tools is the much newer use case that wasn’t really the point when they were originally conceived.
Sorry but no you don't, since you call into your LAN-network of course you can see your local machines.
But if you sit in a LAN and you call outside there should be no traffic leaked to the local network your calling out from (for example airport/motel etc).
>Point is, I don’t think of VPNs as something that prevents anyone from seeing my traffic
Correct, every middleman (normally ISP) can see that you connect from your External-IP to the other External-IP over an encrypted tunnel (udp or tcp). The expression 'vpn' i nearly as muddled as cloud ;)
If you want to obfuscate your traffic you need something like tor/i2p, however it's also possible to tunnel your vpn-tunnel through tor-tunnel's (but i don't see much sense in that since exit-nodes are for sure under more observation and publicly known)
Tor and vpn traffic can be detected and blocked (for example Chinese firewall) and for that, shadowsocks can be a solution:
Yes, I really do.
I specifically want my traffic to “leak” from my VPN when traveling away from home, because my home internet upload speed is slow and I don’t want it to bottleneck everything else on my device. I only want the tunnel to be used when I am talking to my LAN.
Similarly when I’m at home and using my work VPN, I want a split tunnel there too. I don’t want every bit of traffic going over the VPN tunnel, because my work network tends to have congestion, and if I’m streaming music or something to listen to, there’s no reason that should have to go throufh my work’s network.
Before saying “nuh uh!” every time someone disagrees with you, maybe stop and consider that people have different use cases from you?
No you don't, you need a normal (for example) ssh-tunnel, not a "VPN"...trust me ;)
>Before saying “nuh uh!” every time someone disagrees with you, maybe stop and consider that people have different use cases from you?
You want to actively weakening a system that was made for one thing only (a point to point encrypted tunnel with no exceptions of data flow), but hey go on and make your setup a cobbled mess, but don't cry about leaked information.
Yes I do. (See how tiring this is getting?)
I don’t want an SSH tunnel when wireguard does the same thing but faster and with an iOS app that works correctly out of the box. I’m aware of SSH tunnels and that’s how I used to do things back in 2008 but times have changed and wireguard is infinitely better at that use case.
> You want to actively weakening a system that was made for one thing only (a point to point encrypted tunnel with no exceptions of data flow), but hey go on and make your setup a cobbled mess, but don't cry about leaked information.
Nobody’s talking about weakening anything here, you’re coming into a conversation where someone said “use cases differ”, and you’re trying to deny that reality… every time someone shows you a different use case you childishly shout “nuh uh” and act like such a use case is wrong because it invalidates your point.
A split tunnel VPN is a valid use case, period. It’s not the only use case. People who want full tunnel where all traffic goes through the tunnel, ALSO have a valid use case. But it doesn’t mean split tunnel is not a thing, and it doesn’t mean people who want split tunnels are wrong.
even if you want local control of the dns server, i would still set up the dns server to retreive its data via the ssh tunnel (via standard port forwarding) as well.
1) enable port forwarding in your sshd config (implies you can't just do this on a server which you don't admin and which has this disabled)
2) point bitvise's socks5 proxy server feature at the ssh server
3) point anything that needs to be tunneled at the bitvise client's port (default 1080) e.g. firefox > about:preferences > Network Settings (at bottom) > Manual proxy configuration > SOCKS v5 (enter details and your password if you set it up in bitvise) > also check "Proxy DNS when using SOCKS v5" at bottom
4) voila, packets leave and return via the ssh server's public IP.
5) For stubborn apps, check their config files, or use tsocks
6) make a chain of ssh port forwarding.
7) make a script that randomizes the ssh port forwarding chain.
DNS isn't authenticated.
>Okay, at that point I was clueless. I tried changing the DNS settings of OpenVPN (i.e. dhcp-option DNS 1.1.1.1) but it didn't work. After a couple of iterations with ChatGPT, it finally led me to the correct path.
> The OpenVPN server can push DHCP options such as DNS and WINS server addresses to clients (some caveats to be aware of). Windows clients can accept pushed DHCP options natively, while non-Windows clients can accept them by using a client-side up script which parses the foreign_option_n environmental variable list.
It's still not clear to me what the experience would have been if the author had only 1.1.1.1 set at the system level, not touching any OpenVPN options.
If it can be done at a home network level, you bet it can be done at ISP/government level.
The only safe/working option is to tunnel everything down a VPN somewhere outside of the problem region, and go out from there. The VPN connection implicitly provides a cryptographic verification that the connection isn't being intercepted or redirected (when done right).
EDIT to clarify because i feel many might not be aware how easy it is: 1) enable port forwarding in your sshd config (implies you can't just do this on a server which you don't admin and which has this disabled) 2) point bitvise's socks5 proxy server feature at the ssh server 3) point anything that needs to be tunneled at the bitvise client's port (default 1080) e.g. firefox. 4) voila, packets leave and return via the ssh server's public IP.
there you go with an easy socks5 proxy.
Even if the specific case of Firefox can be configured correctly and you have the source to verify that's it only sending traffic over the socks proxy, manually configuring every app to use a socks proxy is brittle and error pone, and for some apps just won't work.
Much more straightforward to just have a system wide VPN as the only available route for outbound traffic so that all apps use it transparently.
also, this sounds like fud.
so not fud, it's a more brittle way to do it.
Therefore I don't think this is fud for the wider privacy case.
When you get down from your horse, go and learn the Greenhills kernel and why everything from the nsa to the f35 uses it.
jfc dude it was just pointed out that the ssh+socks thing you provided has issues and there are simpler solutions. Ofc it depends on your goals but yeah if you care about privacy its a terrible solution because its incredibly brittle and there are much easier ways like using that ssh connection to setup a wireguard tunnel with a one-liner or any number of other more comprehensive solutions. Don't take it so personally, if it works for you it works for you.
I'm wondering though. If the block is on DNS level, isn't it easier and cheaper to use dns-over-https or dot instead?
It's not about whether the VPN provider can be trusted.
To quote: > I have my own VPN () - in other uncool words, I set up OpenVPN on a VPS ...
The title should be "I configured my home rolled (Open)VPN server incorrectly and it leaked DNS".