|
|
Subscribe / Log in / New account

GNU virtual private Ethernet

LWN.net needs you!

Without subscribers, LWN would simply not exist. Please consider signing up for a subscription and helping to keep LWN publishing

By Nathan Willis
November 20, 2013

Virtual private networks (VPNs) are designed to overlay a second, secure network on top of the existing (insecure) Internet, but that network overlay can take a number of different forms depending on the precise security needs in question, how static or dynamic the network is, and other factors. GNU Virtual Private Ethernet (GVPE) is a free software VPN suite that takes a different approach to the problem than that of popular projects like OpenVPN. In particular, GVPE creates an actual network where all participating nodes can talk directly to one another, rather than setting up a point-to-point tunnel, and it tries to simplify VPN deployment by making encryption and other settings into compile-time options.

The latest release is version 2.25, from July 2013. Prior to 2.25's release, the last update was from February 2011, and the one before that from 2009. Suffice it to say, then, that GVPE is not a rapidly moving target. But there are several changes in 2.25 that users should take note of. It is also noteworthy, however, that developer Marc Lehmann announced in the release notes that 2.25 would be the final release in the 2.x line—subsequent releases will be changing the underlying message protocol, and will be numbered 3.x to indicate the ABI break.

Background

GVPE is designed to handle a use case most other VPN tools do not: connecting multiple nodes—as in "more than two"—into a single virtual network. The difference is not in how many clients computers can use the VPN, but in how the participating nodes connect. Most other VPN software is optimized for creating site-to-site tunnels that provide a link from one LAN to another, which serves the commonplace usage scenario of connecting to an office VPN from a single laptop or remote home office. For example, a gateway router or a machine on the LAN is set up to serve as an OpenVPN server, creating either a layer-2 (link-layer) or layer-3 (IP layer) tunnel to a remote OpenVPN client, using the kernel's TUN/TAP driver. OpenVPN is generally geared toward IP-layer tunneling, however.

While multiple network sites can be connected in such a fashion, the more sites there are, the more difficult the configuration is to set up and maintain. A separate tunnel needs to be configured between each site and at least one other—either in a star topology with one site serving as a hub, or else with routing rules for each tunnel configured at each site.

GVPE, is designed to simplify this multi-site configuration. It runs separately on each node participating in the VPN, with the same configuration file at each node. The "virtual Ethernet" segment that connects the nodes is, in a sense, a separate network—it provides a network interface for the VPN that exists alongside the normal network. The VPN provides multiple entry points, each client can talk directly to the others, and any node can be taken offline at any time without disconnecting the rest. GVPE is very much a link-layer VPN in this respect; even broadcast Ethernet frames are supported. Consequently, any network protocol stack that can run over Ethernet can run over a GVPE network, which provides considerable flexibility in setting up the virtual network.

On the other hand, the flexibility in GVPE's network topology comes at the cost of a bit less flexibility where the security design is concerned. GVPE uses public-private key pairs for each node to secure its traffic. But the ciphers and digest algorithms that are used must be chosen when GVPE is configured and built (the defaults are RIPEMD-160 for the digest and AES-128 for encryption). The cipher and digest choices are passed to the configure script. Selecting just one of each makes it possible to build smaller binaries (with, in theory, a smaller attack surface). The transport protocols over which GVPE will run (raw IP, UDP, ICMP, TCP, and even DNS are supported) are specified in the configuration file, along with a list of all of the GVPE nodes participating in the virtual network. The nodes can be specified by IP address or by hostname.

Compared to OpenVPN, this configuration file is quite simple; for example, a three-site network could make do with:

    enable-rawip = yes
    ifname = vpn0

    node = site1
    hostname = 192.168.1.100

    node = site2
    hostname = db.example.com

    node = secrethq
    hostname = tahiti.nsa.gov

and be fully connected. On the other hand, the configuration file must be distributed to every node, so adding, removing, or reconfiguring nodes and options necessitates propagating the changed file to all sites. Tools like rsync help, of course, but for large networks it could become a hassleā€”or worse, should the need arise to quickly remove a node from the VPN. Each node must also have an ifup script for the interface named in the configuration which assigns it an IP address for the private network. Finally, each node needs to have its own key pair created and its public key distributed to all of the other nodes. The private keys need to be distributed to their respective nodes securely, of course.

GVPE provides a command line tool called gvpectrl that can automatically read in the configuration file and create the key pairs needed for each node. Once the configuration file and appropriate keys are all in place, each node can start the GVPE daemon with:

    gvpe -D theappropriatenodename

Subsequently, applications that need to use the private network may need to be configured either for the vpn0 virtual interface or for the private network IP address. Simple applications like ping may require no configuration; others like Apache need to be bound to the specific interface. Apart from being pointed at the VPN, however, applications should work automatically—an IMAP client just needs to know the IP address of its servers, whether they are on the VPN or the Internet. GVPE nodes establish a connection with Elliptic-Curve Diffie-Hellman key exchange, and the packets include hash message authentication codes (HMAC) as checksums.

The protocol header includes the source and destination IDs of each node, so that nodes can route messages. These IDs can be assigned in the configuration file, but by default they are the integer number of the nodes in the order they are listed in the file. That has the benefit of being generic, rather than being taken from (and revealing) some property of the node, like MAC address. Node-to-node traffic is connection-oriented, with sequence numbers in each packet; retries include exponential back-off.

GVPE does not have to run on the actual client machines; it can also be run on gateway routers to connect entire networks. However, the routing configuration in such a scenario is understandably more complex, as is setting up firewall rules to restrict access to the private network. But GVPE is designed to eliminate much of this complexity by running on each client node—one of the project's repeated bullet-point features is that it allows clients to conduct private networking without trusting any of the intermediary network.

The future

GVPE has not changed much in recent releases. Version 2.25 introduces two changes that affect backward compatibility with existing deployments—although neither change demands much reconfiguration.

First, it is no longer possible to enable UDP as the sole transport protocol. The release notes say that this is necessary because, in some situations, nodes need to negotiate their connection to another node without knowing what transport protocols the other node can speak. That negotiation requires contacting a third GVPE node that can act as a router, and UDP's connection-less nature prohibits that negotiation. Second, the DNS transport protocol has been altered; the change breaks compatibility with previous releases (changing the encoding used for SYNs and headers, among other things), although the project warns users to use DNS transport only as a last resort to sneak through stubborn firewalls anyway. Other changes include the addition of the SHA-256 and SHA-512 digests as HMAC options and additional options for configuring the GVPE daemon's chroot behavior.

Considering the fact that changes to the DNS transport and the allowable transport protocol settings may force some current 2.x users to update their configurations, one might well ask what to expect in the forthcoming 3.x series. To that question, Lehmann's announcement only says that the GVPE message protocol itself will change, "to take advances in the last decade into account". What that means is not entirely clear, although he does note how key lengths and hash functions have evolved in the intervening years.

In the meantime, though, GVPE offers an interesting feature set that differs considerably from the "traditional" VPN model. Not only can nodes communicate without trusting the network itself, but the endpoint-to-endpoint encryption means that they do not have to trust other nodes on the network, either. True, the manual propagation of the configuration file and keys does mean that users need to trust the administrator who sets up the system, but that is ultimately true in almost all networks, private and virtual ones included.

Index entries for this article
SecurityEncryption
SecurityNetworking


(Log in to post comments)

GNU virtual private Ethernet

Posted Nov 20, 2013 17:53 UTC (Wed) by nomeata (subscriber, #16315) [Link]

At first this reminded me of tinc (which also puts n hosts in a network), but tinc is also at the IP level.

One nice feature of tinc is that the graph does not have to be complete, and packages find their way. Is that also possible with GVPE?

GNU virtual private Ethernet

Posted Nov 20, 2013 21:39 UTC (Wed) by flok (guest, #17768) [Link]

Tinc can also work like ethernet. See: http://www.tinc-vpn.org/examples/bridging/ how to bridge ethernet segments.

GNU virtual private Ethernet

Posted Nov 20, 2013 18:51 UTC (Wed) by nmav (subscriber, #34036) [Link]

I find it sad that open source VPN solutions use custom cryptographic protocols (and reinvent the wheel) instead of following standard secure communications protocols.

GNU virtual private Ethernet

Posted Nov 20, 2013 19:39 UTC (Wed) by jorgegv (subscriber, #60484) [Link]

You can try to setup an IPSec connection, then an OpenVPN one. You'll then understand.

GNU virtual private Ethernet

Posted Nov 20, 2013 19:56 UTC (Wed) by raven667 (subscriber, #5198) [Link]

Which is unfortunate because IPSec fits better into the networking stack than requiring every application to re-invent crypto, using SSL or SSH or whatever, what it needed was much simpler setup and key distribution. It wouldn't surprise me if the reason the standard is so difficult is not only because it was designed by committee but also if there were NSA interference making it harder to deploy than it could have been.

http://www.mail-archive.com/cryptography@metzdowd.com/msg...

GNU virtual private Ethernet

Posted Nov 20, 2013 20:18 UTC (Wed) by drag (guest, #31333) [Link]

> what it needed was much simpler setup and key distribution.

This is the kicker. So far there seems to be no such thing for any purpose.

GNU virtual private Ethernet

Posted Nov 20, 2013 22:52 UTC (Wed) by raven667 (subscriber, #5198) [Link]

As the earlier poster pointed out, OpenVPN seems to do substantially the same thing but with easier setup and key distribution, SSL and SSH do much of the same thing with varying degrees of complexity, depending on whether you are using X.509 or not, and are still simpler than IPSec.

GNU virtual private Ethernet

Posted Nov 25, 2013 11:12 UTC (Mon) by tialaramex (subscriber, #21167) [Link]

In most live deployments OpenVPN key distribution isn't done securely. The CSR step is usually skipped in favour of sending out pre-signed keys to users - often by email - with the effect that if these emails are _ever_ obtained by Bad Guys you lose immediately.

With SSH you have (prior to the later OpenSSH versions and a specific non-default configuration) no actual management function per se at all. Each user decides for themselves exactly which keys to permit either by adding their identifiers to a text file in their home directory or in more sophisticated setups adding them to a central LDAP server. The upside is that they're less likely to send the private keys through email, so Bad Guys won't get in that way, but you can bet many of the private keys are held locally, unencrypted or protected by trivially brute-forced passwords on phones and laptops.

These are all big improvements on the status quo of 15-20 years ago when people still thought it was OK to use 'telnet', but they can't be seriously offered up as a "solution" to the management problem. You're closer with SSL, but until/ unless DANE takes off that's always going to be associated with the corrupt practices of CAs. I would liken the situation we have to that of EMV cards in Europe as compared to magstripe payment cards in the US. It's a huge improvement, but only measured against doing nothing. Compared to what should have been possible in the same timescale it's a failure.

GNU virtual private Ethernet

Posted Nov 25, 2013 13:24 UTC (Mon) by Lennie (subscriber, #49641) [Link]

You know there are actually standards which provide this properly.

I think there is one or more implementations for Linux that supports Opportunistic IPSEC with public keys in DNS signed with DNSSEC.

In FreeS/WAN or Openswan, but I don't think it made it into the mainline Linux kernel.

So life could have been really, really simple...

GNU virtual private Ethernet

Posted Nov 25, 2013 13:27 UTC (Mon) by Lennie (subscriber, #49641) [Link]

Just found a PDF from a recent presentation by Paul Wouters: http://www.ietf.org/proceedings/88/slides/slides-88-saag-...

So who knows... :-)

GNU virtual private Ethernet

Posted Nov 20, 2013 20:51 UTC (Wed) by nmav (subscriber, #34036) [Link]

IPSec isn't the only protocol that can be used by VPNs. There are TLS and Datagram TLS protocols, which are already used in CISCO's AnyConnect protocol (and fortunately by openconnect VPN -on which I'm involved). What is sad is that it took a company making proprietary software, to make a VPN protocol based on standards.

GNU virtual private Ethernet

Posted Nov 21, 2013 9:02 UTC (Thu) by eternaleye (guest, #67051) [Link]

Thanks for openconnect and ocserv, by the way - I convinced my employer to use them for VPN, at least in part due to the use of standard TLS and DTLS. Definitely liking the new support for AES-GCM with DTLS.

GNU virtual private Ethernet

Posted Nov 21, 2013 9:42 UTC (Thu) by andreashappe (subscriber, #4810) [Link]

just done an OpenVPN setup and was surprised how easy it was.

What were your problems, sir?

cheers, Andreas

GNU virtual private Ethernet

Posted Nov 21, 2013 13:53 UTC (Thu) by imitev (guest, #60045) [Link]

IPSEC is a pain to set up, except between two peers with the same version of the IKE daemon. By experience:

- why are interoperability charts needed when IPSEC is a standard (rhetorical question) ? Go figure whether the sending proposal is OK but one peer is configured to reject anything not equal to the proposed set, whether the peer simply doesn't like what we're sending, or whether some algs, key lengths, or key renewal times are not supported or not within the daemon's (undocumented) limits, ...

- one peer would initiate the tunnel properly, but the other one won't. Often a matter of strict vs. tolerant, but sometimes difficult to debug. Add a dose of NAT to this and this gets way more complicated.

- after some time the tunnel would go down. Did the dead peer detection go wrong ? Did the key renewal happened on one peer but not the other because one daemon takes the largest renewal time, while the other the smallest one ? Or maybe one of the daemons just doesn't ignore the peer's proposal and uses its own key lifetime (or number of bytes) to renew keys.

These are real life problems from a few years ago, with VPNs between open source stuff (openswan or racoon), and "corporate" stuff like Checkpoint (that thing should be killed) or exotic stuff I can't even remember. But maybe things have improved since then.

GNU virtual private Ethernet

Posted Nov 21, 2013 14:52 UTC (Thu) by dskoll (subscriber, #1630) [Link]

IPSEC is a pain to set up

The OP mentioned OpenVPN. OpenVPN is very easy to set up. Although it doesn't use a "standard" protocol, it runs on every system I care about so we use it for our corporate VPN.

GNU virtual private Ethernet

Posted Nov 21, 2013 15:19 UTC (Thu) by imitev (guest, #60045) [Link]

hmmm... right. I've assumed "What were your problems, sir?", were referring to ipsec, not openvpn.

anyway, this made me remember of bad times fighting IKE implementations :)

GNU virtual private Ethernet

Posted Nov 21, 2013 16:29 UTC (Thu) by raven667 (subscriber, #5198) [Link]

That sent a shiver down my spine, remembering my many years in a NOC setting up IPSec links between Free&Open/SWAN and various other implementations. Why do these things happen and why are the log messages so bad, for IPSec you need to understand the packet-by-packet decode of the negotiation to even begin to troubleshoot problems, with OpenVPN the log messages are much easier to read and you don't have to be a protocol expert to setup and maintain it.

GNU virtual private Ethernet

Posted Nov 21, 2013 17:02 UTC (Thu) by alankila (guest, #47141) [Link]

Much of the complexity of IPsec lies with these key exchange daemons. Would IPsec be terribly insecure if you just used some fixed 128 bit key for all eternity?

GNU virtual private Ethernet

Posted Nov 21, 2013 17:08 UTC (Thu) by hummassa (guest, #307) [Link]

Is your question serious? I think you forgot a smiley. If you used always the same 128 key, it would be the same as sending the plaintext...

GNU virtual private Ethernet

Posted Nov 21, 2013 17:39 UTC (Thu) by drag (guest, #31333) [Link]

> Would IPsec be terribly insecure if you just used some fixed 128 bit key for all eternity?

You can use shared private key on your own network if you want.

You can use something like Puppet to distribute the ipsec configuration files with the shared secret thus making supporting N-way Ipsec encryption fairly easy.

But the security of your network depends on the security of every single host on that network.

GNU virtual private Ethernet

Posted Nov 22, 2013 0:09 UTC (Fri) by dlang (guest, #313) [Link]

If all your systems can talk to each other, the security of your network already depends on the security of each individual machine.

getting the key would not let another machine join the network, the new configurations on all machines would need to be modified to allow it as well.

GNU virtual private Ethernet

Posted Nov 21, 2013 17:34 UTC (Thu) by drag (guest, #31333) [Link]

> That sent a shiver down my spine, remembering my many years in a NOC setting up IPSec links between Free&Open/SWAN and various other implementations.

The libswan effort from Fedora/Redhat combined with porting it over to using Mozilla's NSS libraries instead of OpenSSL seems to have substantially improved the usage of IPSEC.

Creating keys, exchanging them, and installing them is all done quite easily using just some basic NSS commands.

At least for me.

unfortunate, as always, interoperability with other IPSEC implementations remains a nightmare.

GNU virtual private Ethernet

Posted Nov 21, 2013 17:35 UTC (Thu) by drag (guest, #31333) [Link]

Sorry, it was 'libreswan'. Based on Openswan.

GNU virtual private Ethernet

Posted Nov 21, 2013 17:28 UTC (Thu) by pavlix (guest, #94133) [Link]

I don't believe in reinventing the entire protocols just because of problems in current implementations.

GNU virtual private Ethernet

Posted Dec 2, 2013 21:19 UTC (Mon) by dvdeug (subscriber, #10998) [Link]

If implementations don't work together, they aren't really implementing the same protocol. And why saddle yourself with problems of an older implementation if you aren't buying compatibility with it?

GNU virtual private Ethernet

Posted Nov 23, 2013 7:11 UTC (Sat) by wahern (subscriber, #37304) [Link]

It took me 5 minutes to setup my first IPSec tunnel a couple of years ago. It was substantially easier than OpenVPN, which I had been using prior. It's also been much more resilient, not the least because it's built into the system.

Machine 1's configuration was one line in /etc/ipsec.conf

ike passive esp tunnel from 192.168.2.0/24 to 192.168.3.0/24 \
main auth hmac-sha1 enc aes group modp1024 \
quick auth hmac-sha1 enc aes group modp1024 \
srcid orville.25thandClement.com dstid campbell.25thandClement.com

Machine 2's configuration was one line in /etc/ipsec.conf

ike dynamic esp tunnel from 192.168.3.0/24 to 192.168.2.0/24 peer 38.99.63.178 \
main auth hmac-sha1 enc aes group modp1024 \
quick auth hmac-sha1 enc aes group modp1024 \
srcid campbell.25thandClement.com dstid orville.25thandClement.com

Done. I also had to drop a CA certificate and a signed key in /etc/isakmpd. That was similarly trivial, although I could have forgone that step by simply using a shared passphrase in the above configuration lines.

However, it's noteworthy that this wasn't using a Linux distribution, but another open source operating system well known for the ease of its packet filter configuration syntax. They took that commitment regarding simple but powerful configuration and applied it to IPSec.

GNU virtual private Ethernet

Posted Nov 24, 2013 17:04 UTC (Sun) by luto (subscriber, #39314) [Link]

I really wish that there was a decent ipsec stack for Linux. Free/Open/LibreSWAN are (sorry, developers) among the worst pieces of network software I've ever had to use. (That includes pimd, and that's saying a lot.)

group modp1024

Alas, modp1024 is probably not strong enough for most purposes these days.

GNU virtual private Ethernet

Posted Nov 20, 2013 21:51 UTC (Wed) by guus (subscriber, #41608) [Link]

(D)TLS and IPsec are nice for static tunnels or client/server architectures, but they map poorly to peer-to-peer applications.
The problem is not so much the actual encryption and integrity protection of the tunneled packets, but the key exchange protocols.

GNU virtual private Ethernet

Posted Nov 21, 2013 7:01 UTC (Thu) by nmav (subscriber, #34036) [Link]

Many associate TLS and Datagram TLS with X.509 certificates. Most probably this is what your comment also implies. This is plainly incorrect. TLS can be used with pre-shared keys (look for TLS-PSK), as well as passwords (look for TLS-SRP), or ever opportunistic encryption (by using trust on first use).

There is a good reason for using standard protocols. By each program inventing its own key exchange protocol we get (1) no reviews (who is going to bother to review a Joe's key exchange protocol), and (2) most probably is vulnerable to all attacks that are known and fixed in standard protocols (and this is expected -not everyone is an expert in crypto).

GNU virtual private Ethernet

Posted Nov 21, 2013 13:44 UTC (Thu) by guus (subscriber, #41608) [Link]

I would not use PSK for a VPN that is up for a long time or has many nodes. One would need to manage the keys in some way, and shared secrets are much harder to pass around safely than public keys are.

Password authentication is nice if you want to log in from your laptop to your company VPN, but for a true peer-to-peer VPN that is also not useful. Would you enter your password for every peer your VPN software connects to? Do you get popups every time a peer connects to you and you have to supply your password as well?

I do agree that there is a good reason for standard protocols, and one should use them where appropriate. But don't assume TLS or IPsec are the ultimate solutions for all your crypto problems. If you use the wrong tool for the job, you might actually weaken your security. For OpenVPN, TLS is the right way to go. For GVPE or tinc, it would be very hard to use TLS correctly.

GNU virtual private Ethernet

Posted Nov 21, 2013 4:10 UTC (Thu) by raven667 (subscriber, #5198) [Link]

This seems to cover some of the same territory as VXLAN and more modern software switches such as OpenVSwitch, but at a host level rather than at the hypervisor. With maybe better transport security. VXLAN seems to becoming a standard for simulating an Ethernet Layer2 network across a disparate set of machines, I wonder if there is any thought of interoperability with more standard and widely deployed protocols.

GNU virtual private Ethernet

Posted Nov 21, 2013 5:43 UTC (Thu) by shef (subscriber, #91287) [Link]

My feeling is that vxlan was invented by server admins who have no clue in the networking. What a bizarre idea!

What would IMO be nice

Posted Nov 22, 2013 2:22 UTC (Fri) by plugwash (subscriber, #29694) [Link]

Is a hybrid approach.

Where a central server provided configuration, connectivity for clients with uncooperative firwalls/nats and possiblly handled broadcasts while individual clients could still send packets directly to each other.


Copyright © 2013, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds