Default IPsec route configuration between Teltonika and Fortigate devices

From Teltonika Networks Wiki
Revision as of 09:11, 18 June 2024 by Dziugas.Syminas (talk | contribs) (Created page with "=Default IPsec route configuration between Teltonika Networks and Fortigate devices= <p style="color:red">The information in this page is updated in accordance with [https://...")

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)

Default IPsec route configuration between Teltonika Networks and Fortigate devices

The information in this page is updated in accordance with 00.07.07.2 firmware version.

Introduction

Normally we configure IPsec for LAN-to-LAN communication, also known as split-tunnel VPN, when only specific hosts should be reachable via a VPN tunnel. However, we may also take a different approach and configure a VPN tunnel using the full tunnel method. This means that any non-directly connected network (i.e. lan interface) will be reachable only via IPsec tunnel and not via the typical default route.

Configuration overview and prerequisites

Before we begin, let's look at the configuration we are attempting to achieve and the prerequisites that make it possible.

Prerequisites

One RUT/RUTX series router with RUTOS firmware;

One Fortigate series router;

An end device (PC, Laptop) for configuration;

If you're having trouble finding any page or some of the parameters described here on your device's WebUI, you should turn on "Advanced WebUI" mode. You can do that by clicking the "Basic" button under "Mode" which is located at the top-right corner of the WebUI.

Topology

Fortigate – The Fortigate will act as a hub. A hub is a server, to which our spoke will be connected (IPsec responder). It will be our "default gateway" for the spoke device. Fortigate has a LAN subnet of 192.168.5.0/24 configured on it, which should be reachable by the spoke.

RUTRUTX11 will act as a spoke. A spoke is a client, that will be connected to the spoke (IPsec initiator). It will be connected to a hub for basic internet access. RUTX11 has a LAN subnet of 192.168.1.0/24 configured on it.

Fortigate (Hub) configuration

Start by configuring the hub (Fortigate) device. Login to the WebUI, navigate to VPN → IPsec Tunnels → Create new → IPsec Tunnel → Template Custom. Configure everything as follows.

Note: Not specified fields can be left as is or changed according to your needs.

Network configuration

1. Remote Gateway – Static IP Address;

2. IP Address – 192.168.10.1;

3. Interface – wan1;

Authentication configuration

1. Method – Pre-shared Key;

2. Pre-shared Key – your desired password;

3. Version – 2;

Phase 1 Proposal configuration

1. Encryption – AES256;

2. Authentication - SHA512;

3. Diffie-Hellman Group – 16;

4. Key Lifetime (seconds) – 86400;

Phase 2 Selectors configuration

Click on Advanced settings;

1. Encryption – AES256;

2. Authentication - SHA512;

3. Diffie-Hellman Group – 16;

4. Key Lifetime – Seconds;

5. Seconds – 86400;


RUT (Spoke) configuration

Start by configuring the spoke (RUT) device. Login to the WebUI, navigate to Services → VPN → IPsec and add a new IPsec instance. Configure everything as follows. Note: Not specified fields can be left as is or changed according to your needs.

Instance configuration

1. Enable instance;

2. Remote endpoint - Fortigate WAN IP;

3. Authentication method - Pre-shared key;

4. Pre-shared key - the same password you have set on Fortigate when configuring the Fortigate HUB instance;

5. Local identifier – RUT WAN IP;

6. Remote identifier – Fortigate WAN IP;

Connection general section configuration

1. Mode - Start;

2. Type - Tunnel;

3. Enable default route;

4. Local subnet – 192.168.1.0/24;

5. Remote subnet – 0.0.0.0/0;

6. Key exchange - IKEv2;

Connection advanced configuration

1. Enable local firewall 2. Remote DNS – 8.8.8.8; 3. Passthrough subnets – 192.168.1.0/24;

Proposal configuration

Phase 1

1. Encryption - AES256;

2. Authentication - SHA512;

3. DH group – MODP4096;

4. IKE lifetime – 86400s;

Phase 2

1. Encryption - AES256;

2. Hash - SHA512;

3. PFS group – MODP4096;

4. lifetime – 86400s;

Testing the configuration

If you have followed all the above steps, your configuration should be finished. But as with any other configuration, it is always wise to test the setup in order to make sure that it works properly.

Using the ipsec status command we can see that IPsec tunnel is successfully established on RUT router. The command output on a spoke (RUT) device: