EdgeRouter - GRE Tunnel


Overview


Readers will learn how to create a GRE (Generic Routing Encapsulation) tunnel on an EdgeRouter.

NOTES & REQUIREMENTS:
Applicable to the latest EdgeOS firmware on all EdgeRouter models. Please see the Related Articles below for more information.
 
Devices used in this article:

Configuring a GRE Tunnel


Back to Top

topology.png

The GRE tunnel will be used to route traffic between the 192.168.1.0/24 and 172.16.1.0/24 networks.


Follow the steps below to configure the GRE tunnel on both routers:

CLI: Access the Command Line Interface on ER-L. You can do this using the CLI button in the GUI or by using a program such as PuTTY.

1. Enter configuration mode.

configure

2. Create the tunnel interface and define the local and remote tunnel endpoints.

set interfaces tunnel tun0 local-ip 203.0.113.1
set interfaces tunnel tun0 remote-ip 192.0.2.1

3. Define the tunnel encapsulation method.

set interfaces tunnel tun0 encapsulation gre

4. Define the IP address associated with the GRE tunnel

set interfaces tunnel tun0 address 10.255.12.1/30

5. Create a static route for the remote subnet.

set protocols static interface-route 172.16.1.0/24 next-hop-interface tun0

6. Commit the changes and save the configuration.

commit ; save

CLI: Access the Command Line Interface on ER-R. You can do this using the CLI button in the GUI or by using a program such as PuTTY.

1. Enter configuration mode.

configure

2. Create the tunnel interface and define the local and remote tunnel endpoints.

set interfaces tunnel tun0 local-ip 192.0.2.1
set interfaces tunnel tun0 remote-ip 203.0.113.1

3. Define the tunnel encapsulation method.

set interfaces tunnel tun0 encapsulation gre

4. Define the IP address associated with the GRE tunnel

set interfaces tunnel tun0 address 10.255.12.2/30

5. Create a static route for the remote subnet.

set protocols static interface-route 192.168.1.0/24 next-hop-interface tun0

6. Commit the changes and save the configuration.

commit ; save
NOTE: The GRE tunnel can also be routed over a Policy-Based IPsec Site-to-Site VPN. To do this, create loopback interfaces and exchange the local and remote IP addresses of the GRE tunnel using IPsec.

Related Articles


Back to Top

EdgeRouter - EoGRE Layer 2 Tunnel

EdgeRouter - Policy-Based Site-to-Site IPsec VPN

Intro to Networking - How to Establish a Connection Using SSH


We're sorry to hear that!