This article has an example of the configuration in a "display set" mode for the GRE tunnel on an EX4650 running version 22.2R3.15 with the following requirements:
GRE tunnel interface must be in a VRF routing instance
GRE tunnel source IP address must be on the loopback interface which lives in the default table inet.0
BGP must be established over the GRE tunnel
Here is the complete configuration:
On Switch A
set interfaces gr-0/0/0 unit 0 tunnel source 1.1.1.1 set interfaces gr-0/0/0 unit 0 tunnel destination 2.2.2.2 set interfaces gr-0/0/0 unit 0 family inet address 192.70.1.2/24 set interfaces xe-0/0/1 unit 0 family inet address 192.70.0.4/24 set interfaces lo0 unit 0 family inet address 1.1.1.1/32 set policy-options policy-statement TUNEEL-IPs term term1 from protocol bgp set policy-options policy-statement TUNEEL-IPs term term1 then accept set routing-instances R1 instance-type virtual-router set routing-instances R1 protocols bgp group gre peer-as 10 set routing-instances R1 protocols bgp group gre local-as 20 set routing-instances R1 protocols bgp group gre neighbor 192.70.1.5 set routing-instances R1 interface gr-0/0/0.0 set routing-options static route 2.2.2.2/32 next-hop 192.70.0.6
On Switch B
set version 22.2R3.15 set system host-name d16-42-PE2 set interfaces gr-0/0/0 unit 0 tunnel source 2.2.2.2 set interfaces gr-0/0/0 unit 0 tunnel destination 1.1.1.1 set interfaces gr-0/0/0 unit 0 family inet address 192.70.1.5/24 set interfaces xe-0/0/0 unit 0 family inet address 192.70.0.6/24 set interfaces lo0 unit 0 family inet address 2.2.2.2/32 set policy-options policy-statement TUNEEL-IPs term term1 from protocol bgp set policy-options policy-statement TUNEEL-IPs term term1 then accept set routing-instances R1 instance-type virtual-router set routing-instances R1 protocols bgp group gre peer-as 20 set routing-instances R1 protocols bgp group gre local-as 10 set routing-instances R1 protocols bgp group gre neighbor 192.70.1.2 set routing-instances R1 interface gr-0/0/0.0 set routing-options static route 1.1.1.1/32 next-hop 192.70.0.4