SecureOps Inc.

 

How to set up a basic VPN
between two OpenBSD gateways using ISAKMP

 

By Patrick Ethier
Series editor / Graphic artist: Jesse Corbeil

 

 

Table of Contents

1.0 DISCLAIMER AND CONVENTIONS
1.1 Disclaimer
1.2 Conventions
2.0 WHAT IS A VPN?
2.1 Concept behind a VPN
2.2 Why use a VPN?
2.3 What does ISAKMP do for you?
3.0 EXAMPLE SCENARIO
3.1 The basic VPN
3.2 Our goal
4.0 STEP BY STEP SETUP OF THE VPN
4.1 Preparing your internal network nodes for the VPN
4.2 Making sure you have all the proper files
4.3 Preparing both gateways for the VPN.
4.4 Editing the keynotes policy file
5.0 CONFIGURING ISAKMP
5.1 A basic VPN using ESP only
5.2 Starting your VPN
5.3 Stopping the daemon and flushing IPSEC routes
6.0 TROUBLESHOOTING YOUR VPN CONNECTION
6.1 Basic troubleshooting
6.2 Odd errors that are normal
7.0 EXPANDING THE VPN
8.0 ISAKMP, IPSEC, OPENBSD, AND OTHER TECHNOLOGIES
9.0 USEFUL LINKS
10.0 CREDITS:

How to set up a basic VPN between two OpenBSD gateways using ISAKMP

Note that this is by no means a replacement to the related MAN pages but rather an addition. Most of the information provided in this document is either a direct copy or a paraphrase of these MAN pages.
As a reference, please read the vpn(8),isakmpd(8),isakmpd.conf(5),isakmpd.policy(5) and the RFCs mentioned within these documents along with this Howto.

1.0 Disclaimer and Conventions

1.1 Disclaimer

This text was compiled by either paraphrasing or quoting the relevant sections of the following man pages: IPSec(4), vpn(8), isakmpd(8), isakmpd.conf(5), isakmpd.policy(5). Other information was also obtained from http://www.openbsd.org/faq/faq13.html and the various RFCs mentioned in the above documents.
This document is by no means an endorsement that the scenario presented in this document is the most efficient and secure way to set up a VPN. This document's intent is to provide a basic knowledge of how VPNs work. By using the information provided in this document, the reader acknowledges that the author and/or maintainer of this document cannot be held accountable for any misuse and/or ill effects caused by following the procedures herein.
The domain and hostnames used in this document are not fictional. They are property of the author and/or SecureOps Inc. Please do not use the domain names mentioned in this example for your personal or corporate use without the consent of either the author and/or SecureOps Inc.

1.2 Conventions

The shell used in this text is the Korne shell (/usr/bin/ksh). The author uses the default prompt ($) followed by the command in a bold text to demonstrate the command line that should be used. For example, getting a listing of files would be displayed as following:
$ls
Text that is in Text Editor Mode is represented in Courier. Lines of relevant or of interest are in Courier bold.
Section names that are referred to by the isakmpd.conf MAN page are in <triangular quotes and italicised>
Text in the isakmpd.conf file is preceded by either a S>or a R>, depending on whether the server in question isSlippery (S>) or Ragweed(R>).
Host names and IP addresses in the text are in bold font.

2.0 What is a VPN?

A Virtual Private Network (or VPN) allows you join two private networks that are separated by the Internet or other publicly accessible network.

2.1 Concept behind a VPN

1. Let us say that you have a small office with 4 computers in the Production department. You would network these four computers with Ethernet cards so you can share printers and disk drives. You use IP protocols for the simple reason that you might want to expand some day.

2. A few months later you install four more computers for the Accounting department. You decide to differentiate between your two departments by segmenting them. You assign 192.168.10.X to one side and 192.168.20.X to the other.

3. According to the laws of IP, if these two networks decide they wish to speak to each other you must introduce a Gateway between to route the packets from one subnet to the other. This gateway, most often called a router, is the basis of connecting networks together to form the Internet.

4. A VPN acts exactly like this router. Imagine that 192.168.10.X and 192.168.20.X are in different locations. Take a chainsaw and split the Router box in half. By doing so you would split the functionality of the single router into two separate routers. Then link these two halves through a public network containing public routable IPs (such as the Internet). Both your network segments would still be able to talk to each other through a virtual tunnel even if they are separated by a great distances. Provided you have made the tunnel secure, you now have a VPN.

2.2 Why use a VPN?

The Internet as it stands is a fairly hostile place. In order to keep your information safe, your VPN must be able to insure the following:
1. Confidentiality - Make sure it is hard for anyone but the receiver to understand what data has been communicated. You do not want anyone to see your passwords when logging into a remote machine over the Internet.
2. Integrity - Guarantee that the data does not get changed on the way. If you are on a line carrying invoicing data you probably want to know that the amounts and account numbers are correct and not altered while in-transit.
3. Authenticity - Sign your data so that others can see that it is really you that sent it. It is clearly nice to know that documents are not forged.
4. Replay protection - You need a way to ensure a transaction can only be carried out once there authorisation to repeat it.
(Taken from the OBSD IPSec(4) man page)
These are all provided by modern VPN technologies today. A popular method of fulfilling the above requirements is to create a VPN with IPSec tunnels.

2.3 What does ISAKMP do for you?

ISAKMP (or IKE) is the key exchange mechanism for the VPN. It meets security concerns using the methods mentioned in RFC 2407, RFC 2408 and RFC 2409. ISAKMP manages the exchange of cryptographic keys that you would normally have to manually manage with ipsecadm(8)*. It employs a two-phase process for establishing the IPSec connection between two gateways.

Phase 1 - The two ISAKMP peers establish a secure, authenticated channel upon which to communicate between two daemons. This establishes a Security Association (SA) between both hosts. Main Mode and Aggressive Mode are the methods used to establish this channel. Main Mode sends the various authentication information in a certain sequence, providing identity protection. Aggressive Mode does not provide identity protection because all of the authentication information is sent at the same time. Aggressive mode should only be used in such cases where network bandwidth is of concern.
Phase 2 - Security Associations are negotiated on behalf of services such as IPSec or any other service that needs key material and/or parameter negotiation. Phase 2 is basically establishes the VPN link between the hosts behind your gateways by creating the VPN tunnel. Quick Mode is used in Phase 2 because there is not need to repeat a full authentication because Phase 1 has already established the SAs.

In brief, Phase 1 is used to get a secure channel in which to do the (quicker) phase 2 setups, there can be several. Phase 2 is used to setup the actual VPNs.**

This may sound a bit confusing at first but it makes sense. Phase 1 is basically where your two gateways establish a connection where they exchange authentication (Either a X509 certificate or a pre-shared secret). This allows each end to make sure the other end is who they say they are. Phase 2 is an exchange of keys to determine how the data between the two will be encrypted. In other words, Phase 1 is analogous to your phone ringing, you answering and 'Hi John, it's Jane.' Phase 2 is the determination of the language you are going to use to continue your conversation.

* See the OBSD FAQ for a lesson on how to use that method instead.
** Quoted from email by HÂkan Olsson to Patrick Ethier on Dec 21st 1999.

3.0 Example Scenario

3.1 The basic VPN

We are assuming that the average user will want to install their VPN gateway on the machine that directly connects their network to the Internet. Note that installing the VPN software directly on your gateway may not necessarily be a great idea, but in this case it offers the simplest scenario.
To make our life easy, I will not assign any IP addresses in this scenario. Please refer to the following diagram for host and network names used in this example.

3.2 Our Goal

We want the Badplants.com Private Network to be able to communicate with Carefull.com's Private Network to make use of their Printer Server. We don't want anybody from the outside world (aka the Evil Internet) to be able to see what we are trying to print, or even be able to acknowledge the fact that we are printing at all.

4.0 Step by Step Setup of the VPN

4.1 Preparing your Internal Network nodes for the VPN

This should already be done if you are using your OpenBSD box as a Gateway. All your network nodes need to have their default gateway set to Slippery - Private IP and Ragweed - Private IP respectively.

4.2 Making sure you have all the proper files.

By default, OpenBSD 2.6 comes with the proper binaries for ISAKMP and the IPSec stack. Unfotunately, the same cannot be said for the sample files. To retrieve them, do the following:
$ cd /usr/src
$export CVSROOT=anoncvs@anoncvs1.ca.openbsd.org:/cvs
$export CVS_RSH=/usr/bin/ssh*
$cvs get src/sbin/isakmpd/samples
$cp /usr/src/src/sbin/isakmpd/samples/VPN-east.conf /etc/isakmpd.conf
$cp /usr/src/src/sbin/isakmpd/samples/policy /etc/isakmpd.policy

By executing the above on both Ragweed and Slippery, you should have the following files in your OPenBSD 2.6 tree:
/etc/sysctl.conf
/etc/isakmpd.policy
/etc/isakmpd/isakmpd.conf

* (Note: this is where OBSD2.6 stores SSH by default, use $find / -name ssh to find the ssh binary if it is not in the default location)

4.3 Preparing both Gateways for the VPN.

Edit the /etc/sysctl.conf file:

$vi /etc/sysctl.conf

# $OpenBSD: sysctl.conf,v 1.10 1999/04/11 19:41:33 niklas Exp $
# This files contains a list of sysctl options the user wants set at
# boot time.
# ie.
#net.inet.ip.forwarding=1
#net.inet.tcp.rfc1323=0
#net.inet.esp.enable=1
#net.inet.ah.enable=1

#ddb.panic=0
#ddb.console=1
#fs.posix.setuid=0
machdep.allowaperture=1
#machdep.apmwarn=10
# 1=Permit forwarding (routing) of packets
# 0=disable TCP RFC1323 extensions (for if tcp is slow)
# 1=Enable the ESP IPSec protocol
# 1=Enable the AH IPSec protocol

# 0=Do not drop into ddb on a kernel panic
# 1=Permit entry of ddb from the console
# 0=Traditional BSD chown() semantics
# 1=On i386, permit access to aperture driver for XFree86
# battery % when apm status messages enabled

Uncomment the lines:
net.inet.ip.forwarding=1
net.inet.esp.enable=1

This will enable IPSec and IP Forwarding. Note that we do not need to enable AH in this case because we are not using it. AH stands for Authentication Header. Read ipsec(4) for more information. If your are using transforms that have AH mentioned, then you should enable this feature. AH is not required and does not encrypt the payload data (The fancy term for the data you are transferring over the Internet). AH simply provides for a better authentication of each packet.

4.4 Editing the KeyNotes Policy file

This file tells ISAKMP who can access IPSec. In this scenario, the isakmpd.policy file states that anybody who sends data using Encapsulate Security Payload(ESP), and has authenticated with the passphrase mekmitasdigoat (or whatever passphrase you determine), is allowed to use the IPSec stack. We can modify this file to let ISAKMP know that we only want to allow data signed with certain digital certificates or using a certain encryption transform. We can also go to the other extreme and allow anybody to access IPSec. All you would need then is:

$ vi /etc/isakmpd.policy

KeyNote-Version: 2
Authoriser: "POLICY"

The sample file supplies what I consider to be to "minimum" security constraints. Unfortunately, there is a problem with the original sample policy file. It contains 2 lines of code that are not supported by keynote(5). Fortunately, we can fix this. Delete the two lines in question (As far as I know, these are added for CVS):

$ vi /etc/isakmpd.policy

KeyNote-Version: 2
Comment: This policy accepts ESP SAs from a remote that uses the right password
OpenBSD: policy,v 1.3 1999/11/18 21:45:52 angelos Exp $
$EOM: policy,v 1.3 1999/08/26 11:51:37 niklas Exp $
Authoriser: "POLICY"
Licensees: "mekmitasdigoat"
Conditions: app_domain == "IPSec policy" &&
esp_present == "yes" -> "true";

Remove the lines:
$OpenBSD: policy,v 1.3 1999/11/18 21:45:52 angelos Exp $
$EOM: policy,v 1.3 1999/08/26 11:51:37 niklas Exp $

5.0 Configuring ISAKMP

5.1 A basic VPN using ESP only

Like we mentioned before, this is the basic example taken straight out of the isakmpd.conf MAN page. Implementing this will give you a basic VPN using ESP only. I will explain as we go along why we are making the changes. I will leave it up to some other brave fellow to further personalise this.
This file is in the traditional .ini format. My guess is that it was inspired from M$ windows 3.11 and win95. Let's not flame this. It works rather well. Anything in block quotes ([ ]) is a section name. Each section has tag=value pairs. This is explained rather weirdly in the man page but don't worry, you'll get the hang of it soon enough.
$ vi /etc/isakmpd/isakmpd.conf
Don't include the <MAN Name section Page> in your actual configuration file.
Please note: I use S> for text coming from Slippery and R> for text on Ragweed S/R> is for text on both hosts.
S>[General] <GENERAL >
S>Retransmits= 5
S>Exchange-max-time= 120
S>Listen-on= Slippery_Internet_IP

R>[General] <GENERAL >
R>Retransmits= 5
R>Exchange-max-time= 120
R>Listen-on= Ragweed_Internet_IP

This is where we set up the variables that will affect the main behaviour of our VPN. It is okay to use the defaults here.
The Listen-on= value is the only tag= value worth mentioning. This is basically the IP that ISAKMPD should bind to. Only the Internet IP of our gateway is necessary here because our Private IP has no need to connect to ISAKMPD. If we were to have multiple external interfaces on our gateway, we could list which interfaces we want to be listening by entering them using a comma separated list.
<PHASE 1 >
S>[Phase 1]
S>Ragweed_Internet_IP= Ragweed

R>[Phase 1]
R>Slippery_Internet_IP= Slippery

This section describes the Source IP addresses to accept in order to negotiate the phase 1 connection. Its value points to the <ISAKMP-PEER> section below (Remember that phase 1 simply authenticates the remote peer to make sure they are who they say they are). You can list multiple peers as IP_Address= <ISAKMP-PEER>.
<PHASE 2 >
S>[Phase 2]
S>Connections= Slippery-Ragweed

R>[Phase 2]
R>Connections= Ragweed-Slippery

This describes Phase 2 of the connection. This is the phase that determines what language the two peers will use to communicate.

The Connections= tag refers to the <IPSEC-CONNECTION> section name mentioned below. It initiates the requirements or the accepted methods to set up Phase 2. This also tells ISAKMPD which connections to initiate once started. Note that you can have multiple <IPSEC-CONNECTION> sections here separated by a comma if you are to connect with multiple peer hosts.

Note that if you do not have the IP address of the remote host, you can specify a Default= that points to a section describing a GENERIC <IPSEC-CONNECTION> that will be referenced by any incoming IP that is not listed in the Connections= tag.
<ISAKMP-PEER>
S>[Ragweed]
S>Phase= 1
S>Transport= udp
S>Local-address= Slippery_Internet_IP
S>Address= Ragweed_Internet_IP
S>Configuration= Default-main-mode
S>Authentication= mekmitasdigoat
S>#Flags=

R>[Slippery]
R>Phase= 1
R>Transport= udp
R>Local-address= Ragweed_Internet_IP
R>Address= Slippery_Internet_IP
R>Configuration= Default-main-mode
R>Authentication= mekmitasdigoat
R>#Flags=

These represent the sections referred to by the <PHASE 1> section above. They each describe the requirements that the peer gateway must fulfil in order to proceed to Phase 2. There are many other options here but the ones mentioned above are the minimum requirements.
Phase=1 is required because the ISAKMPD code uses the same procedures to process Phase 1 and Phase 2. It must be 1 or nothing will work.
Transport= is just a way of giving you different possibilities for different peers. It's suggested that udp be used here so we'll leave it at that.
Please note that some peers may be behind a firewall that doesn't let UDP traffic through.
Local-address is the destination address that the incoming packets point to. In some cases, you can be listening on different Interfaces for Phase 1 connections. (See the <GENERAL>:Listen-on = variable). In this case, we only have 1 interface listening, therefore this is the IP of the listening interface on this peer.
Address= is the address that points to the source IP of the incoming packets. This usually points to the peer gateway. This needs further explanation, because the question arises 'What if the source IP is dynamic? How would Phase 1 be negotiated?'
Configuration= points to the <ISAKMP-CONFIGURATION> section below. You can specify different <ISAKMP-CONFIGURATION> sections for different peers. We use the default one specified by the sample file.
Authentication= is the pre-shared secret to be used for this particular peer. It is more or less a passphrase that each peer uses. This passphrase gets passed to isakmpd.policy to verify whether this peer is allowed to use IPSEC with this host. If you change this phrase, you must also change it in the isakmpd.policy file because the sample file provides for this passphrase. If you decided to go with a minimum policy file then you can specify whatever you want here.
Flags= is not currently being used. The RFC leaves room for extra options to be specified for phase 1.
There are other tags here that will allow for other options to be set. Refer to the isakmpd.conf MAN page for descriptions.
<IPSEC-CONNECTION>
S>[Slippery-Ragweed]
S>Phase= 2
S>ISAKMP-peer= Ragweed
S>Configuration= Default-quick-mode
S>Local-ID= Net-Carefull
S>Remote-ID= Net-Badplants


R>[Ragweed Slippery]
R>Phase= 2
R>ISAKMP-peer= Slippery
R>Configuration= Default-quick-mode
R>Local-ID= Net-Badplants
R>Remote-ID= Net-Carefull

These represent the sections referred to by the <PHASE 2> section above. They are the individual settings that ISAKMPD must use to talk between the two gateways for the particular connection.
Phase=2 is required because ISAKMPD code uses the same functions to authenticate Phase 1 and Phase 2. This is required for the VPN to work.
ISAKMPD-Peer= is the name of a <ISAKMP-PEER> section above. This means that we are talking to that particular peer to establish a Phase 2 connection. This is provided because you can have multiple <ISAKMP-PEER> sections and <IPSEC-CONNECTION> sections.
Configuration= refers to the <IPSEC-CONFIGURATION> section below that describes the standards by which this host and the particular peer for this connection must abide.
Local-ID= refers to a <IPSEC-ID> section below that describes our Private Network to the peer gateway. This is the portion that is passed so that the other gateway can set up the proper routing table that will transfer data over the VPN to our network.
Remote-ID= refers to a <IPSEC-ID> section below that describes what is supposed to be the remote Private Network to our host. This portion is interpreted to set up the proper routing tables that will transfer data from our Private Network over the VPN to the remote Private Network.
There is another tag that is supported here called Flags=. If you require this tag, read the isakmpd.conf MAN page.
>IPSEC-ID>
S/R>[NET-Badplants]
S/R>ID-type= IPV4_ADDR_SUBNET
S/R>Network= Badplants_Private_Network_Address
S/R>Netmask= Badplants_Private_Subnet_Mask

S/R>[NET-Carefull]
S/R>ID-type= IPV4_ADDR_SUBNET
S/R>Network= Carefull_Private_Network_Address
S/R>Netmask= Carefull_Private_Subnet_Mask

These two sections are in the conf file of each host. They are the sections referenced by the Local-ID and Remote-ID of the <IPSEC-CONNECTION> section. They describe the routes that should be set up to allow traffic from one private network to another.
Remember the router that we chain-sawed in half at the beginning of this text? Well, these two sections describe the routing that you would have to put into this router for both Private Networks to talk to each other.
ID-type= can be IPV4_ADDR_SUBNET or IPV4_ADDR (RFC2708 mentions more possible values but I have no clue if they are supported or not by this implementation). Depending on which it is, the following two tags may or may not be used. I discuss IPV4_ADDR_SUBNET in this case because this is the default method used to get one private network to talk to the other.

<ISAKMP-CONFIGURATION>
S/R>[Default-main-mode]
S/R>DOI= IPSEC
S/R>EXCHANGE_TYPE= ID_PROT
S/R>Transforms= 3DES-SHA

This section describes the requirements for the encryption methods of Phase 1 connections. The name reflects the value of <ISAKMP-PEER>:Configuration= .As we can see here, we are stating our Domain of Interest which is IPSEC. The EXCHANGE_TYPE variable is set to ID_PROT for Phase 1, which identifies the protocols to be covered by this Authentication.
Transforms= is the transform required (or assigned) for this exchange. In this case, this points to a <ISAKMP-TRANSFORM> section in the configuration file that says we are receiving a packet encrypted with 3DES and a checksum verifiable with SHA. There are a bunch of different transforms defined inside the sample VPN-east.conf. These are provided because 3DES and SHA are not always supported across different platforms. For OpenBSD there should be no reason to change this for a basic setup. Feel free to create multiples of this section and change the transform. The only requirement is that you change <ISAKMP-PEER>:Configuration=<ISAKMP-CONFIGURATION>.
<ISAKMP-TRANSFORM>
S/R>[Default-quick-mode]
S/R>DOI= IPSEC
S/R>EXCHANGE_TYPE= QUICK_MODE
S/R>Suites= QM-ESP-3DES-SHA-PFS-SUITE,QM-ESP-DES-MD5-PFS-SUITE

This section describes the requirements for the encryption of the data to be sent through the VPN and is referred to by <IPSEC-CONNECTION>:Configuration above. Note the difference between this section and the Phase 1 equivalent just above is that the EXCHANGE_TYPE is QUICK_MODE. This is always the case for Phase 2.
The Suites= points to a <IPSEC-SUITE> section describing the different encryption schemes available between the two hosts.
There is much more to be said about ISAKMP and IPSec. By using the above basic descriptions you should be able to create a simple but solid VPN that cares and feeds itself. I am posting the bare minimum isakmpd.conf for both hosts here. I really suggest that you take the example VPN-east.conf and modify it as you read this text.

5.2 Starting your VPN

This is the exciting part. I suggest you use
$ isakmpd -d -DA=99
The first time you decide to run this daemon. The daemon will not be running in daemon mode but as a regular process. It will log everything to your console(stdout and stderror for you programmers out there). This will cause a million things to pop up on your screen. Read them all, try and interpret it, it's fun and a great learning experience too!
If all went well, switch to another terminal and you should see the following on the Slippery host:
$netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu Interface
Your regular routing table here&
Encap:
Source Port Destination Port Proto SA(Address/SPI/Proto)
0.0.0.0/32 0 Badpl_Priv_Net 0 0 Ragweed_INET_IP/SPI/50
Exterm_Priv_Net 0 BadPl_Priv_Net 0 0 Ragweed_INET_IP/SPI/50
And you should see the opposite from the Ragweed machine.
At this point you should be able to send a PING from Dandelion to Icy. If this ping works, and your Laser Printer Server supports IP, then all you have to do is install the Laser Printer on the Badplants.com workstations and start using it.
If all has worked well, edit your /etc/rc.conf file to have isakmpd=YES. This will bring up the VPN whenever OBSD is rebooted.

5.3 Stopping the daemon and flushing IPSec routes

To stop the ISAKMPD daemon
$ps -ax | grep -i isakmpd
Take the PID number and
$kill PID
Then flush your IPSec routes using
$ipsecadm flush
The ENCAP: portion of
$netstat -rn
should now be blank,
$netstat -an
should not display UDP 500 listening anymore either.

ragweed_isakmpd_conf.txt
slippery_isakmpd_conf.txt

6.0 Troubleshooting your VPN connection

6.1 Basic troubleshooting

If this didn't work don't despair. First, look back at your configuration file for typos. Then there are a few things you can try:
From Slippery:
'Verify that there is a Phase 1 transfer going through:
$ tcpdump -i EXT_IFACE host RAGWEED and port 500'
or
$tcpdump -v -s1500 port 500
The first will show any data coming or going to Ragweed on port 500-- which is the key exchange port. Start/Stop ISAKMPD on one end and verify that there is traffic. If there is traffic, and ISAKMPD does not return anything then your problem probably lies in your routing (Either Phase 2 or actual routing in your network).

The second will display the clear text parts of IKE. You should be able to tell most of what happens during the main mode transfer with this. (For a reference of what is supposed to happen, see section 4 of RFC2708).
If you get NO_PROPOSAL_CHOSEN, this means that one end is not meeting the requirements you have set up for the Phase 1 peer section. Verify your setup and the connection.

If you get nothing at all then try pinging RAGWEED from SLIPPERY. You may be experiencing a network outage of sorts. Unfortunately, although it is fairly powerful, a ISAKMP daemon cannot fix network outages.J

Verify that there is ESP traffic between the two hosts

$ tcpdump -i EXT_IFACE host RAGWEED and proto esp

Then switch to another console and start ping Dandelion. Switch back to the console that is displaying the TCPDUMP. You should see some traffic. If it is not coming back, check that the ENCAP: routes are correct on both ends. If they are not, then you have not entered them properly in your conf file.

6.2 Odd Errors that are Normal

In the OpenBSD implementation, there are a couple of anomalies that may appear to be errors but are just warnings due to the way that the whole process has been implemented.

Example: pf_key_v2_delete_spi: DELETE: No such process

"DELETE: no such process"
When you create a VPN, you create SAs (Security Associations) that go into the OpenBSD kernel (they are actually called tdb's there). Since not all systems that 'isakmpd' can run on support "in-kernel" expiration of SAs, the isakmp-daemon keeps track of when to remove the SAs. If, as in OpenBSD's case, the kernel does itself support these expirations, we get two parties that can remove SAs: the kernel and the isakmp-daemon. So, when our time limited SA is about to expire, both will try to remove it. If the kernel is slightly faster (normally this is what happens), isakmpd will try to remove a SA that just "disappeared". This is what produces the "DELETE: no such process" message.*

Example: exchange_run: unexpected payload HASH'
"exchange_run: unexpected payload HASH" (and ".... payload DELETE"):
The IKE protocol specifies notifications that can be exchanged between the two isakmp-daemons. A HASH payload that states that the notification is "correct" usually accompanies these exchanges. It was decided _not_ to add support to isakmpd to act on (or even understand) some notifications. One of these is the DELETE notification, which basically (if I remember) says that SA xxxxx has been removed, so please remove "your SA". As we only want SAs to be removed following our internal decisions, isakmpd does not care about receiving DELETE payloads from the outside. It does log them, though, and also logs the HASH payload that accompanied the other.**

Most of these have been demoted to Debugging in the next version of ISAKMD for OBSD2.6

* Quoted from Email from HÂkan Olsson to Patrick Ethier on Dec 21st 1999.
** Quoted from email by HÂkan Olsson to Patrick Ethier on Dec 21st 1999.

7.0 Expanding the VPN

You can expand your VPN to accept multiple private connections.
In the conf file, things are pretty easy. Each additional ISAKMP peer requires these additions:
a) Add an entry to the <PHASE 1> section describing the incoming address of an <ISKAMPD-PEER>.
b) Add an entry to the <PHASE 2>: Connections= tag to describe a new <IPSEC-CONNECTION>(The list is comma separated).
c) Create a section referring to the <[Phase 1]:ISAKMP-peer> section, use the one already there as a template
d) Create a <IPSEC-CONNECTION> section referring to step B using the existing one as a template.
e) The Remote-ID variable will be a new <IPSEC-ID> to match the new remote network
f) The Local-ID should remain the same
g) Create a new <IPSEC-ID> section to reflect the Remote-ID value from step d.
h) If the remote host supports encryption schemes from the original connections then you don't have to worry about modifying the <ISKAMPD-PEER>:Configuration.. You will need to create a new <ISAKMP-CONFIGURATION> and have a Transform value equivalent to a section under the comment
# Main mode transforms
if it exists.
i) The <IPSEC-CONFIGURATION> should remain the same unless your remote host does not support the given suites. If it doesn't create a new <IPSEC-CONNECTION>:Configuration= using the existing suites.

8.0 ISAKMP, IPSEC, OpenBSD, and other technologies

This section is open to discussion. I would like to have this section explain exceptions that need to be made to the above procedure to get our gateway to talk to other ISAKMP - IPSEC clients/servers. Such an example isaOBSD<->CheckPoint FW-1/VPN-1 setup or a setup that allows a variable IP'ed laptop to connect to our Internal LAN through our VPN.
You will also want to set up your firewall rules properly once you have ISAKMPD up and running. Refer to the IPF howto that is linked from http://www.openbsd.org/faq/faq6.html using the tips offers on the IPSec Section(13) from the OpenBSD FAQ.

9.0 Useful Links

Following are links that I used to compile the information in this document:
http://www.openbsd.org/faq/faq13.html
http://www.cis.ohio-state.edu/htbin/rfc/rfc2407.html
http://www.cis.ohio-state.edu/htbin/rfc/rfc2408.html
http://www.cis.ohio-state.edu/htbin/rfc/rfc2409.html
Further links are available from these pages.
There are a couple of mailing lists available that may offer some assistance:
vpn@securityfocus.com
misc@openbsd.org
Using the standard 'subscribe listname your_email_address' message body send an email to majordomo@domain.com to subscribe

10.0 Credits:

Special thanks to the people from the misc@openbsd.org and vpn@securityfocus.com

Special thanks to Angelos Keromytis who helped me get through my first experience with ISAKMP on OpenBSD.

Matthew Patton (From netsec.net) and HÂkan Olsson who helped me verify the accuracy of the information provided and supplied a few words of their own.

Thank you to the original writer of the IPSec FAQ on http://www.openbsd.org/faq/faq13.html

11.0 About the author:

Patrick Ethier is a Product Development Technician for SecureOps Inc. Being an avid fan of OpenBSD and Open Source software; Patrick's goal is to help develop network security solutions that reflect these ideals. He can be reached at patrick@secureops.com.

copyright © 1999 SecureOps Inc.