I am generating a default route to one of my IP transit providers (AS12345), on the condition that the eBGP session to them is up. I check this by verifying that I see a route with an AS path equal to 12345:
> show configuration routing-options rib inet6.0 generate route ::/0 policy conditional-default; brief;> show configuration policy-options policy-statement conditional-default term accept_origin_as12345 { from as-path as12345; then accept; } then reject;> show configuration policy-options as-path as12345 12345;
This works fine - the generated route pops into existence if there are any matching contributing routes active in the RIB:
> show route table inet6.0 ::/0 protocol aggregate exact detail inet6.0: 49947 destinations, 194827 routes (49945 active, 0 holddown, 177 hidden) ::/0 (4 entries, 1 announced) State: <FlashAll> *Aggregate Preference: 130 Next hop type: Indirect, Next hop index: 0 Address: 0x451e8810 Next-hop reference count: 51655 Next hop type: Router, Next hop index: 1061 Next hop: 2001:db8:1:315::1 via xe-2/3/0.0, selected Session Id: 0x147 Protocol next hop: 2001:db8::179:1 Indirect next hop: 0xe102380 1048580 INH Session ID: 0x14a State: <Active Int Ext> Local AS: 54321 Age: 8:35 Metric2: 0 Validation State: unverified Task: Aggregate Announcement bits (6): 0-KRT 3-LDP 6-RT 7-BGP_RT_Background 8-Resolve tree 4 10-Resolve tree 5 AS path: I AS path: Recorded Flags: Brief ASPathChanged Generate Resolve Depth: 1 Active Contributing Routes (2): 2001:db8::80/128 proto BGP 2001:db8:0:400::b4:0/127proto BGP
What I do not understand, however, is why the AS path of the generated route remains empty. As I read the documentation, the brief statement ought to have ensured that the AS path of the generated route would have been «the longest common leading sequences from the contributing AS paths» - but that does not seem to be the case.
The policy ensures that the longest common leading AS path sequence is 12345, which I can also verify manually by checking the two contributing routes mentioned:
> show route table inet6.0 2001:db8::80/128 active-path exact inet6.0: 49937 destinations, 194801 routes (49935 active, 0 holddown, 177 hidden) + = Active Route, - = Last Active, * = Both 2001:db8::80/128 *[BGP/170] 2w1d 06:37:36, localpref 50, from 2001:db8::179:1 AS path: 12345 I, validation-state: unknown > to 2001:db8:1:315::1 via xe-2/3/0.0> show route table inet6.0 2001:db8:0:400::b4:0/127 active-path exact inet6.0: 49939 destinations, 194803 routes (49937 active, 0 holddown, 177 hidden) + = Active Route, - = Last Active, * = Both 2001:db8:0:400::b4:0/127 *[BGP/170] 2w1d 06:37:52, localpref 50, from 2001:db8::179:1 AS path: 12345 I, validation-state: unknown > to 2001:db8:1:315::1 via xe-2/3/0.0
I am aware that I can work around it by hard-coding the AS path of the generated route, but I would like to understand why it does not work as expected to begin with. Any ideas? For what it's worth, I am running JUNOS 16.1R6-S2.3 on an MX 240.