RUT900 Setting a GRE tunnel via cli

From Wiki Knowledge Base | Teltonika Networks
Main Page > RUT Routers > RUT900 > RUT900 Configuration Examples > RUT900 Setting a GRE tunnel via cli

Introduction[edit | edit source]

The information in this page is updated in accordance with the RUT9XX_R_00.06.05.3 firmware version.

Generic Routing Encapsulation (GRE) is a tunneling protocol that can encapsulate a wide variety of network layer protocols inside virtual point-to-point links over an Internet Protocol network.

This article provides an extensive configuration example with details on how to create a tunnel connection between two GRE Tunnel instances, configured on two RUTxxx router devices.

To do this instruction is necessary to know how to use CLI or SSH connection, the instructions to remote access are in this link https://wiki.teltonika-networks.com/view/Command_line_interfaces

Prerequisites[edit | edit source]

You will need:

  • Two RUTxxx routers
  • A PC to configure the routers
  • Both routers must have a Public Static or Public Dynamic IP addresses

Configuration scheme[edit | edit source]

Networking rut900 configuration examples gre via cli scheme v1.jpg

GRE instance 1 Configuration[edit | edit source]

To set up the first instance we have to check the subnet LAN interface and the GRE config file.

  • Configuring the LAN interface.
  • With the cat command access to /etc/config/network and the subnet should be 192.168.1.1

    Netoworking rut configuration example gre via cli 02.png

  • Configuring GRE Tunnel
  • GRE Tunnel configuration should be written in the same file. Use the vi command to access and edit.

    Since you accessed to the SSH or CLI, write vi /etc/config/network, then press on the i key and navigate to the end of the file with the arrow keys.

    Networking rutxxx configuration examples gre via cli 01.png

    Add the GRE tunnel config according with the following picture.

    Networking rutxxx configuration examples gre via cli 02.png


Use the ESC key, write :wq and press Enter to save the changes. Since you are in the root windows, write /etc/init.d/network restart and wait a seconds until the router.

GRE instance 2 Configuration[edit | edit source]

Access via CLI or SSH and write vi /etc/config/network, then press on the i key and navigate to the end of the file with the arrow keys.

  • Edit your LAN interface and select 192.168.2.1

  • Networking rutxxx configuration examples gre via cli 07.png

    Also Add the GRE tunnel config according with the following picture.

    Networking rutxxx configuration examples gre via cli 03.png

    Use the ESC key, write :wq and press Enter to save the changes. Since you are in the root windows, write /etc/init.d/network restart and wait a seconds until the system restart.

    Testing configuration[edit | edit source]

    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.

    In order to test the GRE Tunnel connection, login to SHH or CLI and From there you should then be able to ping the opposite instance's virtual IP address. To use a ping command, type ping <ip_address> and press the "Enter" key on your keyboard:

    Networking rutxxx configuration examples gre via cli 04.png

    If the ping requests are successful, congratulations, your setup works! If not, we suggest that you review all steps once more.