Lab 3.3 - Running Routing Protocols over Tunnels: OSPF over GRE and IPIP

Share
Lab 3.3 - Running Routing Protocols over Tunnels: OSPF over GRE and IPIP

Introduction

Labs 3.1 and 3.2 connected sites with static routes. Each time a tunnel was built, someone had to add a route for every remote subnet on both routers, and remove it again at cleanup. That works for two sites with one LAN each. It does not work for a network of many sites, or for a network where links fail and must be routed around without an operator noticing.

A routing protocol solves this by letting routers exchange information about the networks they can reach. Each router announces its own subnets and learns the others', then picks the best path to each one. When a link fails, the routers notice, recalculate, and move traffic to the next best path automatically. Tunnels are ordinary interfaces to a routing protocol, so the protocol can run over them just as it runs over a physical link. This is the step that turns a tunnel from a single hand-built path into part of a self-maintaining network.

This lab runs OSPF, the link-state protocol introduced in Module 4, over two tunnel types from Lab 3.2. You will advertise LAN subnets over a GRE tunnel with no static routes, verify the adjacency and learned routes, and watch the routing table react when the tunnel fails. You will then add an IPIP tunnel alongside it, control which path is preferred using interface cost, and observe the failover. The final section covers the failures that are specific to routing over tunnels: adjacencies that never form, routes that are missing or wrong, and tunnels that carry unicast traffic but not the multicast OSPF depends on.

Work through the steps in order. Each tunnel is removed before the next one that conflicts with it, as in Lab 3.2.

Terminology Definitions

Routing Protocol: Software that routers use to exchange reachability information automatically, so that routes are learned rather than typed in.

OSPF (Open Shortest Path First): A link-state interior routing protocol. Every router floods information about its links to all routers in the same area, then each router runs Dijkstra's shortest-path algorithm over the resulting map to compute its routes.

Adjacency (Neighbour): A relationship between two OSPF routers that exchange link-state information directly. Adjacencies are formed by hello packets and move through states such as Down, Init, ExStart, and Full. Routes are exchanged only once the adjacency reaches Full.

Hello and Dead Interval: OSPF routers send hello packets at a fixed interval to find and maintain neighbours. If no hello arrives within the dead interval, the neighbour is declared down and its routes are withdrawn. The default dead interval is four times the hello interval.

Router ID: A 32-bit identifier, written in dotted notation, that uniquely identifies an OSPF router. It must be unique within the OSPF domain. It is not required to be a reachable IP address.

Area: A logical grouping of OSPF routers and links. Area 0 (the backbone, 0.0.0.0) is required. This lab uses a single area.

Interface Template: In RouterOS 7, the mechanism that tells OSPF which interfaces or subnets to run on, the area each belongs to, its network type, its cost, and whether it is passive.

Point-to-Point (ptp) Network Type: An OSPF network type for links with exactly two routers and no broadcast capability. A GRE or IPIP tunnel between two routers is a natural fit. On a ptp link OSPF does not elect a designated router.

Passive Interface: An OSPF interface that advertises its subnet into OSPF but sends no hello packets. Passive interfaces are used for LAN-facing ports, so that end hosts and unrelated devices do not form adjacencies.

Cost: The metric OSPF assigns to an interface. Routes are compared by their total cost, and the lowest total is preferred. Cost is how a network chooses between two paths when both are available.

Multicast: One-to-many traffic. OSPF sends hellos and flooded updates to multicast addresses (224.0.0.5 and 224.0.0.6). A tunnel must carry multicast for OSPF to work over it.

GRE: A tunnelling protocol, defined in RFC 2784, that wraps a network-layer packet inside another IP packet so it can cross a network that would not otherwise carry it. The outer packet uses IP protocol number 47 and is addressed between the two tunnel endpoints. The inner packet is unchanged until it is unwrapped at the far end. GRE carries several kinds of payload, including IPv4, IPv6, and multicast, and it adds no encryption or authentication on its own.

Lab Topology

R1 and R2 are connected over the WAN on ether1, and each has a LAN on ether2. VPC1 and VPC2 are end hosts used to verify end-to-end reachability. R3 is not used in this lab.

Network summary:

Device Interface Address Purpose
R1 ether1 203.0.113.1/30 WAN to R2 (tunnel underlay)
R1 ether2 10.10.1.1/24 HQ LAN
R2 ether1 203.0.113.2/30 WAN to R1
R2 ether2 10.10.2.1/24 Branch LAN
VPC1 eth0 10.10.1.10/24 HQ workstation
VPC2 eth0 10.10.2.10/24 Branch workstation

Overlay address plan:

Tunnel Overlay R1 side R2 side OSPF cost
GRE 10.255.1.0/30 10.255.1.1 10.255.1.2 10
IPIP 10.255.4.0/30 10.255.4.1 10.255.4.2 100

The OSPF router IDs are 1.1.1.1 on R1 and 2.2.2.2 on R2. These are identifiers only and do not need to be routable addresses.