You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

GRE (Generic Routing Encapsulation) is a tunneling protocol that was originally developed by Cisco GRE RFC 1701. It can encapsulate a wide variety of protocols creating a virtual point-to-point link.

GRE is the same as IPIP and EoIP which were originally developed as stateless tunnels. This means that if the remote end of the tunnel goes down, all traffic that was routed over the tunnels will get blackholed. To solve this problem, RouterOS has added a 'keepalive' feature for GRE tunnels.

GRE tunnel adds a 24 byte overhead (4-byte gre header + 20-byte IP header). GRE tunnel can forward only IP and IPv6 packets (ethernet type 800 and 86dd). Do not use the "Check gateway" option "arp" when a GRE tunnel is used as a route gateway.

Setup example

The goal of this example is to get Layer 3 connectivity between two remote sites over the internet

We have two sites, Site1 with local network range 10.1.101.0/24 and Site2 with local network range 10.1.202.0/24.

The first step is to create GRE tunnels. A router on site 1:

/interface gre add name=myGre remote-address=192.168.90.1 local-address=192.168.80.1

A router on site 2:

/interface gre add name=myGre remote-address=192.168.80.1 local-address=192.168.90.1

As you can see tunnel configuration is quite simple.

In this example, a keepalive is not configured, so tunnel interface will have a running flag even if remote tunnel end is not reachable

Now we just need to set up tunnel addresses and proper routing. A router on site 1:

/ip address 
  add address=172.16.1.1/30 interface=myGre
/ip route 
  add dst-address=10.1.202.0/24 gateway=172.16.1.2

A router on site 2:

/ip address 
  add address=172.16.1.2/30 interface=myGre
/ip route 
  add dst-address=10.1.101.0/24 gateway=172.16.1.1

At this point, both sites have Layer 3 connectivity over the GRE tunnel.

  • No labels