Unifix knowledge database - The original one

Dashboard - News - Search - List - About - Admin

Set up IPSEC in openbsd

Author:mike - Sat Jul 10 04:34:31 2004

Use IPsec the OpenBSD way.

Setting up IPsec in OpenBSD is fairly easy since it's compiled into the kernel that ships with each release and is enabled by default. All that is left to do is to create the appropriate /etc/isakmpd/isakmpd.conf and /etc/isakmpd/isakmpd.policy files and start isakmpd (the IPsec key-management daemon). This may sound daunting, but OpenBSD's outstanding documentation and example configuration files make it easier.

First of all, you'll need to put something similar to this in your /etc/isakmpd/isakmpd.policy:

KeyNote-Version: 2

Authorizer: "POLICY"

Licensees: "passphrase:mypassword"

Conditions: app_domain == "IPsec policy" &&

            esp_present == "yes" &&

            esp_enc_alg == "aes" &&

            esp_auth_alg == "hmac-sha" -> "true";

This sets a password to use for the IPsec connection.

Now you'll need to edit your /etc/isakmpd/isakmpd.conf to contain the following:



Shared-SADB=            Defined

[Phase 1]

Default=                ISAKMP-peer-remote

#Default=               ISAKMP-peer-remote-aggressive

[Phase 2]



Phase=                  1

Transport=              udp


Configuration=          Default-main-mode

Authentication=         mypassword


Phase=                  1

Transport=              udp


Configuration=          Default-aggressive-mode

Authentication=         mypassword


Phase=                  2

ISAKMP-peer=            ISAKMP-peer-remote

Configuration=          Default-quick-mode

Local-ID=               Net-local

Remote-ID=              Net-remote


ID-type=                IPV4_ADDR



ID-type=                IPV4_ADDR



DOI=                    IPSEC


Transforms=             3DES-SHA


DOI=                    IPSEC


Transforms=             3DES-SHA-RSA


DOI=                    IPSEC


Suites=                 QM-ESP-AES-SHA-PFS-SUITE

This configuration will allow anyone to connect with the password mypassword.

After you've edited the configuration files, you can start isakmpd by running this command:

# /sbin/isakmpd

To have isakmpd start up with each system boot, you should edit your /etc/rc.conf.local (or create one if it doesn't exist) and put the following line in it:


That should do it. As usual, check your system logs if your tunnel has trouble connecting.
Copyright(c) Unifix.org 2002-2011

Dashboard - News - Search - List - About - Admin
Powered by Mikjaer Consulting Solutions - Hosted by Specialhosting.dk