GRE tunnel: configuration, verification and OSPF over the tunnel
Sign in to read this lesson
GRE (Generic Routing Encapsulation) puts IP packets inside another IP packet (a tunnel) but doesn't encrypt anything. A GRE tunnel looks like a normal link but it is virtual, and it gets an IP address. Configuration: interface tunnel 1, tunnel source, tunnel destination and ip address. The outer header carries the tunnel source/destination (public) addresses. In the lab the SAMKIR branch and BAKI head office build a tunnel through the ISP; OSPF forms an adjacency over the tunnel and the private networks learn each other. Verify with show ip interface brief, show interface tunnel 1 and ping.
What you will learn
- GRE (Generic Routing Encapsulation) puts an IP packet inside another IP packet (tunneling, IP protocol 47). GRE itself does not encrypt.
- A GRE tunnel looks like a normal link but it is virtual: it gets an IP address (here 172.16.12.0/24).
- Configuration:
interface tunnel 1→tunnel source(own public address or interface) →tunnel destination(the other router's public address) →ip address. - The outer header of a tunneled packet carries the tunnel source and destination (public) addresses; the original packet with private addresses travels inside. This way private networks that aren't routable on the Internet can reach each other.
- A routing protocol can run over the tunnel: the OSPF adjacency forms over Tunnel1 and the next hop is the other side's tunnel address. Verify with
show ip interface brief,show interface tunnel 1(Tunnel protocol/transport GRE/IP),ping ... source.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.