Examples of configuring GRE tunnels using hardware from various manufacturers

April 17, 2024

ID 205377

Cisco equipment

R1(config)# interface Tunnel1

R1(config-if)# ip address 10.10.20.1 255.255.255.252

R1(config-if)# tunnel source 1.1.1.1

R1(config-if)# tunnel destination 2.2.2.2

R1(config)# interface Tunnel2

R1(config-if)# ip address 10.10.20.5 255.255.255.252

R1(config-if)# tunnel source 1.1.1.1

R1(config-if)# tunnel destination 3.3.3.3

Juniper equipment

Implementation of GRE tunneling on EX switches somewhat differs from GRE tunnel implementation on MX routers.
To use GRE, first you must allocate a physical interface card (PIC) whose resources will be used to process GRE.
A special feature of EX switches is that you need to specify an Ethernet port that will be disabled so that its resource can be used.
This example uses ge-0/0/10:

set chassis fpc 0 pic 0 tunnel-port 10 tunnel-services

Configuration:

chassis {

fpc 0 {

pic 0 {

tunnel-port 10 {

tunnel-services;

}

}

}

}

On MX routers, you do not need to specify an interface and disable it:

set chassis fpc 0 pic 0 tunnel-services bandwidth 1g

Configuration:

chassis {

fpc 0 {

pic 0 {

tunnel-services {

bandwidth 10g;

}

}

}

}

Tunnel interfaces are named according to the format gr-*, and are numbered according to the number of the Ethernet interface that was disabled at the first step.
Multiple tunnels on various subinterfaces (units) can be created on one interface:

set interfaces gr-0/0/10 unit 0 tunnel source 1.1.1.1

set interfaces gr-0/0/10 unit 0 tunnel destination 2.2.2.2

set interfaces gr-0/0/10 unit 0 family inet address 10.10.20.1/30

set interfaces gr-0/0/10 unit 1 tunnel source 1.1.1.1

set interfaces gr-0/0/10 unit 1 tunnel destination 3.3.3.3

set interfaces gr-0/0/10 unit 1 family inet address 10.10.20.5/30

Configuration:

interfaces {

gr-0/0/10 {

unit 0 {

tunnel {

source 1.1.1.1;

destination 2.2.2.2;

}

family inet {

address 10.10.20.1/30;

}

}

unit 1 {

tunnel {

source 1.1.1.1;

destination 3.3.3.3;

}

family inet {

address 10.10.20.5/30;

}

}

}

}

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.