
How to build your own VPN if you're wary of commercial options - sgeller
https://arstechnica.com/gadgets/2017/05/how-to-build-your-own-vpn-if-youre-rightfully-wary-of-commercial-options/
======
AdmiralAsshat
The problem with a home-grown VPN is that you lose some of the plausible
deniability that's gained from a shared VPN. If you have a VPN connected to a
privately-owned AWS instance, the IP coming from that AWS instance is easily
traced back to you. Whereas if your external IP is coming from a cluster that
is shared by thousands of other people using that VPN, it is more difficult
for someone to tie that specifically back to you.

~~~
masmullin
> AWS instance is easily traced back to you.

Define "easily" as used in this context. Easy is a product of whom your enemy
is.

Is your enemy your ISP? If that's the case, I don't think it's "easy" for
them; they would have to pay Digital Ocean or Amazon to get your data, and
probably isn't really that valuable to them.

Is your enemy the MPAA? If that's the case, I still don't think it's
particularly "easy" for them. Unless you are a MAJOR pirate distributor, the
extra effort(money) to track you down isn't worth it.

Is your enemy the NSA or the FBI? If that's the case, then yes, it's trivially
easy for them to Subpoena digital ocean or amazon to get your data, but
similarly they can use techniques on PIA to get your data too.

In the end, it comes down to whom you trust with your data. And whether you
want a managed VPN service, or are willing to put up with the inherent
problems of maintaining your own system. will PIA sell your surfing habits to
advertisers, will DO sell your surfing habits to advertisers? Who gives faster
speeds?

~~~
blacksmith_tb
I agree overall, but PIA has may not be the best example, as they have been
shown to not keep any data that could be subpoenaed[1]. One nice thing about
running your own (if your client machine is on Linux) is being able to use
Wireguard[2], which is quite a bit faster than OpenVPN, for example.

1: [https://torrentfreak.com/vpn-providers-no-logging-claims-
tes...](https://torrentfreak.com/vpn-providers-no-logging-claims-tested-in-
fbi-case-160312/)

2:
[https://www.wireguard.io/performance/](https://www.wireguard.io/performance/)

~~~
sigjuice
Never heard of Wireguard before, but it looks really cool, especially the
mosh-like roaming. However, I found this warning on their website.

 _WireGuard is not yet complete. You should not rely on this code. It has not
undergone proper degrees of security auditing and the protocol is still
subject to change._

~~~
y4mi
its also versioned with a double zero: v0.0.20170517 and the repositories are
marked unstable.

also, the protocol itself is still considered 'version 0' with lots of
possible changes on their website.

looking forward to it maturing though.

------
rbritton
I operate my own VPN endpoint for a couple reasons:

1\. I frequently need to connect via open, untrusted local networks, such as
those at hotels.

2\. Many commercial VPNs (e.g., PIA) end up having some portion of their
endpoint IPs end up on blacklists and break a lot of sites.

Anonymity from the government is a lower priority than both of the above, and
I acknowledge the lack of it in my risk model.

Initially I started out just running a Streisand[0] server, but its scope and
overall speed were unsuited for my wants. Now it's just a barebones VPS with
OpenVPN running, and I connect to it primarily through a travel router.[1]
Longer term I would like to develop an Ansible playbook so that I can quickly
deploy a new endpoint at a close VPS when traveling if the need arises for
better speed.

[0]: [https://github.com/jlund/streisand](https://github.com/jlund/streisand)

[1]:
[https://www.amazon.com/gp/product/B01I92T754/ref=oh_aui_deta...](https://www.amazon.com/gp/product/B01I92T754/ref=oh_aui_detailpage_o04_s00)

~~~
icelancer
>2\. Many commercial VPNs (e.g., PIA) end up having some portion of their
endpoint IPs end up on blacklists and break a lot of sites.

Yup. I cannot use these in good faith. I've gotten burned really badly by
using shared VPNs and payment-type sites. I roll my own on a no-log VPS paid
in Bitcoin through a mixer, registered to a false name/address.

------
TACIXAT
Alternatively, just use Algo. [1] It's a self-hosted, hardened IPSEC VPN that
automates setup on multiple cloud providers.

1\. [https://github.com/trailofbits/algo](https://github.com/trailofbits/algo)

~~~
KingMob
Algo is great!

For anybody who wants steps on setting it up with an unsupported provider, I
wrote a blog post on exactly that recently:
[http://modulolotus.net/posts/2016-03-28-setting-up-
algo/](http://modulolotus.net/posts/2016-03-28-setting-up-algo/). I used
Vultr, but it should help for any Ubuntu-based server.

~~~
justinclift
Is the "2016" date in your blog post & URL correct? Seems off by a year.

~~~
KingMob
Ooo, good catch. Must have mistyped the year in the filename.

------
xpaulbettsx
Like, I'm not sure why anyone thinks that:

1\. AWS, DO or Linode won't respond to a subpoena

2\. That any of those three won't have extensive logging in place, without the
privacy goals that a VPN provider would have

You're just switching your ISP to AWS when you do this, which might be better
than what you've got, but certainly isn't flawless untraceable security

~~~
TACIXAT
I really hope people aren't using a VPN for untraceable security. VPNs are for
privacy, not for getting away with illegal things.

~~~
appleiigs
Yeah, coffee shop wifi is for getting away with illegal things.

~~~
Skunkleton
I can confirm. This is where I write all of my dangerous Visual Basic IP
addresses.

------
super-io
"... but what about when your ISP literally edits your web traffic, inserting
more ads, and possibly breaking webpages."

It is possible the ISP not only injects ads but injects unique identifiers
that the user never sees. These could be used to track the user across
different devices and networks. This possibilty was suggested a few years ago
by a well-known cryptographer in a presentation titled "How to manipulate
standards".

------
daxorid
This is odd. The primary point of VPN services (aside from a layer of
protection on untrusted networks) is to mix your traffic in with N other
random users such that the chance of you being identified as the source of the
traffic is 1/N instead of 1/1.

Hosting your own VPN exit node, with you as the sole user, defeats this use
case entirely.

~~~
seangrogg
It's worth nothing that this may be _your_ primary point, but that does not
necessarily extend to the whole. Netflix has region-locked content that is
often most easily accessed by leveraging VPNs. ISPs will have greater trouble
selling off your meaningful browsing data if it's going through a VPN. And so
on.

------
drewg123
Why is he using AES-CBC rather than AES-GCM? GCM is generally faster & more
optimized, especially for hardware offloads like might be present on some
routers.

Is there something about OpenVPN that doesn't support GCM?

~~~
drdaeman
AFAIK OpenVPN _officially_ has GCM mode support since v2.4, which is
relatively recent (official release December 2016).

I'm sure it was also present in 2.3.x - at the very least I'm certain that
2.3.10 I have on one host supports TLS-DHE-RSA-WITH-AES-256-GCM-SHA384 - but
it could be distro-specific backports or something like that. At least 2.3
changelogs don't mention anything about AEAD or GCM specifically, and GCM
support is featured in
[https://github.com/OpenVPN/openvpn/blob/release/2.4/Changes....](https://github.com/OpenVPN/openvpn/blob/release/2.4/Changes.rst)

~~~
drdaeman
Update: no I was wrong. OpenVPN v2.3.x has two connections, a control channel
and data channel. That TLS-DHE-RSA-WITH-AES-256-GCM-SHA384 (defined by `tls-
cipher` setting) is a control channel, and data channel doesn't support GCM.

Anyway, 2.4 is out already.

------
filleokus
I would like to have a setup like this:

\- One VPN to connect laptop on the road with machines at home LAN, and with
VM:s on different hosts.

\- Have this VPN "exit" via a commercial VPN-provider (for privacy).

Could I easily configure this? Have one of the VM's be the VPN server and
configure it to "exit" trough the commercial VPN?

I haven't really managed / configured "real" VPN's, how does local access
work? I.e, when I'm at home with my laptop and access my desktop that's on the
same network, will the packets flow out to the remote VPN server and back, or
can it resolve it locally somehow?

Also, will this break stuff that depend on Bonjour / ZeroConf (i.e Apple
Airplay and stuff?)

~~~
aphextron
> Could I easily configure this? Have one of the VM's be the VPN server and
> configure it to "exit" trough the commercial VPN?

This is easily doable, but it comes down to how much you trust your commercial
VPN host. As it is, most of these service providers are pretty shady to say
the least. If it were somehow possible to provide a service that is _provably_
secure and log free, that would be a different story.

~~~
filleokus
For the last year or something I have been using
[https://www.ovpn.com/en](https://www.ovpn.com/en). They are not shady at all,
and allow bitcoin or cash payments, and are run by a friend of a friend, so I
trust them. But no less provably secure compared to the rest.

------
kitotik
I'm surprised that tinc-vpn.org isn't mentioned more in these VPN threads.
It's such a pleasure to work with when compared to OpenVPN. You can standup a
distributed mesh VPN in minutes.

~~~
LinuxBender
You should add that it routes in user-space without turning on kernel
forwarding, to any node in the network even if they are not directly
connected. There are some nice privacy and availability aspects to this.

------
intopieces
A lot of the focus of VPN discussion centers around logging, and around
whether their provider is prepared to hole themselves up in their compounds
like Branch Davidians to protect their info.

That misses the point. If the government wants to hack you, steal your
traffic, etc, they can, VPN or not, 'no-log' VPN or not.

The point behind consumer-level VPNs is more to prevent the ISP-level
tracking, the ad-targeting, etc, and to keep out hackers and get around
government/institution blockers. For this, whatever well-reviewed service will
do.

------
hathym
or use docker:
[https://hub.docker.com/r/kylemanna/openvpn/](https://hub.docker.com/r/kylemanna/openvpn/)

~~~
2bluesc
> or use docker:
> [https://hub.docker.com/r/kylemanna/openvpn/](https://hub.docker.com/r/kylemanna/openvpn/)

That's my project, thanks for the shout out!

For those curious the main feature of the Docker container is to wrap up the
PKI generation and conf file generation for the 90% use case.

------
super-io
"First your website uses SNI..."

s/uses/may use/

Not every website uses SNI.

For example, the majority of sites linked to from HN _do not_ use SNI.

Also, there are workarounds when SNI is not supported. Workarounds have been
published by one major corporation who authors a popular web server software
and runs a cloud hosting service.

Is SNI "the only way to do it"? No. There is another way to do stream
encryption for mlutiple websites from one IP. It predates HTTPS. This idea
goes back to one of the original authors of the world's first web server at
CERN. The legacy of this idea survives today as the Websocket "Upgrade"
header. Links to further reading below.

Because of groupthink dynamics among today's standards committee people and
website owners who follow along, it appears that any online discussion of
alternative options to SNI is met with swift dismissal.

[http://www.ietf.org/rfc/rfc2817.txt](http://www.ietf.org/rfc/rfc2817.txt)

[http://www.ietf.org/rfc/rfc2818.txt](http://www.ietf.org/rfc/rfc2818.txt)

The draft below refers to proxies but further searching will find papers he
wrote about how to start an encrypted stream upon connecting to an HTTP
server. Any service could sit behind one simple HTTP interface. This idea was
revived in "Upgrade" header referred to above. Then forgotten as HTTPS became
popular. Then revived again for "Websockets".

[http://www.ietf.org/archive/id/draft-luotonen-web-proxy-
tunn...](http://www.ietf.org/archive/id/draft-luotonen-web-proxy-
tunneling-00.txt)

SNI is not the only solution, it is just one approach, and I suspect the next-
generation encryption (a TLS alternative that will be readily adaptable to PQ)
will not need to send domain names in the clear.

~~~
mappu
I am interested in this idea, but I don't expect a better solution than SNI to
appear anytime soon.

RFC2817's `Upgrade: TLS` is just like SNI except it requires an extra
roundtrip and it only works for HTTP, not other TLS-enabled services
experiencing the same issue (e.g. IRCS, FTPS, ...).

For an HTTPS server with a single certificate and no SNI handling, the domain
name is (A) still leaked in plaintext by the initial DNS lookup, and (B)
instantly visible by anyone who connects to the IP address.

Even if you plug the DNS hole, the fundamental issue is needing to secure
communications with the remote server, before you even tell it what domain
you're asking for. That can't work under the domain-validation CA model.

I suppose you could add an extra layer of indirection, by adding a certificate
for the server itself; but that's just moving the chain of trust, and it's
practically equivalent to a multi-domain SAN certificate.

------
AlexCoventry
I have no current need for it, but I'd be really interested to read a step-by-
step guide on setting up an untraceable server using cryptocurrency, starting
from cash. As others have pointed out, the hole in these instructions is that
you have to trust Digital Ocean.

------
mverwijs
I ran across this one today:
[https://github.com/trailofbits/algo](https://github.com/trailofbits/algo)

Based on ipsec, so no extra software to install on the clients. Looked
interesting.

------
borski
We also built a solution to quickly deploy your own VPN using OpenVPN:
[https://www.tinfoilsecurity.com/vpn](https://www.tinfoilsecurity.com/vpn)

All open-source, too.

------
kim0
It seems the gov of Egypt is starting to block ipsec vpns like it did openvpn
ones. Any generic solution to add obfuscation layer? Wish more VPN software
had such functionality out of the box

------
the_common_man
What's the difference between L2TP/IPsec and OpenVPN?

~~~
yaantc
They are three different protocols allowing to tunnel encrypted traffic
between two end points:

\- L2TP is the "layer 2 tunneling protocol", where the layer 2 is usually PPP,
and an IETF standard;

\- IPsec is designed to tunnel IP over IP, and an IETF standard;

\- OpenVPN is a specific software and protocol, using TLS. IF memory serves
well it can operate at both Ethernet and IP level, although IP is the most
common.

~~~
cat199
To add, L2TP is only tunneling and not encrypted, which is why it is often
used in combination with IPSec.

It is used _instead_ of pure IPSec because it allows non IP traffic, which in
some cases is more important (e.g. windows non-IP netbios traffic interop when
L2TP/IPSec was first made popular)

and to confirm, yes, OpenVPN will run in IP or ethernet mode.

------
nafizh
This might be a good idea for a startup where they create a plug and play
service so users do not have to go through all of this.

------
JDevlieghere
Too bad IPv6 is again ignored completely; not even a mention in the article.

~~~
hueving
From my perspective in datacenter infrastructure, ipv6 interest has actually
_declined_ in recent years.

I think the emergence of a functioning IPv4 market has actually tipped the
scales backwards towards v4 unfortunately. I frequently hear from operators
that v4 technology (and expertise managing it) for sharing addresses (NAT) is
so mature and stable that there isn't much gain for them in the riskier bet on
v6.

You would also be shocked at how many also consider the unsolicited ingress
connection blocking caused by NAT to be a bonus security feature that v6
doesn't have.

I'm starting to become convinced I will be dead long before v6 dominates the
world. :(

------
andy_ppp
I setup something from a script on digital ocean a while back.

------
MickelC
Its difficult to make you own VPN. you have to purchase servers and IPs

The best solution is to buy a vpn and stay secured. you can run it on -
devices. I use ivacy because its $2 a month and working fine with me.

------
davidcollantes
Easier: [https://github.com/hwdsl2/setup-ipsec-
vpn](https://github.com/hwdsl2/setup-ipsec-vpn)

------
jug5
Or just use a modern deployment option like
[https://github.com/jlund/streisand](https://github.com/jlund/streisand)

------
kapauldo
i think nordvpn is like 80 bucks for 2 years seems worth saving this hassle.

