Virtual Private Networks

Imagine you are out of the office and need to access a printer or file server on the office network. Unless you dial in to the company’s server, it is not possible for you to access the resources in the office. Moreover, using a dial-up line is not a cheap alternative (despite the slow speed), especially if you are overseas.

A Virtual Private Network (VPN) allows you to establish a secure, encrypted connection to the office’s network, all through a public network such as the Internet. Using a VPN, you can work as though you are connected to your company’s network.

There are two main types of VPN:

User-to-Network

This type allows a client to use a VPN to connect to a secure network, such as a corporate intranet.

Network-to-Network

This type connects two networks via a VPN connection. This effectively combines two disparate networks into one, eliminating the need for a Wide Area Network (WAN).

Tunneling

Tunneling is the process of encapsulating packets within other packets to protect their integrity and privacy during transit. A tunnel performs such tasks as encryption, authentication, packet forwarding, and masking of IP private addresses. Figure 4-1 shows a tunnel established between two computers through the Internet. Think of a tunnel as a private link between the two computers: whatever one sends to another is only visible to the other, even though it is sent through a public network like the Internet.

A tunnel established between two computers in a VPN

Figure 4-1. A tunnel established between two computers in a VPN

The following section discusses some tunneling protocols available for VPNs.

PPTP, L2TP, and IPSec

If you’re curious about what goes on under the hood of a VPN, there are three protocols that you need to know: PPTP, L2TP, and IPSec:

Point-to-Point Tunneling Protocol (PPTP)

This was designed by Microsoft (and other companies) to create a secure tunnel between two computers. PPTP provides authentication and encryption services, and encapsulates PPP packets within IP packets. It supports multiple Microsoft networking protocols such as LAN to LAN and dial-up connections. However, it is proprietary and the encryption is weak.

Layer 2 Tunneling Protocol (L2TP)

This works like PPTP, except that it does not include encryption. L2TP was proposed by Cisco Systems, and like PPTP, supports multiple networking protocols.

IPSec

This addresses the shortcomings of L2TP by providing encryption and authentication of IP packets. As such, L2TP is often used together with IPSec to provide a secure connection.

Tip

If possible, a VPN should be used together with 802.1X. 802.1X adds an additional layer of protection that the VPN itself does not possess. For more information on VPNs, see Virtual Private Networks (O’Reilly).

Setting Up a VPN Connection Between Two Computers

In the following sections, I illustrate how to set up a VPN host as well as a client using two Windows XP Professional systems.

On the host computer

Let’s start with setting up the VPN host:

  1. On the desktop, right-click on Network Connections.

  2. Select “Create a new connection”.

  3. In the New Connection Wizard window, select “Set up an advanced connection” (see Figure 4-2). Click Next.

    Choosing the network connection type

    Figure 4-2. Choosing the network connection type

  4. Select “Accept incoming connections”. Click Next.

  5. In the next window, you can select the other devices to accept the incoming connection. Click Next.

  6. Select “Allow virtual private connections” and click Next (see Figure 4-3).

    Allowing a VPN connection

    Figure 4-3. Allowing a VPN connection

  7. Select the users that you want to allow to connect to your computer using the VPN connection (see Figure 4-4). Click Next.

    Granting access rights to users

    Figure 4-4. Granting access rights to users

  8. The next window allows you to install additional networking software for this connection (see Figure 4-5). Click on Next to go to the next screen.

    Installing the networking software for the VPN connection

    Figure 4-5. Installing the networking software for the VPN connection

  9. Click on Next and then Finish to complete the process.

On the client

To configure Windows XP to connect to a VPN:

  1. On the desktop, right-click on Network Connections.

  2. Select “Create a new connection”.

  3. Select “Connect to the network at my workplace” (see Figure 4-6).

    Selecting the network connection type

    Figure 4-6. Selecting the network connection type

  4. Select “Virtual Private Network connection” (see Figure 4-7). Click Next.

    Selecting the network connection

    Figure 4-7. Selecting the network connection

  5. Enter a name for the VPN connection (see Figure 4-8). Click Next.

    Giving your VPN connection a name

    Figure 4-8. Giving your VPN connection a name

  6. Select “Do not dial the initial connection”. Click Next.

  7. Enter the IP address of the VPN server (see Figure 4-9). Click Next.

    Specifying the IP address of the VPN host

    Figure 4-9. Specifying the IP address of the VPN host

  8. Select “My use only” (see Figure 4-10). Click Next.

    Setting the connection availability

    Figure 4-10. Setting the connection availability

  9. Turn on the “Add a shortcut to this connection to my desktop” checkbox. Click Finish.

That’s it! When the process is completed, an icon is shown on the desktop (see Figure 4-11).

The icon for the VPN connection

Figure 4-11. The icon for the VPN connection

To connect to the VPN server, double-click on the icon and log in with your username information (see Figure 4-12). You can now work as though you are working on a computer in your office: most (if not all) of your network resources, such as file and print servers, will be accessible.

Warning

Resist the temptation to check the box titled “Save this user name and password for the following users” (see Figure 4-12). If you enable this, your password will be saved on your computer; if your computer is stolen or compromised, an attacker will be able to connect to the VPN and access everything it protects.

Logging in to a VPN connection

Figure 4-12. Logging in to a VPN connection

Tip

One common error that you might encounter has to do with setting a proxy server in Internet Explorer. For example, my ISP does not require me to use a proxy server when surfing the Web. But when I connected to the VPN server in my workplace, I was suddenly unable to connect to the Web. As it turns out, my company requires me to use a proxy server to connect to the Web. With the proxy server configured in IE (Tools Internet Options Connections Connection Name Settings), I am now able to connect to the Web (see Figure 4-13).

Setting a proxy server for a VPN connection

Figure 4-13. Setting a proxy server for a VPN connection

Get Windows XP Unwired now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.