Evil_TTL> show | s

Juniper SRX GRE Tunnel with Loopback Interface as Source

Category:Juniper -> Security

Template:

set interfaces lo0 unit 0 family inet address 127.0.0.1/32
set interfaces lo0 unit 1 family inet address 1.1.1.1
/32
set interfaces lo0 unit 2 family inet address 1.1.1.2
/32

set routing
-instances TUNNEL1 instance-type virtual-router
set routing
-instances TUNNEL2 instance-type virtual-router

set routing
-instances TUNNEL1 interface lo0.1
set routing
-instances TUNNEL2 interface lo0.2

set interfaces gr
-0/0/0 unit 1 tunnel source 1.1.1.1
set interfaces gr
-0/0/0 unit 1 tunnel destination 8.8.8.8
set interfaces gr
-0/0/0 unit 1 family inet address 192.168.100.1/30
set security zones security
-zone untrust interfaces gr-0/0/0.1

set interfaces gr
-0/0/0 unit 2 tunnel source 1.1.1.2
set interfaces gr
-0/0/0 unit 2 tunnel destination 8.8.8.8
set interfaces gr
-0/0/0 unit 2 family inet address 192.168.100.5/30
set security zones security
-zone untrust interfaces gr-0/0/0.2 

It is a requirement by JunOS that a separate routing-instance must be used per loopback interface. As long as the Physical interface, which is used to reach tunnel destination address is in default routing-instance there is no need to perform route leaking.

By privilege15