Changes

no edit summary
Line 21: Line 21:     
[[File:TopologijaIPsecPublicRutSingleLAN.png|border|class=tlt-border|center]]
 
[[File:TopologijaIPsecPublicRutSingleLAN.png|border|class=tlt-border|center]]
==Fortinet configuration==
+
==Site to site configuration==
Start by configuring the '''Fortinet''' device. Login to the WebUI, navigate to '''VPN → IPsec Tunnels → Create new → IPsec Tunnel → Template Custom'''. Configure everything as follows.  
+
This section provides a guide on how to configure a successful site to site IPsec vpn connection between '''RUT''' and '''Fortinet''' devices.
 
+
===Fortinet configuration===
 +
Start by configuring the '''Fortinet''' device. Login to the WebUI, navigate to '''1. VPN → 2. IPsec Tunnels → 3. Create new → 4. IPsec Tunnel → 5. Your desired name → 6. Template type: Custom → 7. Click on the button next'''.
 +
----
 +
<table class="nd-othertables_2">
 +
    <tr>
 +
        <th width=800; style="border-bottom: 1px solid white;" rowspan=2>[[File:Fortinet_Firewall_create_new.png|border|class=tlt-border|497x209px|left]]</th>
 +
    </tr>
 +
    <tr>
 +
        <th width=800; style="border-bottom: 1px solid white;" rowspan=1>[[File:Fortinet_Firewall_type_next_v2.png|border|class=tlt-border|437x209px|right]]</th>
 +
    </tr>
 +
    </table>
 
'''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====
 
----
 
----
 +
Configure everything as follows.
 
Make the following changes:
 
Make the following changes:
 
# Remote Gateway – '''''Static IP Address;'''''
 
# Remote Gateway – '''''Static IP Address;'''''
Line 32: Line 43:  
#Interface – '''''wan1;'''''
 
#Interface – '''''wan1;'''''
 
[[File:Fortinet_IPsec_network_public_ip.png|border|class=tlt-border|center]]
 
[[File:Fortinet_IPsec_network_public_ip.png|border|class=tlt-border|center]]
===Authentication configuration===
+
====Authentication configuration====
 
----
 
----
 
Make the following changes:
 
Make the following changes:
Line 39: Line 50:  
# Version – '''''2;'''''
 
# Version – '''''2;'''''
 
[[File:Fortigate_IPsec_Authentication_Configuration.png|border|class=tlt-border|center]]
 
[[File:Fortigate_IPsec_Authentication_Configuration.png|border|class=tlt-border|center]]
===Phase 1 Proposal configuration===
+
====Phase 1 Proposal configuration====
 
----
 
----
 
'''Note:''' ''This is only an example of a secure configuration. Other algorithms or even combinations of them could be used. However, we strongly recommend refraining from using older encryption and hashing algorithms unless support for certain legacy systems is required.''
 
'''Note:''' ''This is only an example of a secure configuration. Other algorithms or even combinations of them could be used. However, we strongly recommend refraining from using older encryption and hashing algorithms unless support for certain legacy systems is required.''
Line 49: Line 60:  
# Key Lifetime (seconds) – '''''86400;'''''
 
# Key Lifetime (seconds) – '''''86400;'''''
 
[[File:Fortigate_IPsec_Phase1_Proposal_Configuration.png|border|class=tlt-border|center]]
 
[[File:Fortigate_IPsec_Phase1_Proposal_Configuration.png|border|class=tlt-border|center]]
===Phase 2 Selectors configuration===
+
====Phase 2 Selectors configuration====
 
----
 
----
 
'''Note:''' ''This is only an example of a secure configuration. Other algorithms or even combinations of them could be used. However, we strongly recommend refraining from using older encryption and hashing algorithms unless support for certain legacy systems is required.''
 
'''Note:''' ''This is only an example of a secure configuration. Other algorithms or even combinations of them could be used. However, we strongly recommend refraining from using older encryption and hashing algorithms unless support for certain legacy systems is required.''
Line 62: Line 73:  
[[File:Fortigate_IPsec_Phase2_Proposal_Configuration.png|border|class=tlt-border|center]]
 
[[File:Fortigate_IPsec_Phase2_Proposal_Configuration.png|border|class=tlt-border|center]]
   −
===Firewall configuration===
+
====Firewall configuration====
 
After setting up our IPsec instance, we will need to configure our firewall accordingly. Navigate to '''Policy & Objects → Firewall Policy → and click on a Create new button.'''. Configure everything as follows.  
 
After setting up our IPsec instance, we will need to configure our firewall accordingly. Navigate to '''Policy & Objects → Firewall Policy → and click on a Create new button.'''. Configure everything as follows.  
 
----
 
----
Line 73: Line 84:  
# Destination - '''192.168.1.0/255.255.255.0;'''
 
# Destination - '''192.168.1.0/255.255.255.0;'''
 
# Service - '''ALL;'''
 
# Service - '''ALL;'''
[[File:Fortinet_IPsec_Firewall_Forti_to_RUT.png|border|class=tlt-border|center]]
+
# '''NAT disabled;'''
 +
[[File:Fortinet_IPsec_Firewall_Forti_to_RUT_v2.png|border|class=tlt-border|center]]
 
----
 
----
 
Then create a second firewall rule.
 
Then create a second firewall rule.
Line 82: Line 94:  
# Destination - '''192.168.5.0/255.255.255.0;'''
 
# Destination - '''192.168.5.0/255.255.255.0;'''
 
# Service - '''ALL;'''
 
# Service - '''ALL;'''
[[File:Fortinet_IPsec_Firewall_RUT_to_Forti.png|border|class=tlt-border|center]]
+
# '''NAT disabled;'''
===Static Routes configuration===
+
[[File:Fortinet_IPsec_Firewall_RUT_to_Forti_v2.png|border|class=tlt-border|center]]
 +
----
 +
Our firewall should look like this:
 +
[[File:Fortinet_Firewall_ipsec_configuration_overall_v2.png|border|class=tlt-border|center]]
 +
====Static Routes configuration====
 
After setting up our IPsec instance and firewall, we will need to configure our static route accordingly. Navigate to '''Network → Static routes → and click on a Create new button.'''. For that we will need to create two static routes, one for blackhole and one for accessing our RUT device, configure everything as follows.  
 
After setting up our IPsec instance and firewall, we will need to configure our static route accordingly. Navigate to '''Network → Static routes → and click on a Create new button.'''. For that we will need to create two static routes, one for blackhole and one for accessing our RUT device, configure everything as follows.  
 
----
 
----
Line 115: Line 131:  
     </tr>
 
     </tr>
 
</table>
 
</table>
==RUT configuration==
+
===RUT configuration===
 
Start by configuring the '''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 '''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.''  
 
'''Note:''' ''Not specified fields can be left as is or changed according to your needs.''  
===Instance configuration===
+
====Instance configuration====
 
----
 
----
 
Make the following changes:
 
Make the following changes:
Line 127: Line 143:  
# Remote identifier – '''''%any;'''''
 
# Remote identifier – '''''%any;'''''
 
[[File:Rut_IPsec_configuration_instance_site_to_site.png|border|class=tlt-border|center]]
 
[[File:Rut_IPsec_configuration_instance_site_to_site.png|border|class=tlt-border|center]]
===Connection general section configuration===
+
====Connection general section configuration====
 
----
 
----
 
Make the following changes:
 
Make the following changes:
Line 137: Line 153:     
[[File:Rut_IPsec_configuration_connection_general_site_to_site.png|border|class=tlt-border|686x482px|center]]
 
[[File:Rut_IPsec_configuration_connection_general_site_to_site.png|border|class=tlt-border|686x482px|center]]
===Proposal configuration===
+
====Proposal configuration====
 
----
 
----
 
'''Note:''' ''This is only an example of a secure configuration. Other algorithms or even combinations of them could be used. However, we strongly recommend refraining from using older encryption and hashing algorithms unless support for certain legacy systems is required.''
 
'''Note:''' ''This is only an example of a secure configuration. Other algorithms or even combinations of them could be used. However, we strongly recommend refraining from using older encryption and hashing algorithms unless support for certain legacy systems is required.''
Line 172: Line 188:  
     </tr>
 
     </tr>
 
</table>
 
</table>
 +
==Site to site configuration with multiple LANs==
 +
----
 +
This section provides a guide on how to configure a successful site to site IPsec vpn connection between '''RUT''' and '''Fortinet''' devices with multiple LANs. Here is the list of LANs with their subnets:
 +
* Fortinet:
 +
** LAN1: 192.168.5.0/24 with default gateway 192.168.5.99
 +
** LAN2: 192.168.4.0/24 with default gateway 192.168.4.99
 +
* RUT:
 +
** LAN1: 192.168.1.0/24 with default gateway 192.168.1.1
 +
** LAN2: 192.168.2.0/24 with default gateway 192.168.2.1
 +
===Fortinet configuration===
 +
----
 +
As for the configuration of IPsec tunnel, everything is the same, only the Phase 2 Selectors, Firewall and static route sections will be configured additionally, so for other sections refer to the guide site to site.
    +
====Phase 2 Selectors configuration====
 +
----
 +
<table class="nd-othertables_2">
 +
    <tr>
 +
        <th width=330; style="border-bottom: 1px solid white;></th>
 +
        <th width=800; style="border-bottom: 1px solid white;" rowspan=2>
 +
        [[File:Fortinet_IPsec_Phase2_Selectors_Multiple_lan.png|border|class=tlt-border|center]]</th>
 +
    </tr>
 +
    <tr>
 +
        <td style="border-bottom: 4px solid white>
 +
Make the following changes:
 +
'''Steps 7 8 9 10 are the same for all selectors.'''
 +
# Phase 2 interface - '''''Fortinet LAN1 to RUT LAN2;'''''
 +
# Phase 2 interface - '''''Fortinet LAN2 to RUT LAN1;'''''
 +
# Phase 2 interface - '''''Fortinet LAN2 to RUT LAN2;'''''
 +
# Phase 2 interface – '''''Fortinet LAN1 to RUT LAN1;'''''
 +
# Local address - '''''Write accordingly with the Fortinet LAN;'''''
 +
# Remote address - '''''Write accordingly with the RUT LAN;'''''
 +
# Encryption – '''''AES256;'''''
 +
# Authentication -  '''''SHA512;'''''
 +
# Diffie-Hellman Group – '''''16;'''''
 +
# Seconds – '''''86400;'''''
 +
        </td>
 +
    </tr>
 +
</table>
 +
----
 +
====Static route configuration====
 +
After setting up our IPsec instance and firewall, we will need to configure our static route accordingly. Navigate to '''Network → Static routes → and click on a Create new button.''' For that we will need to create four static route interfaces, two for blackholes and two for accessing our RUT device LAN1/LAN2, configure everything the same as for site to site, just add the LAN2. It should look like this:
 +
[[File:Fortinet_static_route_general.png|border|class=tlt-border|center]]
 +
----
    
==Testing the configuration==
 
==Testing the configuration==
Line 182: Line 240:  
[[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, we should be able to ping Fortigate device, we can check it out by executing this command via command line on RUT device: <code><span class="highlight" >'''ping 192.168.5.99'''</span></code>:
+
Also, we should be able to ping '''Fortinet''' device, we can check it out by executing this command via command line on RUT device: <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:Networking_ssh_manual_IPsec_configuration_test_ping_v1.png|border|class=tlt-border|506x133px|center]]
 
----
 
----
Line 191: Line 249:  
[[File:Fortinet_IPsec_WebUI_tunnel_status.png|border|class=tlt-border|center]]
 
[[File:Fortinet_IPsec_WebUI_tunnel_status.png|border|class=tlt-border|center]]
 
==See also==
 
==See also==
 
+
----
 
[https://wiki.teltonika-networks.com/view/RUTX12_VPN#IPsec IPsec on Teltonika Networks devices]
 
[https://wiki.teltonika-networks.com/view/RUTX12_VPN#IPsec IPsec on Teltonika Networks devices]
    
==External links==
 
==External links==
 
+
----
 
[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 Fortinet Ipsec configuration]
 
[https://docs.fortinet.com/document/fortigate/7.4.2/administration-guide/762500/general-ipsec-vpn-configuration Fortinet Ipsec configuration]

Navigation menu