Paranoid Penguin - Linux VPNs with OpenVPN, Part II
Last month, I began a new series on how to build a Linux-based Virtual Private Network (VPN) solution using OpenVPN. I described what VPNs are, what they're used for, and I listed some popular ways of building VPNs with Linux. That column ended with some pointers for obtaining and installing OpenVPN.
This month, I continue with detailed instructions on how to build a quick-and-dirty single-user VPN connection that allows you to connect securely from some untrusted remote site, like a coffee shop wireless hotspot, back to your home network.
If you missed last month's column, here's a two-paragraph primer on VPNs. First, they're generally used for two things: connecting different networks together over the Internet and connecting mobile/remote users to some corporate or home network from over the Internet. In the first case, a VPN connection is usually “nailed”—that is, it stays up regardless of whether individual users actually are sending traffic over it. In the latter case, end users each create their own tunnels, bringing them up only as needed.
Several protocols are in common use for VPNs. The two most important of which are probably IPsec and SSL. IPsec is nearly always used to create an “encrypted route” between two networks or between one system and a network. In contrast, SSL, whether in the context of SSL-VPN (which uses a Web browser as client software) or in other SSL-based VPNs (like OpenVPN), can be used either to tunnel specific applications or entire network streams.
IPsec and SSL-VPN are out of the scope of this series of articles, which mainly concern OpenVPN. However, I will cover at least two different remote-access usage scenarios: single-user and multiuser. A later installment in this series may include site-to-site VPNs, which actually are simpler than remote-access solutions and which use a lot of the same building blocks. If I don't cover site-to-site VPNs, or if you need to build one sooner than I get around to it here, you'll have little trouble figuring it out yourself even after just this month's column!
Let's get busy with a simple scenario: setting up a single tunnel to reach your home network from the local coffee shop (Figure 1).
In this simple example, a laptop is connected to a wireless hotspot in a coffee shop (Coffee Shop WLAN), which in turn is connected to the Internet. The laptop has an OpenVPN established with a server on the home network; all traffic between the laptop and the home network is sent through the encrypted OpenVPN tunnel.
What, you may wonder, is the difference between the hardware and software comprising the OpenVPN “server” versus that of the “client”? As it happens, the command openvpn can serve as either a server dæmon or client dæmon, depending on how you configure and run it. What hardware you run it on is totally up to you, although obviously if you're going to terminate more than a few tunnels on one server, you'll want an appropriately powerful hardware platform.
In fact, if you need to support a lot of concurrent tunnels, you may want to equip your server with one of the crypto-accelerator hardware cards (“engines”) supported by OpenSSL (on which OpenVPN depends for its cryptographic functions). To see which are supported by your local OpenSSL installation, issue the command openvpn --show-engines. See the documentation at www.openssl.org for more information on its support for crypto engines.
For this simple example scenario, let's assume both client and server systems are generic laptop or desktop PCs running current versions of some flavor of Linux with their respective distributions' standard OpenVPN and OpenSSL packages. The example OpenVPN configurations I'm about to walk through, however, should work with little if any tweaking on any of OpenVPN's supported platforms, including Windows, Mac OS X and so forth.
Although this scenario implies a single user connecting back to the home server, the configurations I'm about to describe can just as easily support many users by changing only one server-side setting (max-clients) and by generating additional client certificates. Have I mentioned certificates yet? You'll need to create a Certificate Authority (CA) key, server certificate and at least one client certificate. But have no fear, OpenVPN includes scripts that make it quick and easy to create a homegrown Public Key Infrastructure.
Trending Topics
| OpenLDAP Everywhere Reloaded, Part I | May 23, 2012 |
| Chemistry the Gromacs Way | May 21, 2012 |
| Make TV Awesome with Bluecop | May 16, 2012 |
| Hack and / - Password Cracking with GPUs, Part I: the Setup | May 15, 2012 |
| An Introduction to Application Development with Catalyst and Perl | May 14, 2012 |
| Cryptocurrency: Your Total Cost Is 01001010010 | May 09, 2012 |
- OpenLDAP Everywhere Reloaded, Part I
- Validate an E-Mail Address with PHP, the Right Way
- Convert video to MP4 for Nook Tablet with best Video to Nook Tablet Converter
- Hack and / - Password Cracking with GPUs, Part I: the Setup
- Why Python?
- Building a Two-Node Linux Cluster with Heartbeat
- Python for Android
- Chemistry the Gromacs Way
- An Introduction to Application Development with Catalyst and Perl
- Make TV Awesome with Bluecop
- Euro 2012 Coupon Codes - Get 20% Off Pavtube TiVo Converter
11 hours 22 min ago - Euro 2012 Big Sale: 20% Off Instant Savings on TiVo Converter
11 hours 25 min ago - MakeMKV works as well, though
12 hours 7 min ago - Euro 2012 Big Sale: 20% Off Instant Savings on TiVo Converter
12 hours 40 min ago - Awesome
1 day 10 hours ago - Who worries approx the
1 day 12 hours ago - Convert DVD to MKV File with
1 day 13 hours ago - Really nice article! Catalyst
1 day 13 hours ago - michael kors outlet
1 day 18 hours ago - Default configuration of /etc/ssh/ssh-config
2 days 6 hours ago







Comments
password authentication
I wonder about security if I use a certificate on the server and username/password authentication as the only form of client authentication. As far as I understand this still should be much better than PSK because still authentication is done and changing session keys are used afterwards.
But of course a secure password should be chosen (16-32 random chars).
Or do I miss something here?
Duplicated step
Near the end of page 2 you say "You've got two more files to generate..."
openssl dhparam -out keys/dh1024.pem 1024but the keys/dh1024.pem file has already been generated by the "./build-dh" command (at least on my system - Ubuntu 9.04).
Minor typo?
... should be ...
since we're working in the "2.0" directory.
Thanks for the great series!
-Tyler