Network labs Docs Open simulator →

GRE tunnel: connect two sites over the public internet

A and B are two branch routers on different ISPs. Build a GRE tunnel between them so the LAN-side 10.10.10.0/30 overlay rides across the public internet underlay (203.0.113.0/30 on A's side, 198.51.100.0/30 on B's side).

Open this lab in your browser →

Free · no install · no account

Scenario

Site-to-site connectivity over the public internet is the bread- and-butter of WAN engineering. A GRE tunnel is the simplest building block: `` A ──── ISP-A ─── INET ─── ISP-B ──── B │ │ └───── GRE 10.10.10.0/30 (overlay) ─┘ ` - Underlay: regular IP routing across whatever public IPs A and B happen to own. No tunnel involved here. - Overlay: a synthetic point-to-point link, sourced on each side's underlay-facing interface, destination set to the peer's underlay IP. Inner traffic is encapsulated in IP-protocol-47 (GRE) packets and rides the underlay. The INET` device in the topology is netverdict's "public internet transit stub" — it forwards between RFC-5737 doc-prefixes but is otherwise transparent. In production this stand-in is replaced by a real ISP path (often multi-hop, AS-path-based); the lab idealises it to a single hop so the student can focus on the GRE configuration and not get distracted by BGP.

Topology

2 × router, 1 × internet · Cisco IOS-style

What you will do

  1. First the underlay — A and B need to be able to reach each other's WAN address. Add a static route on A pointing at B's /30 via INET (ip route 198.51.100.0 255.255.255.252 203.0.113.2), and the mirror on B.

  2. On A, create Tunnel0 with tunnel source Gi0/0, tunnel destination 198.51.100.1 (B's WAN), and inner address 10.10.10.1/30.

  3. Mirror on B: Tunnel0 with tunnel source Gi0/0, tunnel destination 203.0.113.1, inner 10.10.10.2/30.

  4. With both ends configured, the overlay /30 is a connected route. Confirm with ping 10.10.10.2 from A — it should succeed.

Open this lab in your browser →

More labs on this topic

This lab in other languages

GRE-Tunnel: zwei Standorte übers öffentliche Internet verbindenTúnel GRE: conectar dos sitios a través de la internet públicaTúnel GRE: conectar dois sites pela internet públicaTunnel GRE : relier deux sites à travers l'internet publicGRE tunnel: public internet के पार दो sites जोड़ेंGRE 隧道:通过公网把两个站点连起来Tunnel GRE: collega due siti attraverso l'internet pubblicaGRE トンネル: 公衆インターネット越しに 2 拠点を接続GRE 터널: 공용 인터넷을 가로질러 두 사이트 연결GRE-туннель: соединяем две площадки через публичный интернетGRE tüneli: iki sahayı kamuya açık internet üzerinden bağlaTunnel GRE: nối hai site qua internet công cộng