how to configure and run openiked on linux ? not on OpenBSD. I got it working only on…
- User
how to configure and run openiked on linux ? not on OpenBSD. I got it working only on OpenBSD..
- Assistant
how to configure and run openiked on linux ? not on OpenBSD. I got it working only on OpenBSD..
OpenIKED is an implementation of the IKEv2 protocol originally developed for the OpenBSD operating system, but it can also be configured and run on other Unix-like systems, including Linux. Here's a basic guide on how you can compile, configure, and run OpenIKED on a Linux machine:
Install Development Tools
You will need some basic development tools and libraries. Depending on your distribution, you might need to install tools like gcc, make, automake, libtool, and development headers for SSL (OpenSSL or LibreSSL), and potentially other dependencies.
For Debian/Ubuntu:
sudo apt-get update
sudo apt-get install build-essential bison flex libssl-dev
For Fedora:
sudo dnf install gcc make bison flex openssl-devel
Download OpenIKED Source Code Visit the OpenIKED GitHub repository and download the latest release or clone the repository:
git clone https://github.com/openiked/openiked-portable.git
cd openiked-portable
Configure the Build
Run the ./bootstrap (if present), then ./configure command in the source directory. This script will prepare the build environment.
./bootstrap
./configure
Compile the Code
Compile the source code using make:
make
Install OpenIKED
With superuser privileges, install the software:
sudo make install
Edit the Configuration File
The main configuration file for OpenIKED is iked.conf. Typically, this is located in /etc/iked/. You might need to create this directory and file manually.
Here is a sample iked.conf:
ikev2 'mytunnel' {
local 192.0.2.1
remote 192.0.2.2
shared key 'your-shared-secret'
child 'internal' {
local 10.0.0.0/24
remote 10.0.1.0/24
mode tunnel
}
}
Adjust IP addresses and keys according to your setup.
Enable Packet Forwarding
Ensure that the Linux kernel is configured to forward packets:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
You may want to make this change permanent by editing /etc/sysctl.conf and adding:
net.ipv4.ip_forward = 1
Then apply the changes with sudo sysctl -p.
Start the Service
Run the OpenIKED daemon. Depending on your Linux distribution, you might use the service manager like systemd, or run it directly.
For direct execution (not recommended for production):
sudo iked
For systemd, you might create a service file at /etc/systemd/system/iked.service:
[Unit]
Description=OpenIKED Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/sbin/iked
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
Reload systemd and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable iked
sudo systemctl start iked
This is a basic guide and might require adjustments based on your specific Linux distribution and network environment. Always refer to official documentation and community forums for advanced configurations and troubleshooting.
Not yet included in a published release.