Select Page

GRE TunneL

Generic Routing Encapsulation (GRE)

  • GRE tunnels are stateless-–that is, the endpoint of the tunnel contains no information about the state or availability of the remote tunnel endpoint. Therefore, the switch operating as a tunnel source router cannot change the state of the GRE tunnel interface to down if the remote endpoint is unreachable.

GRE encapsulates data packets and redirects them to a device that de-encapsulates them and routes them to their final destination. This allows the source and destination switches to operate as if they have a virtual point-to-point connection with each other (because the outer header applied by GRE is transparent to the encapsulated payload packet). 

Juniper vMX 14 & EVE-NG Pro is used for this lab.

 Devices Configuration: 

[email protected]> show configuration |display set 
set version 14.1R4.8
set system host-name R1
set system root-authentication encrypted-password "$1$WaL4BSs9$mlznqm3jQMhdGgufqq1YF1"
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set chassis fpc 0 pic 0 tunnel-services bandwidth 10g
set interfaces ge-0/0/0 unit 0 family inet address 12.12.12.1/24
set interfaces gr-0/0/0 unit 13 tunnel source 12.12.12.1
set interfaces gr-0/0/0 unit 13 tunnel destination 23.23.23.3
set interfaces gr-0/0/0 unit 13 family inet address 13.13.13.1/24
set interfaces gre unit 13 family inet
set interfaces lo0 unit 1 family inet address 1.1.1.1/24
set routing-options autonomous-system 100
set protocols bgp group IBGP type external
set protocols bgp group IBGP peer-as 200
set protocols bgp group IBGP neighbor 12.12.12.2 export r1-loop
set protocols ospf area 0.0.0.0 interface gr-0/0/0.13
set protocols ospf area 0.0.0.0 interface lo0.1
set policy-options policy-statement r1-loop term t1 from interface lo0.1
set policy-options policy-statement r1-loop term t1 then accept
 
[email protected]> show configuration |display set 
set version 14.1R4.8
set system host-name R2
set system root-authentication encrypted-password "$1$WaL4BSs9$mlznqm3jQMhdGgufqq1YF1"
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set interfaces ge-0/0/0 unit 0 family inet address 12.12.12.2/24
set interfaces ge-0/0/1 unit 0 family inet address 23.23.23.2/24
set routing-options autonomous-system 200
set protocols bgp group EBGP type external
set protocols bgp group EBGP export direct
set protocols bgp group EBGP peer-as 100
set protocols bgp group EBGP neighbor 12.12.12.1
set protocols bgp group EBGP neighbor 23.23.23.3
set policy-options policy-statement direct term t1 from protocol direct
set policy-options policy-statement direct term t1 then accept
[email protected]> show configuration |display set 
set version 14.1R4.8
set system host-name R3
set system root-authentication encrypted-password "$1$WaL4BSs9$mlznqm3jQMhdGgufqq1YF1"
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set chassis fpc 0 pic 0 tunnel-services bandwidth 10g
set interfaces gr-0/0/0 unit 13 tunnel source 23.23.23.3
set interfaces gr-0/0/0 unit 13 tunnel destination 12.12.12.1
set interfaces gr-0/0/0 unit 13 family inet address 13.13.13.3/24
set interfaces ge-0/0/1 unit 0 family inet address 23.23.23.3/24
set interfaces gre unit 13 family inet
set interfaces lo0 unit 3 family inet address 3.3.3.3/24
set routing-options autonomous-system 100
set protocols bgp group IBGP type external
set protocols bgp group IBGP peer-as 200
set protocols bgp group IBGP neighbor 23.23.23.2 export r3-loop
set protocols ospf area 0.0.0.0 interface gr-0/0/0.13
set protocols ospf area 0.0.0.0 interface lo0.3
set policy-options policy-statement r3-loop term t1 from interface lo0.3
set policy-options policy-statement r3-loop term t1 then accept
— Configuration | Verification —

— Tunnel Config & Reachability:

R1>
set chassis fpc 0 pic 0 tunnel-services bandwidth 10g
set interfaces ge-0/0/0 unit 0 family inet address 12.12.12.1/24
set interfaces gr-0/0/0 unit 13 tunnel source 12.12.12.1
set interfaces gr-0/0/0 unit 13 tunnel destination 23.23.23.3
set interfaces gr-0/0/0 unit 13 family inet address 13.13.13.1/24
set interfaces gre unit 13 family inet
set interfaces lo0 unit 1 family inet address 1.1.1.1/24
set routing-options autonomous-system 100
set protocols bgp group IBGP type external
set protocols bgp group IBGP peer-as 200
set protocols bgp group IBGP neighbor 12.12.12.2 export r1-loop
set protocols ospf area 0.0.0.0 interface gr-0/0/0.13
set protocols ospf area 0.0.0.0 interface lo0.1
set policy-options policy-statement r1-loop term t1 from interface lo0.1
set policy-options policy-statement r1-loop term t1 then accept

R2>
set routing-options autonomous-system 200
set protocols bgp group EBGP type external
set protocols bgp group EBGP export direct
set protocols bgp group EBGP peer-as 100
set protocols bgp group EBGP neighbor 12.12.12.1
set protocols bgp group EBGP neighbor 23.23.23.3
set policy-options policy-statement direct term t1 from protocol direct
set policy-options policy-statement direct term t1 then accept

R3>

set
set chassis fpc 0 pic 0 tunnel-services bandwidth 10g
set interfaces gr-0/0/0 unit 13 tunnel source 23.23.23.3
set interfaces gr-0/0/0 unit 13 tunnel destination 12.12.12.1
set interfaces gr-0/0/0 unit 13 family inet address 13.13.13.3/24
set interfaces ge-0/0/1 unit 0 family inet address 23.23.23.3/24
set interfaces gre unit 13 family inet
set interfaces lo0 unit 3 family inet address 3.3.3.3/24
set routing-options autonomous-system 100
set protocols bgp group IBGP type external
set protocols bgp group IBGP peer-as 200
set protocols bgp group IBGP neighbor 23.23.23.2 export r3-loop
set protocols ospf area 0.0.0.0 interface gr-0/0/0.13
set protocols ospf area 0.0.0.0 interface lo0.3
set policy-options policy-statement r3-loop term t1 from interface lo0.3
set policy-options policy-statement r3-loop term t1 then accept
[email protected]> show bgp summary 
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       2          1          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
12.12.12.2              200         29         30       0       0       12:05 1/2/2/0              0/0/0/0

[email protected]> show bgp summary 
Groups: 1 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       2          2          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
12.12.12.1              100         29         29       0       0       12:01 1/1/1/0              0/0/0/0
23.23.23.3              100         30         30       0       0       12:01 1/1/1/0              0/0/0/0

[email protected]> show bgp summary 
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0               
                       2          1          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
23.23.23.2              200         30         30       0       0       11:53 1/2/2/0              0/0/0/0

[email protected]> ping 13.13.13.3 source 13.13.13.1 
PING 13.13.13.3 (13.13.13.3): 56 data bytes
64 bytes from 13.13.13.3: icmp_seq=0 ttl=64 time=2.489 ms
64 bytes from 13.13.13.3: icmp_seq=1 ttl=64 time=2.785 ms
64 bytes from 13.13.13.3: icmp_seq=2 ttl=64 time=4.161 ms
^C
--- 13.13.13.3 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 2.489/3.145/4.161/0.729 ms

[email protected]> trace 13.13.13.3 source 13.13.13.1   
traceroute to 13.13.13.3 (13.13.13.3) from 13.13.13.1, 30 hops max, 40 byte packets
 1  13.13.13.3 (13.13.13.3)  5.122 ms  4.086 ms  2.410 ms
 

— Verification:

- OSPF Routing & GRE interface:
[email protected]> show ospf neighbor 
Address          Interface              State     ID               Pri  Dead
13.13.13.3       gr-0/0/0.13            Full      3.3.3.3          128    34

[email protected]> show ospf neighbor 
OSPF instance is not running

[email protected]> show ospf neighbor 
Address          Interface              State     ID               Pri  Dead
13.13.13.1       gr-0/0/0.13            Full      1.1.1.1          128    38

[email protected]> show route 13.13.13.0 extensive 

inet.0: 10 destinations, 12 routes (10 active, 0 holddown, 0 hidden)
13.13.13.0/24 (2 entries, 0 announced)
        *Direct Preference: 0
                Next hop type: Interface
                Address: 0x9690438
                Next-hop reference count: 1
                Next hop: via gr-0/0/0.13, selected
                State: 
                Local AS:   100 
                Age: 16:36 
                Validation State: unverified 
                Task: IF
                AS path: I
         OSPF   Preference: 10
                Next hop type: Router
                Address: 0x96904d0
                Next-hop reference count: 1
                Next hop: via gr-0/0/0.13, selected
                Session Id: 0x0
                State: 
                Inactive reason: Route Preference
                Local AS:   100 
                Age: 16:36      Metric: 1 
                Validation State: unverified 
                Area: 0.0.0.0
                Task: OSPF
                AS path: I

[email protected]> show route 

inet.0: 10 destinations, 12 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.0/24         *[Direct/0] 00:17:08
                    > via lo0.1
1.1.1.1/32         *[Local/0] 00:17:08
                      Local via lo0.1
3.3.3.0/24         *[OSPF/10] 00:15:42, metric 1
                    > via gr-0/0/0.13
3.3.3.3/32         *[OSPF/10] 00:15:42, metric 1
                    > via gr-0/0/0.13
12.12.12.0/24      *[Direct/0] 00:16:05
                    > via ge-0/0/0.0
                    [BGP/170] 00:15:56, localpref 100
                      AS path: 200 I, validation-state: unverified
                    > to 12.12.12.2 via ge-0/0/0.0
12.12.12.1/32      *[Local/0] 00:16:06
                      Local via ge-0/0/0.0
13.13.13.0/24      *[Direct/0] 00:15:56
                    > via gr-0/0/0.13
                    [OSPF/10] 00:15:56, metric 1
                    > via gr-0/0/0.13
13.13.13.1/32      *[Local/0] 00:17:00  
                      Local via gr-0/0/0.13
23.23.23.0/24      *[BGP/170] 00:15:56, localpref 100
                      AS path: 200 I, validation-state: unverified
                    > to 12.12.12.2 via ge-0/0/0.0
224.0.0.5/32       *[OSPF/10] 00:17:08, metric 1
                      MultiRecv 

 

Share on print
Print
Share on google
Google+
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Prepaid Phones, SIM Cards, No-Contract & Pay As You Go Phones at a price you wouldn’t expect.

 

The Juniper All-Access | Reading List

Leave a reply

Your email address will not be published. Required fields are marked *

ADENTECH guides

We love to help.

Get our newsletter, join the community: