Howto – Install and Configure Strongswan for connection with a Fortigate unit

vi /etc/network/interfaces
iface eth0:0 inet static
address 192.168.0.1
netmask 255.255.255.0
ifup eth0:0

sysctl -w net.ipv4.ip_forward=1
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth0 -o eth0:0 -m state –state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth0:0 -o eth0 -j ACCEPT
iptables-save

apt install -y strongswan
 

# clearing iptables
sudo iptables -t nat -F
sudo iptables -t mangle -F
sudo iptables -F
sudo iptables -X

# This file is automatically generated. Do not edit
config setup
        uniqueids = yes

conn bypasslan
        leftsubnet = 192.168.20.0/24
        rightsubnet = 192.168.20.0/24
        authby = never
        type = passthrough
        auto = route

conn con1000
        fragmentation = yes
        keyexchange = ikev2
        reauth = yes
        forceencaps = no
        mobike = no

        rekey = yes
        installpolicy = yes
        type = tunnel
        dpdaction = restart
        dpddelay = 10s
        dpdtimeout = 60s
        auto = route
        left = 82.33.252.36
        right = 216.33.201.18
        leftid = 82.33.252.36
        ikelifetime = 28800s
        lifetime = 43200s
        ike = aes256-sha512-ecp512bp!
        esp = aes256-sha512-ecp512bp!
        leftauth = psk
        rightauth = psk
        rightid = 216.33.201.18
        rightsubnet = 10.0.0.0/8
        leftsubnet = 192.168.20.0/24

Published by

Ronny Van den Broeck

I'm a network and system engineer for more than 20 years now. During this period I became a pro in hunting down one's and zero's, with an eager mindset to help people accomplish the same or abstract them away from the matrix.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s