Setting up an IPsec tunnel between RUT and Android phone

Main Page > General Information > Configuration Examples > VPN > Setting up an IPsec tunnel between RUT and Android phone

Introduction

In this example, we're going to configure IPsec tunnel between RUT and Android phone. Since L2TP VPN configuration is not available on the newest Android phones, only IPsec tunnel has to be configured.

Configuration overview and prerequisites

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

Prerequisites:

  • RUT/RUTX series router with RUTOS firmware;
  • An end device (PC, Laptop) for configuration;
  • Android phone with Android 13 or newer version;

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.

Networking rut9 manual webui basic advanced mode.gif

Topology

blablabla

Router configuration

Start by configuring the router. 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


Mainsettings.png
  1. Enable instance;
  2. Authentication method - Pre-shared key;
  3. Pre-shared key - your desired password;
  4. Local identifier - LAN IP of RUT;

Connection configuration


Connection settings 1.png
  1. Local subnet - 0.0.0.0/.0;
  2. Key exchange - IKEv2;

Advanced Connection settings


Advanced settings 1.png
  1. Remote source IP - 10.0.2.0/24;

Proposal configuration


[[|border|class=tlt-border|742x254px|right]]
  1. Encryption - AES256;
  2. Authentication - SHA256;
  3. DH group - MODP2048;

[[|border|class=tlt-border|748x257px|right]]
  1. Encryption - AES256;
  2. Authentication - SHA256;
  3. DH group - MODP1024;

Android configuration

Open Settings, navigate to Connections → More connection settings → VPN and Add VPN profile (VPN configuration could be placed in a different location, which could vary from phone to phone, if you're not able to find the settings, please refer to user manual). Configure everything as follows.

VPN Profile configuration


[[|border|class=tlt-border|742x399px|right]]
  1. Name - Your preferred name for VPN profile;
  2. Type - IKEv2/IPSec PSK;
  3. Server address - RUT public IP;
  4. IPSec identifier - Your preferred identifier;
  5. Pre-shared key - the same password you have set on RUT when configuring IPsec instance;

Testing the configuration

If you've followed all the steps presented above, 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.

To test the connectivity, initiate connection from the Phone.

Using the ipsec status command we can see that IPsec tunnel is successfully established between the devices. The command output on a RUT:

[[|border|class=tlt-border|776x114px|center]]

Also, as the router's LAN should be reachable from the phone, we can try pinging the router using Ping tools application:

[[|border|class=tlt-border|506x157px|center]]