Member-only story

How to Import a .p12 File for IPsec VPN Configuration

Luca Berton
4 min readJun 9, 2024

A Step-by-Step Guide to Setting Up Your IPsec VPN with a .p12 Certificate File

Introduction

The error message suggests that the Network Security Services (NSS) database is not initialized. Follow these steps to resolve this issue and import your company.p12 file:

sudo ipsec import company.p12
[sudo] password for devops:
ERROR: NSS database files are missing, import aborted.
Initialize database with command "ipsec checknss".

Step 1: Initialize the NSS Database

Initialize the NSS database: Run the following command to create the necessary NSS database files.

sudo ipsec checknss

Step 2: Import the .p12 File

Import the .p12 file: Once the NSS database is initialized, you can import your company.p12 file.

sudo ipsec import company.p12

Step 3: Configure IPsec

Configure your IPsec connection: Edit the /etc/ipsec.conf file to include the configuration for your VPN connection. Here is an example configuration:

config setup
charondebug="ike 2, knl 2, cfg 2"

conn myvpn
keyexchange=ikev2
dpdaction=clear…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet