




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Charlie Scott Paul Wolfe Mike Erwin
Publisher: O'Reilly
Second Edition January 1999
ISBN: 1-56592-529-7, 225 pages
This book explains how to build a Virtual Private Network (VPN), a collection of technologies that creates secure collections or "tunnels" over regular Internet lines. It discusses costs, configuration, and how to install and use technologies that are available for Windows NT and UNIX, such as PPTP and L2TP, Altavista Tunnel, Cisco PIX, and the secure shell (SSH). New features in the second edition include SSH and an expanded description of the IPSec standard.
8. Creating a VPN with the Unix Secure Shell .......................... 8.1 The SSH Software .......................................... 8.2 Building and Installing SSH .................................... 8.3 SSH Components ........................................... 8.4 Creating a VPN with PPP and SSH ............................... 8.5 Troubleshooting Problems ..................................... 8.6 A Performance Evaluation .....................................
9. The Cisco PIX Firewall ........................................ 9.1 The Cisco PIX Firewall ....................................... 9.2 The PIX in Action .......................................... 9.3 Configuring the PIX as a Gateway ................................ 9.4 Configuring the Other VPN Capabilities ............................
10. Managing and Maintaining Your VPN ............................. 10.1 Choosing an ISP ........................................... 10.2 Solving VPN Problems ...................................... 10.3 Delivering Quality of Service .................................. 10.4 Security Suggestions ........................................ 10.5 Keeping Yourself Up-to-Date ..................................
11. A VPN Scenario ............................................ 11.1 The Topology ............................................. 11.2 Central Office ............................................ 11.3 Large Branch Office ........................................ 11.4 Small Branch Offices ........................................ 11.5 Remote Access Users ....................................... 11.6 A Network Diagram ........................................
A. Emerging Internet Technologies .................................. A.1 IPv ................................................... A.2 IPSec ................................................... A.3 S/WAN .................................................
B. Resources, Online and Otherwise ................................. B.1 Software Updates ........................................... B.2 The IETF ................................................ B.3 CERT Advisories ........................................... B.4 The Trade Press ............................................ B.5 Networking and Intranet-Related Web Sites ......................... B.6 Usenet Newsgroups ......................................... B.7 Mailing Lists ..............................................
Colophon .................................................... 177
This book is about a very new area of computer technology: providing secure access between members of an organization who are cast far around the world. Both the technology providers and the users are feeling their way.
We approached the idea of the virtual private network (VPN) with some skepticism, since we own an Internet service provider. Security compromises are fairly common, as end users fail to understand the importance of password integrity and other basic protections. Though known cracks are not common, attempted cracks are; unfortunately, the successful cracks are those you never hear about.
Customers began approaching us with requests for solutions. How can we use the global reach of the Internet to access our various networks around the country and the world? Can we do it securely? Can we do it now? Charlie probably looked them square in the eye and said, "Oh, yeah, we can do that," then gave a cackle, to Mike's and Paul's dismay. In the course of trying to find solutions for these needy customers, and for our own nationally expanding networks, we turned to the virtual private network, and eventually wrote this book.
Although it doesn't fully represent the drama and tribulations of learning about and erecting a VPN, this book covers everything you need to know to get one up and running. The technology of the virtual private network is widely available; however, specific solutions are fairly slim. We cover the four that are currently available—Layer 2 tunneling through PPTP or L2TP, the Cisco PIX firewall, the AltaVista Tunnel, and the Secure Shell (SSH)—and other basics on how VPNs work, how much they cost, and why you should use one. (And when you shouldn't.)
We assume that you are a network administrator who has already set up local area networks and knows something about the Internet and remote access (dial-in use). VPN solutions are usually employed along with firewalls, which are discussed only briefly in this book. For help with firewall concepts and technologies, you can find a variety of useful books, including Building Internet Firewalls, by D. Brent Chapman and Elizabeth D. Zwicky, published by O'Reilly & Associates, Inc.
Chapter 1
Do you need a virtual private network? Good question. Read this chapter and find out. After we scare you with some common security breaches, you will find some comforting reasons why a virtual private network may be your solution.
Chapter 2
Still here? This chapter details the various pieces that make a VPN function and make it more secure. Firewalls, encryption/authentication, and some basic VPN protocols and standards are covered. Rounding out this chapter are some of the varied and fun
Chapter 9
What's the top of the line? For now, we've found Cisco PIX to offer the most features and bandwidth—an expensive choice, but perhaps the only one that large sites will find satisfactory. In this chapter we cover what PIX can do, as well as configuration of the firewall and the private network.
Chapter 10
Now what's wrong? Someone can't dial in, or a connection that worked fine yesterday is down. This chapter takes you through the various points on the network (or your Internet provider's network) where access has failed. It also offers suggestions for policies that increase security on the VPN.
Chapter 11
Okay, show me one that actually works. Well, here's a real live working VPN from a real live company, though the names are changed to protect everyone involved. This chapter shows a VPN scenario in all its glory, detailing the needs of a company and how the VPN saved the day. A description of the network topology and various required items is also included, as well as a handy network diagram.
Appendix A
This appendix covers IPv6 (the newest version of the IP protocol), IPsec, and Secure Wide Area Network (S/WAN).
Appendix B
Technology and products for VPNs are evolving quickly. Here's a list of places we've found useful for the latest information.
The following conventions are used in this book:
Italic
Used for filenames, directory names, program names, URLs, and commands, as well as to introduce new terms.
Constant width
Used for system output and excerpts from files, and to indicate options.
Constant width bold
In some code examples, highlights the statements being discussed.
Constant width italic
Indicates an element, such as a filename or variable, that you supply.
This icon designates a note, which is an important aside to the nearby text.
This icon designates a warning related to the nearby text.
Please address comments and questions concerning this book to the publisher:
O'Reilly & Associates, Inc. 101 Morris Street Sebastopol, CA 95472 (800) 998-9938 (in the United States or Canada) (707) 829-0515 (international/local) (707) 829-0104 (fax)
To ask comment or ask technical questions about this book, send email to:
For more information about books, conferences, software, Resource Centers, and the O'Reilly Network, see the O'Reilly web site at:
http://www.oreilly.com/
The technology of VPNs is evolving on a monthly basis. Since new products and new releases of old products appear constantly, the authors maintain a web site summarizing these developments. For information that has developed since the printing of this book, please visit:
http://www.vpn.outer.net/
Any errors found in this book after publication are listed at the URL:
http://www.oreilly.com/catalog/vpn2/errata
The authors collectively wish to thank our insightful and understanding editor, Andy Oram. Without his direction, gentle reminders, and gracious deadline extensions, this book wouldn't be here.
Until now there has always been a clear division between public and private networks. A public network, like the public telephone system and the Internet, is a large collection of unrelated peers that exchange information more or less freely with each other. The people with access to the public network may or may not have anything in common, and any given person on that network may only communicate with a small fraction of his potential users.
A private network is composed of computers owned by a single organization that share information specifically with each other. They're assured that they are going to be the only ones using the network, and that information sent between them will (at worst) only be seen by others in the group. The typical corporate Local Area Network (LAN) or Wide Area Network (WAN) is an example of a private network. The line between a private and public network has always been drawn at the gateway router, where a company will erect a firewall to keep intruders from the public network out of their private network, or to keep their own internal users from perusing the public network.
There also was a time, not too long ago, when companies could allow their LANs to operate as separate, isolated islands. Each branch office might have its own LAN, with its own naming scheme, email system, and even its own favorite network protocol—none of which might be compatible with other offices' setups. As more company resources moved to computers, however, there came a need for these offices to interconnect. This was traditionally done using leased phone lines of varying speeds. By using leased lines, a company can be assured that the connection is always available, and private. Leased phone lines, however, can be expensive. They're typically billed based upon a flat monthly fee, plus mileage expenses. If a company has offices across the country, this cost can be prohibitive.
Private networks also have trouble handling roving users, such as traveling salespeople. If the salesperson doesn't happen to be near one of the corporate computers, he or she has to dial into a corporation's modem long-distance, which is an extremely expensive proposition.
This book is about the virtual private network (VPN), a concept that blurs the line between a public and private network. VPNs allow you to create a secure, private network over a public network such as the Internet. They can be created using software, hardware, or a combination of the two that creates a secure link between peers over a public network. This is done through encryption, authentication, packet tunneling, and firewalls. In this chapter we'll go over exactly what is meant by each of these and what roles they play in a VPN; we'll touch upon them again and again throughout the book. Because they skirt leased line costs by using the Internet as a WAN, VPNs are more cost-effective for large companies, and well within the reach of smaller ones.
In this chapter, we'll also talk about Intranets as the latest trend in corporate information systems, and how they were the impetus for VPNs.
A virtual private network is a way to simulate a private network over a public network, such as the Internet. It is called "virtual" because it depends on the use of virtual connections—that is, temporary connections that have no real physical presence, but consist of packets routed
over various machines on the Internet on an ad hoc basis. Secure virtual connections are created between two machines, a machine and a network, or two networks.
Using the Internet for remote access saves a lot of money. You'll be able to dial in wherever your Internet service provider (ISP) has a point-of-presence (POP). If you choose an ISP with nationwide POPs, there's a good chance your LAN will be a local phone call away. Some ISPs have expanded internationally as well, or have alliances with ISPs overseas. Even many of the smaller ISPs have toll-free numbers for their roaming users. At the time of this writing, unlimited access dial-up PPP accounts, suitable for business use, are around $25 per month per user. At any rate, well-chosen ISP accounts should be cheaper than setting up a modem pool for remote users and paying the long-distance bill for roaming users. Even toll-free access from an ISP is typically cheaper than having your own toll-free number, because ISPs purchase hours in bulk from the long-distance companies.
In many cases, long-haul connections of networks are done with a leased line, a connection to a frame relay network, or ISDN. We've already mentioned the costs of leasing a "high cap" leased line such as a T1. Frame relay lines can also give you high speeds without the mileage charges. You purchase a connection to a frame cloud, which connects you through switches to your destination. Unlike a leased line, the amount you pay is based more on the bandwidth that's committed to your circuit than distance. Frame connections are still somewhat expensive, however. ISDN, like the plain old telephone system, incurs long-distance charges. In many locations, the local telephone company charges per minute even for local calls, which again runs expenses up. For situations where corporate office networks are in separate cities, having each office get a T1, frame relay, or ISDN line to an ISP's local POP would be much cheaper than connecting the two offices using these technologies. A VPN could then be instituted between the routers at the two offices, over the Internet. In addition, a VPN will allow you to consolidate your Internet and WAN connections into a single router and single line, saving you money on equipment and telecommunications infrastructure.
1.1.1 The Rise of Intranets
By now you've probably heard of Intranets and the stir they've caused at many businesses. Companies are running TCP/IP networks, posting information to their internal web sites, and using web browsers as a common collaborative tool. An example of an Intranet application is a customer database accessible via the Web. Salespeople could use this database to contact current customers about new product offerings and send them quotes. The database could have a HyperText Mark- Up Language (HTML) front end, so that it would be accessible from any web browser.
The rise of Intranets was spurred on by the growth of the Internet and its popular information services, commonly known as the World Wide Web. It was as if the corporate sector had finally caught on to what the Internet community had been doing for years: using simple, platform-independent protocols to communicate more effectively. No matter how much marketing hype you hear, an Intranet is simply Internet technology put to use on a private network.
1.1.1.1 How VPNs relate to Intranets
Virtual private networks can be used to expand the reach of an Intranet. Since Intranets are typically used to communicate proprietary information, you don't want them accessible from
grant your employees and customers, the computing resources that are available for use, and even your reputation. For instance, a security failure can cause your vendors' email to bounce back to them, or prevent your users from making connections to other sites.
The easiest thing would be to isolate, tabulate, and lock down your private data. Well over half the data you manage and distribute might call for some sort of security. Just think, even something as innocuous as customer records and addresses could be used against you in a negative advertising campaign; this might hurt you far worse than a negative campaign aimed at a random slice of the population.
Unfortunately, in the client-server world of telecommuters, field sales agents, and home offices, it's not so easy to keep all private data locked down in a single, protected area. The chief financial officer of a company may need to access financial information on the road, or a programmer working from home may need to access source code. VPNs help alleviate some of the worry of transmitting secure files outside of your network. In Chapter 2, we will examine possible threats to your network and data, and explore the technologies that VPNs use to avoid them.
There are several technologies that VPNs use to protect data travelling across the Internet. The most important concepts are firewalls, authentication, encryption, and tunneling. Here we will give them a cursory rundown, then go into more detail in Chapter 2.
1.3.1 Firewalls
An Internet firewall serves the same purpose as firewalls in buildings and cars: to protect a certain area from the spread of fire and a potentially catastrophic explosion. The spread of a fire from one part of a building is controlled by putting up retaining walls, which help to contain the damage and minimize the overall loss and exposure. An Internet firewall is no different. It uses such techniques as examining Internet addresses on packets or ports requested on incoming connections to decide what traffic is allowed into a network.
Although most VPN packages themselves don't implement firewalls directly, they are an integral part of a VPN. The idea is to use the firewall to keep unwanted visitors from entering your network, while allowing VPN users through. If you don't have a firewall protecting your network, don't bother with a VPN until you get one—you're already exposing yourself to considerable risk.
The most common firewall is a packet filtration firewall, which will block specified IP services (run on specific port numbers) from crossing the gateway router. Many routers that support VPN technologies, such as the Cisco Private Internet Exchange (PIX) and the 3Com/U.S. Robotics Total Control, also support packet filtration. Proxies are also a common method of protecting a network while allowing VPN services to enter. Proxy servers are typically a software solution run on top of a network operating system, such as Unix, Windows NT, or Novell Netware.
1.3.2 Authentication
Authentication techniques are essential to VPNs, as they ensure the communicating parties that they are exchanging data with the correct user or host. Authentication is analogous to "logging in" to a system with a username and password. VPNs, however, require more stringent authentication methods to validate identities. Most VPN authentication systems are based on a shared key system. The keys are run through a hashing algorithm, which generates a hash value. The other party holding the keys will generate its own hash value and compare it to the one it received from the other end. The hash value sent across the Internet is meaningless to an observer, so someone sniffing the network wouldn't be able to glean a password. The Challenge Handshake Authentication Protocol (CHAP) is a good example of an authentication method that uses this scheme. Another common authentication system is RSA.
Authentication is typically performed at the beginning of a session, and then at random during the course of a session to ensure that an impostor didn't "slip into" the conversation. Authentication can also be used to ensure data integrity. The data itself can be sent through a hashing algorithm to derive a value that is included as a checksum on the message. Any deviation in the checksum sent from one peer to the next means the data was corrupted during transmission, or intercepted and modified along the way.
1.3.3 Encryption
All VPNs support some type of encryption technology, which essentially packages data into a secure envelope. Encryption is often considered as essential as authentication, for it protects the transported data from packet sniffing. There are two popular encryption techniques employed in VPNs: secret (or private) key encryption and public key encryption.
In secret key encryption, there is a shared secret password or passphrase known to all parties that need access to the encrypted information. This single key is used to both encrypt and decrypt the information. The data encryption standard (DES), which the Unix crypt system call uses to encrypt passwords, is an example of a private key encryption method.
One problem with using secret key encryption for shared data is that all parties needing access to the encrypted data must know the secret key. While this is fine for a small workgroup of people, it can become unmanageable for a large network. What if one of the people leaves the company? Then you're going to have to revoke the old shared key, institute a new one, and somehow securely notify all the users that it has changed.
Public key encryption involves a public key and a private key. You publish your public key to everyone, while only you know your private key. If you want to send someone sensitive data, you encrypt it with a combination of your private key and their public key. When they receive it, they'll decrypt it using your public key and their private key. Depending on the software, public and private keys can be large—too large for anyone to remember. Therefore, they're often stored on the machine of the person using the encryption scheme. Because of this, private keys are typically stored using a secret key encryption method, such as DES, and a password or passphrase you can remember, so that even if someone gets on your system, they won't be able to see what your private key looks like. Pretty Good Privacy (PGP) is a well- known data security program that uses public key encryption; RSA is another public key system that is particularly popular in commercial products. The main disadvantage of public
A VPN is a conglomerate of useful technologies that originally were assembled by hand. Now the networking companies and ISPs have realized the value of a VPN and are offering products that do the hard work for you. In addition, there is an assortment of free software available on the Internet (usually for Unix systems) that can be used to create a VPN. In this book, we're going to look at some of the commercial and free solutions in detail. Which one you choose for your network will depend on the resources available to you, the platforms you run, your network topology, the time you wish to spend installing and configuring the software, and whether or not you want commercial-level support. We can't cover every vendor and product in this book; they change too quickly. Instead, we offer guidelines you can use on all networks and details on a few stable products that were available when we were writing this edition—we don't mean to imply that there's anything less valuable about competing products.
VPN packages range from software solutions that run on or integrate with a network operating system (such as the AltaVista Tunnel or CheckPoint Firewall-1 on Windows NT or Unix), to hardware routers/firewalls (such as those from Cisco and Ascend), to integrated hardware solutions designed specifically for VPN functions (such as VPNet and the Bay Networks Extranet Switch). Some VPN protocols, like SSH or SSL, gained popularity for performing other functions, but have since become used for VPNs as well.
In addition to products, ISPs are also offering VPN services to their customers. The tunneling usually takes place on the ISP's equipment. If both ends of the connection are through the same ISP, that ISP might offer a Service Level Agreement (SLA) guaranteeing a certain maximum amount of latency and uptime.
1.4.1 Quality of Service Issues
Running a virtual private network over the Internet raises an easily forgotten issue of reliability. Let's face it: the Internet isn't always the most reliable network, by nature. Tracing a packet from one point to another, you may pass through a half-dozen different networks of varying speeds, reliability, and utilization—each run by a different company. Any one of these networks could cause problems for a VPN.
The lack of reliability of the Internet, and the fact that no one entity controls it, makes troubleshooting VPN problems difficult for a network administrator. If a user can't dial into a remote access server at the corporate headquarters, or there's a problem with a leased line connection, the network administrator knows there are a limited number of possibilities for where the problem may occur: the machine or router on the far end, the telecommunications company providing the link, or the machine or router at the corporate headquarters. For a VPN over the Internet, the problem could be with the machine on the far end, with the ISP on the far end, with one of the networks in between, with the corporate headquarters' ISP, or with the machine or router at the corporate headquarters itself. Although a few large ISPs are offering quality of service guarantees with their VPN service (if all parties involved are connected to their network), smaller ISPs can't make such a guarantee—and there will always be times when the network administrator is left to her own resources. This book will help you isolate and identify the problem when something goes wrong on your VPN.
The notation 1.0.0.0/24 is commonly used in describing IP address ranges. It means "start with the address 1.0.0.0 and allow the right-most 8 bits to vary." The 8 is calculated by using 32 bits (the maximum for an IP address) minus 24 (the size specified after the "/"). So 1.0.0.0/24 means all addresses from 1.0.0.0 to 1.0.0.255.
We've elected to use the same IP address ranges and domain name throughout this book. For Internet-routable IP address ranges, we're using the blocks 1.0.0.0-1.255.255.255 (or 1.0.0.0/8) and 2.0.0.0-2.255.255.255 (2.0.0.0/8), which we subnet to suit our needs. These ranges were chosen because they are designated as Internet routable, but are reserved by the IANA and aren't currently being used. We hope that using these ranges, rather than randomly picking some or choosing them from "active" registered networks, will makes examples and figures easier to understand while protecting the innocent. We found that this helped us maintain our own sanity while writing the book.
For internal networks, we use the IP ranges set aside in RFC 1918 for use on private networks. These ranges are 10.0.0.0-10.255.255.255 (or 10.0.0.0/8), 172.16.0.0- 172.31.255.255 (or 172.16.0.0/12), and 192.168.0.0-192.168.255.255 (or 192.168.0.0/16). We also subnet these as we deem necessary for an example.
The domain name we use for our examples is ora-vpn.com. Within this domain, however, we don't have a hostname convention, because we typically create a hostname to match whatever solution we are writing about in a given chapter.
classified documents. The criteria for determining how a governmental computer should be protected were detailed in the fabled "Orange Book." It stated that to secure highly sensitive data, one must never connect the computer to an exterior network. This is of course the best firewall strategy that exists, but it is too restrictive to be practical. We know the value of interconnection like the rest of you; we just want you to realize that the best firewall for extremely sensitive materials is to isolate them on a computer without a network connection at all.
Firewalls usually serve two main functions for a network administrator. The first is to control which machines an outsider can see and the services on those machines with which he can converse. The second controls what machines on the Internet an internal user can see, as well as what services he can use. A firewall is much like a traffic cop, organizing which paths network traffic can take, and stopping some altogether. Internet firewalls usually do this by inspecting every packet that tranverses the gateway router, which is why they are usually referred to as "packet filtration" systems.
Watch out for possible circumvention techniques. The best firewall in the world won't do you a bit of good if there is some backdoor or circumnavigational route the attacker can take. Take care to protect the remote access systems (such as PPP, SLIP, and ARA servers) that allow users to dial directly into your private network. Remember that hackers will try to take these avenues into your site if you allow them. By avoiding the gateway firewalls and all of your cleverly erected traps and pitfalls, a system cracker has only to dial in with a compromised account to gain access to services against which your exterior gateway firewall can't protect. Remember that your firewall is only as strong as its weakest point. No one security package is a comprehensive solution for all of the services your network provides. It is important to conduct an ongoing audit of your access policies and police your site regularly in concert with researching vulnerabilities as they become discovered.
For this chapter, we will use our large branch network as an example. We will further assume that we have a Cisco 2500 series router and 40 workstations. Of the 40 computers, three are servers: one FTP server, one mail server, and one web server. We have a full class C address (2.48.29.0/24) allocated to us from the NIC (Network Information Center); we will be presenting examples throughout this section on how to set up different firewall topologies using our 40 machines and the network provided earlier. Figure 2-1 illustrates what the firewall will be doing in a basic sense for both our large branch as well as our main corporate network (at the top).
Figure 2-1. A typical firewall
2.1.2 What Types of Firewalls Are There?
Since almost all firewalling techniques are designed around a similar model, a centralized point of control, there are only a few variations at the top level that need to be explored. You are probably already familiar with the packet filtration firewall; most people are these days, given the recent attention paid to it by the news media. In this section we will discuss the operation and configuration of four architectures of firewall design. There are many variations of the four that you may have seen implemented, and certainly we are omitting several of the most complex and advanced architectures. But we hope to familiarize you with what a firewall is, how it works, how to set one up, and, most relevant to this book, how it fits into the world of the virtual private network.
2.1.2.1 Packet restriction or packet filtering routers
Routers and computers that conduct packet filtration choose to send traffic to a network based on a predefined table of rules. The router does not make decisions based on what's inside the packet's payload, but rather on where it is coming from and where it is destined. It only considers that if the packet matches a set of parameters, it should take appropriate action to either allow or deny the transit. These allow and deny tables are set up to conform to the