This article demonstrates how to bring up a routing protocol via GRE over GRE on MX routers with the help of an example for users who might want to do so.
Lab Configuration
user@MX80-A is MX80 with logical system R1 and R3.
user@MX80-B is MX80 with logical system R2 and R4.
Both routers are running Junos OS Release 19.2R1.8.
Topology
R3(xe0/0/3) ------ (xe0/0/0)R1(xe0/0/2) ------ (xe0/0/2)R2(xe0/0/0) ------ (xe0/0/1)R4 Lo0 192.168.10.3/32 Lo0 192.168.10.1/32 Lo0 192.168.10.2/32 Lo0 192.168.10.4/32
Steps
Create the GRE port gr-0/0/0 on R1 and R2, the target logical topology, as shown below:
R3(xe0/0/3)-----(xe0/0/0)R1(gr-0/0/0)---------------(gr-0/0/0)R2(xe0/0/0)-----(xe0/0/1)R4
GRE interface on R1
labroot@MX80-A> show interfaces gr-0/0/0 Physical interface: gr-0/0/0, Enabled, Physical link is Up Interface index: 174, SNMP ifIndex: 555 Type: GRE, Link-level type: GRE, MTU: Unlimited, Speed: 100000mbps Device flags : Present Running Interface flags: Point-To-Point SNMP-Traps Input rate : 688 bps (1 pps) Output rate : 360 bps (0 pps) Logical interface gr-0/0/0.0 (Index 342) (SNMP ifIndex 1062) Flags: Up Point-To-Point SNMP-Traps 0x0 IP-Header 192.168.10.2:192.168.10.1:47:df:64:00000000000a000a Encapsulation: GRE-NULL Copy-tos-to-outer-ip-header: Off, Copy-tos-to-outer-ip-header-transit: Off Gre keepalives configured: Off, Gre keepalives adjacency state: down Input packets : 59 Output packets: 60 Protocol inet, MTU: 1476 Max nh cache: 0, New hold nh limit: 0, Curr nh cnt: 0, Curr new hold cnt: 0, NH drop cnt: 0 Flags: Sendbcast-pkt-to-re Addresses, Flags: Is-Preferred Is-Primary Destination: 172.16.1/24, Local: 172.16.1.1, Broadcast: 172.16.1.255
GRE interface on R2
user@MX80-B> show interfaces gr-0/0/0 Physical interface: gr-0/0/0, Enabled, Physical link is Up Interface index: 174, SNMP ifIndex: 620 Type: GRE, Link-level type: GRE, MTU: Unlimited, Speed: 100000mbps Device flags : Present Running Interface flags: Point-To-Point SNMP-Traps Input rate : 688 bps (0 pps) Output rate : 360 bps (0 pps) Logical interface gr-0/0/0.0 (Index 341) (SNMP ifIndex 938) Flags: Up Point-To-Point SNMP-Traps 0x0 IP-Header 192.168.10.1:192.168.10.2:47:df:64:0000000000090009 Encapsulation: GRE-NULL Copy-tos-to-outer-ip-header: Off, Copy-tos-to-outer-ip-header-transit: Off Gre keepalives configured: Off, Gre keepalives adjacency state: down Input packets : 67 Output packets: 69 Protocol inet, MTU: 1476 Max nh cache: 0, New hold nh limit: 0, Curr nh cnt: 0, Curr new hold cnt: 0, NH drop cnt: 0 Flags: Sendbcast-pkt-to-re Addresses, Flags: Is-Preferred Is-Primary Destination: 172.16.1/24, Local: 172.16.1.2, Broadcast: 172.16.1.255
Ping test between R1 and R2 via GRE interface gr-0/0/0
user@MX80-A> ping 172.16.1.2 source 172.16.1.1 logical-system R1 count 2 PING 172.16.1.2 (172.16.1.2): 56 data bytes 64 bytes from 172.16.1.2: icmp_seq=0 ttl=64 time=1.533 ms 64 bytes from 172.16.1.2: icmp_seq=1 ttl=64 time=0.959 ms
Apply the routing protocol OSPF to ensure reachability between R3 and R4 via the GRE port and OSPF.
OSPF neighbor between R1 and R2 via GRE port
user@MX80-A> show ospf neighbor logical-system R1 Address Interface State ID Pri Dead 172.16.1.2 gr-0/0/0.0 Full 192.168.10.2 128 31 10.10.0.3 xe-0/0/0.0 Full 192.168.10.3 128 31 user@MX80-B> show ospf neighbor logical-system R2 Address Interface State ID Pri Dead 172.16.1.1 gr-0/0/0.0 Full 192.168.10.1 128 35 10.20.0.4 xe-0/0/0.0 Full 192.168.10.4 128 39
Ping test between R3 and R4 through the physical port and OSPF
user@MX80-A> ping 10.20.0.4 source 10.10.0.3 logical-system R3 count 2 PING 10.20.0.4 (10.20.0.4): 56 data bytes 64 bytes from 10.20.0.4: icmp_seq=0 ttl=62 time=16.184 ms 64 bytes from 10.20.0.4: icmp_seq=1 ttl=62 time=1.055 ms
Create another GRE port gr-1/0/0 on R3 and R4, the target logical topology, as shown below:
R3(gr-1/0/0)----------------------------(gr-1/0/0)R4 Lo0.0 192.168.10.3/32 Lo0.0 192.168.10.4/32
GRE interface on R3
user@MX80-A> show interfaces gr-1/0/0 Physical interface: gr-1/0/0, Enabled, Physical link is Up Interface index: 183, SNMP ifIndex: 1053 Type: GRE, Link-level type: GRE, MTU: Unlimited, Speed: 100000mbps Device flags : Present Running Interface flags: Point-To-Point SNMP-Traps Input rate : 384 bps (0 pps) Output rate : 0 bps (0 pps) Logical interface gr-1/0/0.0 (Index 341) (SNMP ifIndex 1061) Flags: Up Point-To-Point SNMP-Traps 0x0 IP-Header 10.20.0.4:10.10.0.3:47:df:64:00000000000b000b Encapsulation: GRE-NULL Copy-tos-to-outer-ip-header: Off, Copy-tos-to-outer-ip-header-transit: Off Gre keepalives configured: Off, Gre keepalives adjacency state: down Input packets : 90 Output packets: 88 Protocol inet, MTU: 1476 Max nh cache: 0, New hold nh limit: 0, Curr nh cnt: 0, Curr new hold cnt: 0, NH drop cnt: 0 Flags: Sendbcast-pkt-to-re Addresses, Flags: Is-Preferred Is-Primary Destination: 192.168.1/24, Local: 192.168.1.1, Broadcast: 192.168.1.255 Protocol iso, MTU: 1476 Flags: Is-Primary
GRE interface on R4
user@MX80-B> show interfaces gr-1/0/0 Physical interface: gr-1/0/0, Enabled, Physical link is Up Interface index: 183, SNMP ifIndex: 929 Type: GRE, Link-level type: GRE, MTU: Unlimited, Speed: 100000mbps Device flags : Present Running Interface flags: Point-To-Point SNMP-Traps Input rate : 0 bps (0 pps) Output rate : 0 bps (0 pps) Logical interface gr-1/0/0.0 (Index 342) (SNMP ifIndex 939) Flags: Up Point-To-Point SNMP-Traps 0x0 IP-Header 10.10.0.3:10.20.0.4:47:df:64:0000000000080008 Encapsulation: GRE-NULL Copy-tos-to-outer-ip-header: Off, Copy-tos-to-outer-ip-header-transit: Off Gre keepalives configured: Off, Gre keepalives adjacency state: down Input packets : 94 Output packets: 98 Protocol inet, MTU: 1476 Max nh cache: 0, New hold nh limit: 0, Curr nh cnt: 0, Curr new hold cnt: 0, NH drop cnt: 0 Flags: Sendbcast-pkt-to-re Addresses, Flags: Is-Preferred Is-Primary Destination: 192.168.1/24, Local: 192.168.1.2, Broadcast: 192.168.1.255 Protocol iso, MTU: 1476 Flags: Is-Primary
Ping test between R3 and R4 via GRE interface gr-1/0/0
user@MX80-A> ping 192.168.1.2 source 192.168.1.1 logical-system R3 count 2 PING 192.168.1.2 (192.168.1.2): 56 data bytes 64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=1.158 ms 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=17.056 ms
ISIS neighbor between R3 and R4 via the GRE port
user@MX80-A> show isis adjacency logical-system R3 Interface System L State Hold (secs) SNPA gr-1/0/0.0 jtac-MX80-r075-R4 2 Up 26 user@MX80-B> show isis adjacency logical-system R4 Interface System L State Hold (secs) SNPA gr-1/0/0.0 jtac-MX80-r073-R3 2 Up 26
Ping test between R3 and R4 via the GRE port gr-1/0/0
user@MX80-A> ping 192.168.10.4 source 192.168.10.3 logical-system R3 count 2 PING 192.168.10.4 (192.168.10.4): 56 data bytes 64 bytes from 192.168.10.4: icmp_seq=0 ttl=64 time=1.137 ms 64 bytes from 192.168.10.4: icmp_seq=1 ttl=64 time=1.031 ms
The full configuration for reference is given below:
R1
set logical-systems R1 interfaces xe-0/0/2 unit 0 family inet address 10.10.10.1/24 set logical-systems R1 interfaces gr-0/0/0 unit 0 tunnel source 192.168.10.1 set logical-systems R1 interfaces gr-0/0/0 unit 0 tunnel destination 192.168.10.2 set logical-systems R1 interfaces gr-0/0/0 unit 0 family inet address 172.16.1.1/24 set logical-systems R1 interfaces xe-0/0/0 unit 0 family inet address 10.11.10.1/24 set logical-systems R1 interfaces lo0 unit 1 family inet address 192.168.10.1/32 set logical-systems R1 protocols ospf area 0.0.0.0 interface xe-0/0/0.0 interface-type p2p set logical-systems R1 protocols ospf area 0.0.0.0 interface gr-0/0/0.0 interface-type p2p set logical-systems R1 routing-options static route 192.168.10.2/32 next-hop 10.10.10.2
R2
set logical-systems R2 interfaces xe-0/0/2 unit 0 family inet address 10.10.10.2/24 set logical-systems R2 interfaces gr-0/0/0 unit 0 tunnel source 192.168.10.2 set logical-systems R2 interfaces gr-0/0/0 unit 0 tunnel destination 192.168.10.1 set logical-systems R2 interfaces gr-0/0/0 unit 0 family inet address 172.16.1.2/24 set logical-systems R2 interfaces xe-0/0/0 unit 0 family inet address 10.10.30.2/24 set logical-systems R2 interfaces lo0 unit 2 family inet address 192.168.10.2/32 set logical-systems R2 protocols ospf area 0.0.0.0 interface gr-0/0/0.0 interface-type p2p set logical-systems R2 protocols ospf area 0.0.0.0 interface xe-0/0/0.0 interface-type p2p set logical-systems R2 routing-options static route 192.168.10.1/32 next-hop 10.10.10.1
R3
set logical-systems R3 interfaces gr-1/0/0 unit 0 tunnel source 10.10.0.3 set logical-systems R3 interfaces gr-1/0/0 unit 0 tunnel destination 10.20.0.4 set logical-systems R3 interfaces gr-1/0/0 unit 0 family inet address 192.168.1.1/24 set logical-systems R3 interfaces gr-1/0/0 unit 0 family iso set logical-systems R3 interfaces xe-0/0/3 unit 0 family inet address 10.10.0.3/24 set logical-systems R3 interfaces lo0 unit 3 family inet address 192.168.10.3/32 set logical-systems R3 interfaces lo0 unit 3 family iso address 49.0001.3333.3333.3333.00 set logical-systems R3 protocols isis level 1 disable set logical-systems R3 protocols isis interface gr-1/0/0.0 point-to-point set logical-systems R3 protocols isis interface lo0.3 passive set logical-systems R3 protocols ospf area 0.0.0.0 interface xe-0/0/3.0 interface-type p2p
R4
set logical-systems R4 interfaces gr-1/0/0 unit 0 tunnel source 10.20.0.4 set logical-systems R4 interfaces gr-1/0/0 unit 0 tunnel destination 10.10.0.3 set logical-systems R4 interfaces gr-1/0/0 unit 0 family inet address 192.168.1.2/24 set logical-systems R4 interfaces gr-1/0/0 unit 0 family iso set logical-systems R4 interfaces xe-0/0/1 unit 0 family inet address 10.20.0.4/24 set logical-systems R4 interfaces lo0 unit 4 family inet address 192.168.10.4/32 set logical-systems R4 interfaces lo0 unit 4 family iso address 49.0001.4444.4444.4444.00 set logical-systems R4 protocols isis level 1 disable set logical-systems R4 protocols isis interface gr-1/0/0.0 point-to-point set logical-systems R4 protocols isis interface lo0.4 passive set logical-systems R4 protocols ospf area 0.0.0.0 interface xe-0/0/1.0 interface-type p2p