Untrusted computer networks (such as the Internet and public wireless networks) can be pretty hostile environments, but they can be tamed to some degree. By leveraging encryption and some encapsulation tricks, you can build more trustworthy networks on top of whatever network you choose, even if it is full of miscreants trying to watch or otherwise manipulate your data. This chapter primarily deals with how to set up secure, encrypted communications over networks that you don't completely trust. Some of the hacks focus mainly on providing a secure and encrypted transport mechanism, while others discuss how to create a virtual private network (VPN).
In reading this chapter, you'll learn how to set up Ipsec-based encrypted links on several operating systems, how to create virtual network interfaces that can be tunneled through an encrypted connection, and how to forward TCP connections over an encrypted channel. In addition, you'll also learn how to set up a cross-platform VPN solution.
The beauty of most of these hacks is that after reading them, you can mix and match transport-layer encryption solutions with whatever virtual network-oriented approach that best meets your needs. In this way, you can safely build vast, powerful private networks leveraging the public Internet as infrastructure. You can use these techniques for anything from securely connecting two remote offices to building a completely routed private network enterprise on top of the Internet.