M/MX/T series router cannot receive the IBGP routes which have its own AS in its path.
Example:
(lo0:1.1.1.1/24)MX1--------------AS100—EBGP---AS200---------------MX2(16.1R5.7)-----------------------IBGP AS200---------------------MX3(13.3R8.7)--------------AS200---EBGP---AS300----------------MX4(lo0:4.4.4.4/24)
MX1 AS100
MX2, MX3 AS200
MX4 AS300
MX1 configuration:
set interfaces ge-0/0/0 unit 0 family inet address 12.1.1.1/24
set interfaces lo0 unit 0 family inet address 1.1.1.1/24
set routing-options autonomous-system 100
set protocols bgp group EBGP export lo0
set protocols bgp group EBGP neighbor 12.1.1.2 peer-as 200
set policy-options policy-statement lo0 from protocol direct
set policy-options policy-statement lo0 then accept
MX2 configuration:
set interfaces ge-1/2/8 unit 0 family inet address 12.1.1.2/24
set interfaces ge-1/3/0 unit 0 family inet address 23.1.1.2/24
set routing-options autonomous-system 200
set protocols bgp group EBGP import prependas
set protocols bgp group EBGP export direct
set protocols bgp group EBGP neighbor 12.1.1.1 peer-as 100
set protocols bgp group IBGP export nexthop
set protocols bgp group IBGP neighbor 23.1.1.3 peer-as 200
set policy-options policy-statement direct from protocol direct
set policy-options policy-statement direct then accept
set policy-options policy-statement nexthop from protocol bgp
set policy-options policy-statement nexthop then next-hop self
set policy-options policy-statement prependas then as-path-prepend 200
MX3 configuration:
set interfaces ge-1/2/0 unit 0 family inet address 34.1.1.3/24
set interfaces ge-1/2/1 unit 0 family inet address 23.1.1.3/24
set routing-options autonomous-system 200
set protocols bgp group IBGP export nexthop
set protocols bgp group IBGP neighbor 23.1.1.2 peer-as 200
set protocols bgp group EBGP import prependas
set protocols bgp group EBGP export direct
set protocols bgp group EBGP neighbor 34.1.1.4 peer-as 300
set policy-options policy-statement direct from protocol direct
set policy-options policy-statement direct then accept
set policy-options policy-statement nexthop from protocol bgp
set policy-options policy-statement nexthop then next-hop self
set policy-options policy-statement prependas then as-path-prepend 200
MX4 configuration:
set interfaces ge-0/0/0 unit 0 family inet address 34.1.1.4/24
set interfaces lo0 unit 0 family inet address 4.4.4.4/24
set routing-options autonomous-system 300
set protocols bgp group EBGP export lo0
set protocols bgp group EBGP neighbor 34.1.1.3 peer-as 200
set policy-options policy-statement lo0 from protocol direct
set policy-options policy-statement lo0 then accept
On MX2:
MX2# run show route advertising-protocol bgp 23.1.1.3
inet.0: 6 destinations, 7 routes (6 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 1.1.1.0/24 Self 100 200 100 I
[edit]
MX2# run show route receive-protocol bgp 23.1.1.3
inet.0: 6 destinations, 7 routes (6 active, 0 holddown, 0 hidden)
On MX3:
MX3# run show route advertising-protocol bgp 23.1.1.2
inet.0: 6 destinations, 7 routes (6 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 4.4.4.0/24 Self 100 200 300 I
[edit]
lab# run show route receive-protocol bgp 23.1.1.2
inet.0: 6 destinations, 7 routes (6 active, 0 holddown, 0 hidden)
This behavior is expected.
You can change prepending from its own number to any other.
Example:
On MX2:
set policy-options policy-statement prependas then as-path-prepend 100
On MX3:
set policy-options policy-statement prependas then as-path-prepend 10000
MX2# run show route advertising-protocol bgp 23.1.1.3
inet.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 1.1.1.0/24 Self 100 100 100 I
MX2# run show route receive-protocol bgp 23.1.1.3 extensive
inet.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden)
* 4.4.4.0/24 (1 entry, 1 announced)
Accepted
Nexthop: 23.1.1.3
Localpref: 100
AS path: 10000 300 I
MX3# run show route advertising-protocol bgp 23.1.1.2
inet.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 4.4.4.0/24 Self 100 10000 300 I
MX3# run show route receive-protocol bgp 23.1.1.2 extensive
inet.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden)
* 1.1.1.0/24 (1 entry, 1 announced)
Accepted
Nexthop: 23.1.1.2
Localpref: 100
AS path: 100 100 I
Now, the router can receive the IBGP route.