This article provides information on how to export the routes that are learned from the same AS into the same AS again.
SRX-A (AS 12345) (192.168.2.1)--EBGP peering--(192.168.2.2) SRX-B (AS 11111)(192.168.3.2)--EBGP peering--(192.168.3.1) SRX-C (AS 12345)
root@SRX-B# run show route advertising-protocol bgp 192.168.3.1 VR.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 0.0.0.0/0 Self 12345 I< route learned from AS 12345 root@SRX-C# run show route receive-protocol bgp 192.168.3.2 inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 1 hidden) < shows it as hidden route Prefix Nexthop MED Lclpref AS path
protocols { bgp { group g2 { type external; peer-as 12345; local-as 11111; as-override; < neighbor 192.168.3.1; } } } root@SRX-B# run show route advertising-protocol bgp 192.168.3.1 VR.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 0.0.0.0/0 Self 11111 I > AS 12345 overridden with local AS 11111 root@SRX-C# run show route receive-protocol bgp 192.168.3.2 inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 0.0.0.0/0 192.168.3.2 11111 11111 I < route installed
protocols { bgp { group g2 { type external; peer-as 12345; local-as 11111; as-override; < neighbor 192.168.3.1; } } } root@SRX-B# run show route advertising-protocol bgp 192.168.3.1 VR.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 0.0.0.0/0 Self 11111 I > AS 12345 overridden with local AS 11111 root@SRX-C# run show route receive-protocol bgp 192.168.3.2 inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path
* 0.0.0.0/0 192.168.3.2 11111 11111 I < route installed
interfaces { lt-0/0/0 { unit 0 { encapsulation ethernet; peer-unit 1; family inet { address 1.1.1.1/30; } } unit 1 { encapsulation ethernet; peer-unit 0; family inet { address 1.1.1.2/30; } } } ge-0/0/1 { unit 0 { family inet { address 192.168.2.1/24; < Interface connected to SRX-A } } } ge-0/0/2 { unit 0 { family inet { address 192.168.3.2/24; < Interface connected to SRX-C } } } } protocols { bgp { export 2; group g1 { type external; peer-as 12345; local-as 11111; neighbor 192.168.2.2; } } ospf { export 1; area 0.0.0.0 { interface lt-0/0/0.0; } } } routing-instances { VR { instance-type virtual-router; interface lt-0/0/0.1; interface ge-0/0/2.0; protocols { bgp { export 3; group g2 { type external; peer-as 12345; local-as 11111; neighbor 192.168.3.1; } } ospf { area 0.0.0.0 { interface lt-0/0/0.1; } } } } } inet.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[BGP/170] 01:02:26, localpref 100 AS path: 12345 I > to 192.168.2.2 via ge-0/0/1.0 < Route learned from SRX-A (AS 12345) VR.inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[OSPF/150] 00:03:59, metric 0, tag 0 > to 1.1.1.1 via lt-0/0/0.1 < Converted that route into OSPF route and now exported it to SRX-C [edit] root@3600-2# run show route advertising-protocol bgp 192.168.3.1 VR.inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 0.0.0.0/0 Self 0 I [edit] root@3600-1# run show route receive-protocol bgp 192.168.3.2 inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 0.0.0.0/0 192.168.3.2 0 11111 I < route received on SRX -C
interfaces { lt-0/0/0 { unit 0 { encapsulation ethernet; peer-unit 1; family inet { address 1.1.1.1/30; } } unit 1 { encapsulation ethernet; peer-unit 0; family inet { address 1.1.1.2/30; } } } ge-0/0/1 { unit 0 { family inet { address 192.168.2.1/24; < Interface connected to SRX-A } } } ge-0/0/2 { unit 0 { family inet { address 192.168.3.2/24; < Interface connected to SRX-C } } } } protocols { bgp { export 2; group g1 { type external; peer-as 12345; local-as 11111; neighbor 192.168.2.2; } } ospf { export 1; area 0.0.0.0 { interface lt-0/0/0.0; } } } routing-instances { VR { instance-type virtual-router; interface lt-0/0/0.1; interface ge-0/0/2.0; protocols { bgp { export 3; group g2 { type external; peer-as 12345; local-as 11111; neighbor 192.168.3.1; } } ospf { area 0.0.0.0 { interface lt-0/0/0.1; } } } } } inet.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[BGP/170] 01:02:26, localpref 100 AS path: 12345 I > to 192.168.2.2 via ge-0/0/1.0 < Route learned from SRX-A (AS 12345) VR.inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[OSPF/150] 00:03:59, metric 0, tag 0 > to 1.1.1.1 via lt-0/0/0.1 < Converted that route into OSPF route and now exported it to SRX-C [edit] root@3600-2# run show route advertising-protocol bgp 192.168.3.1 VR.inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 0.0.0.0/0 Self 0 I [edit] root@3600-1# run show route receive-protocol bgp 192.168.3.2 inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path
* 0.0.0.0/0 192.168.3.2 0 11111 I < route received on SRX -C