Difference between revisions of "Default IPsec route configuration between Teltonika and Fortigate devices"
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<p style="color:red">The information in this page is updated in accordance with [https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads'''00.07.07.2'''] firmware version.</p> | <p style="color:red">The information in this page is updated in accordance with [https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads'''00.07.07.2'''] firmware version.</p> | ||
− | |||
==Introduction== | ==Introduction== | ||
− | Normally we configure IPsec for LAN-to-LAN communication, also known as split-tunnel VPN, when only specific hosts | + | 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== | ==Configuration overview and prerequisites== | ||
Line 10: | Line 9: | ||
* One RUT/RUTX series router or TRB gateway with RUTOS firmware; | * One RUT/RUTX series router or TRB gateway with RUTOS firmware; | ||
− | * One | + | * One Fortinet series router; |
* An end device (PC, Laptop) for configuration; | * An end device (PC, Laptop) for configuration; | ||
Line 17: | Line 16: | ||
==Topology== | ==Topology== | ||
− | |||
− | '''RUT''' – | + | '''Fortinet''' – The Fortinet 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. Fortinet has a LAN subnet of 192.168.5.0/24 and WAN subnet of 192.168.10.2/24 configured on it, which should be reachable by the spoke. |
+ | |||
+ | '''RUT''' – '''RUTX11''' 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 and WAN subnet of 192.168.10.1/24 configured on it. | ||
+ | |||
+ | ==Fortinet (Hub) configuration== | ||
+ | Start by configuring the hub (Fortinet) 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.'' | '''Note:''' ''Not specified fields can be left as is or changed according to your needs.'' | ||
===Network configuration=== | ===Network configuration=== | ||
---- | ---- | ||
− | |||
Make the following changes: | Make the following changes: | ||
# Remote Gateway – '''''Static IP Address;''''' | # Remote Gateway – '''''Static IP Address;''''' | ||
Line 51: | Line 41: | ||
===Phase 1 Proposal configuration=== | ===Phase 1 Proposal configuration=== | ||
---- | ---- | ||
− | |||
− | |||
Make the following changes: | Make the following changes: | ||
# Encryption – '''''AES256;''''' | # Encryption – '''''AES256;''''' | ||
Line 61: | Line 49: | ||
===Phase 2 Selectors configuration=== | ===Phase 2 Selectors configuration=== | ||
---- | ---- | ||
− | |||
− | |||
Make the following changes: | Make the following changes: | ||
'''''Click on Advanced settings;''''' | '''''Click on Advanced settings;''''' | ||
Line 72: | Line 58: | ||
[[File:Fortigate_IPsec_Phase2_Proposal_Configuration.png|border|class=tlt-border|center]] | [[File:Fortigate_IPsec_Phase2_Proposal_Configuration.png|border|class=tlt-border|center]] | ||
− | == | + | ==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. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Start by configuring the | ||
'''Note:''' ''Not specified fields can be left as is or changed according to your needs.'' | '''Note:''' ''Not specified fields can be left as is or changed according to your needs.'' | ||
===Instance configuration=== | ===Instance configuration=== | ||
Line 123: | Line 65: | ||
Make the following changes: | Make the following changes: | ||
# '''''Enable''''' instance; | # '''''Enable''''' instance; | ||
− | # Remote endpoint - ''''' | + | # Remote endpoint - '''''Fortinet WAN IP;''''' |
# Authentication method - '''''Pre-shared key;''''' | # Authentication method - '''''Pre-shared key;''''' | ||
− | # Pre-shared key - the '''''same password''''' you have '''''set on | + | # Pre-shared key - the '''''same password''''' you have '''''set on Fortinet''''' when configuring the '''''Fortinet HUB instance;''''' |
# Local identifier – '''''RUT WAN IP;''''' | # Local identifier – '''''RUT WAN IP;''''' | ||
− | # Remote identifier – ''''' | + | # Remote identifier – '''''Fortinet WAN IP;''''' |
[[File:Networking_webui_manual_IPsec_Instance_Configuration.png|border|class=tlt-border|center]] | [[File:Networking_webui_manual_IPsec_Instance_Configuration.png|border|class=tlt-border|center]] | ||
===Connection general section configuration=== | ===Connection general section configuration=== | ||
Line 149: | Line 91: | ||
===Proposal configuration=== | ===Proposal configuration=== | ||
---- | ---- | ||
− | |||
− | |||
Make the following changes: | Make the following changes: | ||
<table class="nd-othertables_2"> | <table class="nd-othertables_2"> | ||
Line 185: | Line 125: | ||
==Testing the configuration== | ==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. | 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 <code><span class="highlight">'''ipsec status | + | Using the <code><span class="highlight">'''ipsec status'''</span></code> command we can see that IPsec tunnel is successfully established on RUT router. The command output on a '''spoke (RUT)''' device: |
[[File:Networking_ssh_manual_IPsec_configuration_IPsec_statusall_test_v1.png|border|class=tlt-border|971x135px|center]] | [[File:Networking_ssh_manual_IPsec_configuration_IPsec_statusall_test_v1.png|border|class=tlt-border|971x135px|center]] | ||
− | + | ||
− | Also, | + | Also, as the hub should be reachable by spoke, we can try pinging the hub using <code><span class="highlight" >'''ping 192.168.5.99'''</span></code>: |
− | + | [[File:Networking_ssh_manual_IPsec_configuration_test_ping_v1.png|border|class=tlt-border|506x133px|center]] | |
− | |||
− | |||
− | [[File: | ||
− | |||
− | |||
− | |||
==See also== | ==See also== | ||
Line 208: | Line 142: | ||
[https://openwrt.org/docs/guide-user/services/vpn/strongswan/basics OpenWrt Ipsec basics] | [https://openwrt.org/docs/guide-user/services/vpn/strongswan/basics OpenWrt Ipsec basics] | ||
− | [https://docs.fortinet.com/document/fortigate/7.4.2/administration-guide/762500/general-ipsec-vpn-configuration | + | [https://docs.fortinet.com/document/fortigate/7.4.2/administration-guide/762500/general-ipsec-vpn-configuration Fortinet Ipsec configuration] |
Revision as of 15:54, 18 June 2024
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 or TRB gateway with RUTOS firmware;
- One Fortinet series router;
- An end device (PC, Laptop) for configuration;
If you're having trouble finding this 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 "Advanced" button, located at the top of the WebUI.
Topology
Fortinet – The Fortinet 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. Fortinet has a LAN subnet of 192.168.5.0/24 and WAN subnet of 192.168.10.2/24 configured on it, which should be reachable by the spoke.
RUT – RUTX11 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 and WAN subnet of 192.168.10.1/24 configured on it.
Fortinet (Hub) configuration
Start by configuring the hub (Fortinet) 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
Make the following changes:
- Remote Gateway – Static IP Address;
- IP Address – 192.168.10.1;
- Interface – wan1;
Authentication configuration
Make the following changes:
- Method – Pre-shared Key;
- Pre-shared Key – your desired password;
- Version – 2;
Phase 1 Proposal configuration
Make the following changes:
- Encryption – AES256;
- Authentication - SHA512;
- Diffie-Hellman Group – 16;
- Key Lifetime (seconds) – 86400;
Phase 2 Selectors configuration
Make the following changes: Click on Advanced settings;
- Encryption – AES256;
- Authentication - SHA512;
- Diffie-Hellman Group – 16;
- Key Lifetime – Seconds;
- 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
Make the following changes:
- Enable instance;
- Remote endpoint - Fortinet WAN IP;
- Authentication method - Pre-shared key;
- Pre-shared key - the same password you have set on Fortinet when configuring the Fortinet HUB instance;
- Local identifier – RUT WAN IP;
- Remote identifier – Fortinet WAN IP;
Connection general section configuration
Make the following changes:
- Mode - Start;
- Type - Tunnel;
- Local subnet – 192.168.1.0/24;
- Remote subnet – 0.0.0.0/0;
- Key exchange - IKEv2;
Connection advanced section configuration
Make the following changes:
- Enable local firewall
- Remote DNS – 8.8.8.8;
- Passthrough subnets – 192.168.1.0/24;
Proposal configuration
Make the following changes:
|
|
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:
Also, as the hub should be reachable by spoke, we can try pinging the hub using ping 192.168.5.99
:
See also
IPsec on Teltonika Networks devices