EdgeRouter - GRE Tunnel
Overview
Readers will learn how to create a GRE (Generic Routing Encapsulation) tunnel on an EdgeRouter.
- Applicable to the latest firmware on all EdgeRouter models.
Configuring a GRE Tunnel
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:
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
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
Related Articles
EdgeRouter - EoGRE Layer 2 Tunnel
EdgeRouter - Policy-Based Site-to-Site IPsec VPN
Intro to Networking - How to Establish a Connection Using SSH