Continuing my tinkering on Olive, I tried to create a GRE tunnel. Short explanation about GRE tunnel, GRE tunnel is a way to create a tunnel (seemed like a point-to-point connection) between two network regardless of the internet complexity.

Here is the topology I made to simulate the tunnel (It based on case study in JNCIS  ENT Routing Study Guide, Tunneling Section).

Host1–TEP1–[Cloud]–TEP2–Host2

Now we configured the machine. The main machine of GRE tunnel is the Tunnel End Point (and this is the only machine containing the GRE Tunnel configuration), so I will only (and shortly 🙂 ) explain it (I’m going to use Tunnel End Point 1 (TEP1) in my explanation).

A tunnel endpoint must has a GRE-enabled interface and enable it (my olive version has already supported GRE tunnel). I put loopback address of  the local machine as source address of the tunnel, and those of the remote machine as the destination address. I also planned to make the subnet 10.10.11.0/24 to be the local network of TEP1 (where remote network was 10.10.11.0/24).

interfaces {
 em1 {
  vlan-tagging;
  unit 1 {
   vlan-id 30;
   family inet {
    address 10.10.11.1/24;
   }
  }
 }
 gre {
  unit 0 {
   tunnel {
    source 192.168.1.1;
    destination 192.168.2.1;
   }
   family inet;
  }
 }
}

One consideration of creating the tunnel is that the two end point (source and destination address) must already establish the connection.

After being establihed, we add the route (I used static routing protocol) to establish the connection between networks using gre tunnel.

routing-options {
 static {
  route 10.10.12.0/24 next-hop gre.0;
 }
}

Here, we should already have an established GRE tunnel and we can add some hosts in both end of the tunnel. 🙂

For verification, we can use,

show interfaces statistics gre.0

which will shows that the packets have already traversed the tunnel.

Update : for ipip tunneling, we need only change the interface gre with ipip. The rest configuration is same. 

Leave a comment

I’m Salman

My name is Salman Alfarisi. I am currently an IT manager at IIJ Global Solutions in Indonesia. My work primarily involves IT infrastructure, with a current focus on cybersecurity.

Let’s connect