Understanding VPN
You have seen SSH in action, providing a secure, encrypted connection over an
This process is known as creating a virtual private network (VPN). A VPN can consist of a single host connecting to a private network, or an entire remote site connecting into a private network, in both cases using VPN security protocols over an insecure network (such as the Internet). The following figure shows a VPN connection from a client computer to an internal corporate network using NAT for IP addressing (shown at the bottom). The client machine has both a public IP address 17.187.175.4 (provided by an ISP, either at home, or at a hotel, or at a remote site) and a private VPN address 10.1.1.100 on the internal network (provided by the VPN server after authentication). Note that transactions to the internal network go through the VPN pipe, but non-VPN connections get blocked at the VPN/firewall server and are not allowed internal access.
An attacker can snoop the non-VPN network transactions but will see only encrypted gibberish while observing the VPN connection. You will see later that when you create a VPN connection, you have full control over which packets get sent over the VPN and which get sent over the public network. VPN comes in a variety of flavors and textures, featuring various authentication schemes and transport protocols. VPN Transport ProtocolsMac OS X and Mac OS X Server support two transport protocols:
A Mac OS X system may have multiple connection profiles to different VPN servers (which may or not be using Mac OS X Server), each using either one or the other of these transport protocol for connectivity. Mac OS X Server can provide VPN services using one or both of these protocols. Before you learn how to implement VPN connectivity in Mac OS X and Mac OS X Server, let's take a look at each transport protocol in detail. L2TPL2TP is the more secure of the two protocols. The default configuration is L2TP/IPSec, which supports a shared secret mechanism. You can also use certificates instead of shared secrets, which you will find out how to do later in this lesson. PPTP
PPTP, which was developed by Microsoft, provides more compatibility with older Windows clients. It supports both 40-bit and 128-bit encryption, but unless you need to support older Windows
Note Regardless of the protocol used to connect to the VPN server, you should enable all traffic to go over the VPN. In the Internet Connect application, choose Connect > Options and select the "Send all traffic over the VPN connection" checkbox. Authentication MethodsBecause different organizations require different levels of authentication security, VPN supports several authentication schemes. On Mac OS X Server, the default authentication protocol is MS-CHAPv2. MS-CHAPv2
MS-CHAPv2 is a
KerberosBeginning with Mac OS X 10.4, Kerberos VPN authentication is supported with L2TP.
|
|
1. |
On Mac OS X Server, launch Server Admin and authenticate.
|
|
2. |
From the Computers & Services list, select VPN.
|
|
3. |
Click the Settings button.
|
|
4. |
Click the L2TP tab.
|
|
5. |
Select the "Enable L2TP over IPSec" checkbox.
|
|
6. |
Select Starting IP address and Ending IP address blocks.
|
|
7. |
Make sure the PPP Authentication pop-up menu is set to MS-CHAPv2.
|
|
8. |
Make sure the Shared Secret radio button is selected.
|
|
9. |
Enter a shared secretthis should be an extremely-difficult-to-guess password. (It will be entered only once on the client side, as shown in a later exercise.)
|
|
10. |
Click Save.
|
You are not done setting up VPN yet, but if this is the only configuration you want, skip ahead to the exercise on setting up client information.
In this exercise, you will configure L2TP over IPSec to instead use Kerberos for PPP authentication and use a certificate for IPSec authentication:
|
1. |
Execute steps 1 through 6 from the previous exercise.
|
|
2. |
For PPP Authentication, choose Kerberos.
|
|
3. |
For IPSec Authentication, select the Certification radio button.
|
|
4. |
Choose a pre-existing certificate from the pop-up menu.
|
|
5. |
Click Save.
|
PPTP configuration is straightforward in Mac OS X Server, because Server Admin offers only a few simple configuration options. As with L2TP, you must first select a block of IP addresses that the VPN system will vend to clients as they attach, similar to what a DHCP server does. Again, it is very important that the IP address range you select is not already assigned statically or allocated to a DHCP, VPN, or other type of server elsewhere.
|
1. |
On Mac OS X Server, launch Server Admin and authenticate.
|
|
2. |
From the Computers & Services list, select VPN.
|
|
3. |
Click the Settings button.
|
|
4. |
Click the PPTP tab.
|
|
5. |
Select Enable PPTP.
|
|
6. |
Enter a Starting IP address and Ending IP address block.
|
|
7. |
Optionally, select the checkbox allowing for 40-bit encryption keys.
|
|
8. |
Click Save.
|
As mentioned earlier, you can configure VPN on OS X Server to support two-factor authentication.
In this exercise, you will add support for SecurID:
|
1. |
Launch a command-line shell on Mac OS X Server.
|
|
2. |
Create the folder /var/ace:
cd / sudo mkdir var/ace |
|
3. |
Copy the SecurID configuration file sdconf.rec from your SecurID server to the /var/ace folder.
|
|
4. |
Enable EAP-SecurID authentication by typing in the following commands, one at a time, all on one line without paragraph breaks:
[View full width]
|
|
5. |
Exit your command-line shell.
|
With Server Admin, you can configure your clients to receive not only an IP address, but also default DNS server and search domain
To configure VPN to provide a default DNS server of 10.1.1.1 and a default search domain of pretendco.com, perform these steps:
|
1. |
On Mac OS X Server, launch Server Admin and authenticate.
|
|
2. |
From the Computers & Services list, select VPN.
|
|
3. |
Click the Settings button.
|
|
4. |
Click the Client Information tab.
|
|
5. |
In the "DNS servers" text box, enter PretendCo's default VPN DNS server of
10.1.1.1
.
|
|
6. |
In the "Search domains" text box, enter
pretendco.com
.
|
|
7. |
Click Save.
|
With Server Admin, you can also configure public and private routing for VPN users. This ensures that public IP address routing, which does not require a VPN tunnel, does not waste VPN resources, and also that private network traffic is required to be on the private VPN network.
When packets are sent through a VPN tunnel, this results in a load on the VPN server for encrypting/
In this exercise, you will configure the network so that packets destined for 10.1.1/24 go through the VPN server, and packets destined for 17/8 do not:
|
1. |
On Mac OS X Server, launch Server Admin and authenticate.
|
|
2. |
From the Computers & Services list, select VPN.
|
|
3. |
Click the Settings button.
|
|
4. |
Click the Client Information tab.
|
|
5. |
Click the plus sign under the Network Routing Definitions table.
|
|
6. |
In the sheet that appears, enter
10.1.1.0
for the address and
255.255.255.0
for the subnet mask; then choose Private from the Type pop-up menu.
|
|
7. |
Click OK.
|
|
8. |
Again, click the plus sign under the Network Routing Definitions table.
|
|
9. |
In the sheet that appears, enter
17.254.0.0
for the address and
255.255.0.0
for the subnet mask; then choose Public from the Type pop-up menu.
|
|
10. |
Click OK.
|
|
11. |
Click Save and start the VPN service.
|
Mac OS X and Mac OS X Server users connect to VPN servers using the Internet Connect program located in /Applications.
In this exercise, you will connect to a VPN server:
|
1. |
Launch Internet Connect (located in /Applications).
|
|
2. |
Click the VPN icon.
|
|
3. |
In the sheet that appears, select "L2TP over IPSec" and click Continue.
|
|
4. |
In the sheet that appears, choose Edit Configurations from the Configuration pop-up menu.
|
|
5. |
In the sheet that appears, enter a new description, something like
L2TP host.pretendco.com
.
|
|
6. |
Enter the following:
|
|
7. |
Click OK.
|
|
8. |
Click Connect.
|