Configure a GRE tunnel via the Internet. This creates a virtual point-to-point connection between the two locations.

Network Diagram

Configure a GRE tunnel between R11 and R21 in the following network diagram. the GRE tunnel provides a virtual point-to-point connection between R11 and R21.

Fig. Example of GRE tunnel interface configuration
Fig. Example of GRE tunnel interface configuration

To configure the GRE tunnel interface, it is assumed that communication is available between R11 and R21.

Configuring and Verifying the GRE Tunnel Interface

Configuring GRE Tunnel Interface

Create a tunnel interface with R11 and R21. You can use any interface number, in this case 0. You can use the tunnel destination and tunnel source commands to specify the destination and source IP addresses of the IP headers for forwarding. You also need the IP address to send and receive IP packets on Tunnel0. Instead of configuring the IP address explicitly, we configure ip unnumbered to use the IP address of Loopback0.


interface Tunnel0
 ip unnumbered Loopback0
 tunnel source Ethernet0/0
 tunnel destination


interface Tunnel0
 ip unnumbered Loopback0
 tunnel source Ethernet0/0
 tunnel destination

Verifying GRE Tunnel Interface

The show interface tunnel0 command verifies the tunnel interface between R11 and R21. the output of show interface tunnel0 at R11 is as follows.


R11#show interfaces tunnel 0
Tunnel0 is up, line protocol is up
  Hardware is Tunnel
  Interface is unnumbered. Using address of Loopback0 (
  MTU 1514 bytes, BW 9 Kbit/sec, DLY 500000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation TUNNEL, loopback not set
  Keepalive not set
  Tunnel source (Ethernet0/0), destination
  Tunnel protocol/transport GRE/IP
    Key disabled, sequencing disabled
    Checksumming of packets disabled
  Tunnel TTL 255
  Fast tunneling enabled
  Tunnel transmit bandwidth 8000 (kbps)
  Tunnel receive bandwidth 8000 (kbps)
-- omitted --

Enable RIP on tunnel interface

Configure routing with RIP so that communication between Site1 and Site2 is possible via the GRE tunnel.


router rip
 version 2
 no auto-summary

The GRE tunnel is ip unnumbered and has the same IP address as Loopback0. Therefore, if RIP is enabled on Loopback0, RIP will be enabled on tunnel0 at the same time.

Verify Routing

RIP is enabled in the GRE tunnel, and we are able to learn the route information of each other’s sites via the GRE tunnel. the routing status in R11 is as follows


R11#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 20 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    Ethernet0/1           2     2
    Loopback0             2     2
    Tunnel0               2     2
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
  Routing Information Sources:
    Gateway         Distance      Last Update           120      00:00:01            120      00:00:27
  Distance: (default is 120)

R11#show ip route

Gateway of last resort is to network is subnetted, 1 subnets
C is directly connected, Ethernet0/0 is variably subnetted, 8 subnets, 2 masks
R [120/1] via, 00:00:03, Tunnel0
C is directly connected, Ethernet0/1
R [120/1] via, 00:00:05, Ethernet0/1
R [120/2] via, 00:00:03, Tunnel0
R [120/1] via, 00:00:05, Ethernet0/1
C is directly connected, Loopback0
R [120/1] via, 00:00:04, Tunnel0
R [120/2] via, 00:00:04, Tunnel0
S* [1/0] via

Verifying communication between sites

Verify the communication between PC1 and PC2. Execute a ping from PC1 to PC2.


PC1> ping
84 bytes from icmp_seq=1 ttl=60 time=103.327 ms
84 bytes from icmp_seq=2 ttl=60 time=89.114 ms
84 bytes from icmp_seq=3 ttl=60 time=78.018 ms
84 bytes from icmp_seq=4 ttl=60 time=98.787 ms
84 bytes from icmp_seq=5 ttl=60 time=102.156 ms

ICMP packets when pinging from PC1 to PC2 will be output from the tunnel0 interface on R11.

図 R11での拠点2あてのルーティング
図 R11での拠点2あてのルーティング

When output from the tunnel0 interface, a GRE header and a new IP header are added and output from E0/0. It will be routed to R21 with the new IP header.

図 Tunnel0インタフェースからパケット出力
図 Tunnel0インタフェースからパケット出力