Routing all traffic over an IPsec tunnel

Last modified on 8 Mar, 2022. Revision 12
Up to date for
14.00.xx
Supported since
11.x
Status OK

This How-to applies to

This how-to assumes that you already got the Security Gateway and the IPsec tunnel up and running.

Topics covered in this how-to


Description of the scenario

In this scenario we have a remote office that is connected to the HQ over IPsec and we want all traffic to always go trough the IPsec tunnel for everything the inside network wants to access. Utilizing the Virtual Router support in Clavister Security Gateway makes this possible.


NOTE:

All traffic originating from the Security Gateway itself will always use <main>, that means that traffic like DNS queries, HTTP Poster, NTP and IPsec traffic will use the default gateway defined in that routing table.

Setting up the routes

First of all we need to setup the two different routing tables, <main> and <VR>

Main Routing Table

The first thing to do is to remove all routes from the routing table that has nothing to do with the external network and the Internet, i.e. the internal routes in this case.

When this is done, you should have only two routes in the <main> routing table, it should look something like this:


VR Routing Table

Now it’s time to create a new Routing Table, give it a name, in this How-to we will use VR and choose Only as ordering.

In this new routing table, add a route for the internal network and a route for all-nets over the VPN interface.


Setting up the interfaces

When the routing tables are configured the interfaces of the Security Gateway needs to be configured as members of the different routing tables. As standard all interfaces are members of all routing tables but in the scenario we want to force traffic from the VPN and inside to go only trough the <VR> routing table. This is done by defining Virtual Routing Membership on the different interfaces.

Ethernet

For the ethernet interfaces we want to configure Wan as a member of the <main> routing table and Lan in the routing table <VR>. This setting is found under the Virtual Routing tab of the interface

In this picture example we are using the Wan interface.


IPSec Tunnels

For the IPSec interfaces we want to configure IPsec as a member of the Routing table <VR>.



Alternative solution

It is also possible to solve this scenario without using additional routing tables, and that is by removing the default route from the <main> routing table and instead routing all-nets over the IPsec interface.

NOTE: The IPsec tunnel itself, must have all-nets defined as remote network, or traffic will not be allowed through the tunnel.

You also need to add single host routes for these addresses:

Related articles

Configuring public certificates in NetWall firewalls
5 Apr, 2022 core certificate oneconnect ipsec vpn
Automatic scheduled backup of InControl server database
5 Feb, 2021 incontrol howto backup windows
Problem with auto-created Core routes
22 Mar, 2021 core ipsec routing
How to configure a Captive Portal in cOS Core
18 May, 2022 howto core authenticator authentication webauth captive
Using Multicast DNS with cOS Core
24 May, 2021 core howto mdns multicast transparentmode airprint igmp dns
How to perform an offline installation of InControl
26 Jan, 2022 howto incontrol installation
Install OneConnect without Microsoft store
25 Feb, 2022 oneconnect windows howto
IPsec license usage calculation
14 Apr, 2021 core license ipsec
Does IPsecBeforeRules trigger before Access rules?
8 Sep, 2020 core ipsec rules access
How to setup a simple cloud-init environment for testing
30 Nov, 2020 howto core cloud-init dhcp
Freeing up more memory in the Firewall
18 Feb, 2021 core connections ipsec memory