Template:Netoworking rut configuration example gre via cli

From Teltonika Networks Wiki

Introduction

The information in this page is updated in accordance with the [[Media:{{{fw_version}}}_WEBUI.bin|{{{fw_version}}}]] 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

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

[[File:Networking {{{name}}} configuration examples gre via cli scheme v1.jpg|border|border=tlt-border]]

GRE instance 1 Configuration

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

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

    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.