Hi,
Although it does not seem very neat, I believe you could do this by adding static route for the /24 with a next-hop resolve, the next-hop being a route part of the /16. Example:
set routing-options static route 172.17.0.0/24 next-hop 172.17.255.254 resolve
Test Result:
root@PE1# run show route table TEST.inet.0 172.17.0.0/16
TEST.inet.0: 19 destinations, 23 routes (19 active, 0 holddown, 1 hidden)
+ = Active Route, - = Last Active, * = Both
172.17.0.0/16 *[BGP/170] 00:20:40, localpref 100
AS path: 65001 I, validation-state: unverified
> to 10.2.2.2 via ge-0/0/5.0
172.17.0.0/24 *[Static/5] 00:18:07, metric2 0
> to 10.2.2.2 via ge-0/0/5.0
[edit]
root@PE1# run show route table TEST1.inet.0 172.17.0.0
TEST1.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
172.17.0.0/24 *[Static/5] 00:00:24, metric2 0
> to 10.2.2.2 via ge-0/0/5.0
When /16 is not present:
root@PE1# run show route table TEST.inet.0 172.17.0.0/16
TEST.inet.0: 18 destinations, 22 routes (17 active, 0 holddown, 2 hidden)
[edit]
root@PE1# run show route table TEST1.inet.0 172.17.0.0/16
TEST1.inet.0: 5 destinations, 5 routes (4 active, 0 holddown, 1 hidden)
[edit]
root@PE1# run show route table TEST1.inet.0 172.17.0.0/16 hidden
TEST1.inet.0: 5 destinations, 5 routes (4 active, 0 holddown, 1 hidden)
+ = Active Route, - = Last Active, * = Both
172.17.0.0/24 [Static/5] 00:00:19
Unusable
[edit]
root@PE1# run show route table TEST.inet.0 172.17.0.0/16 hidden
TEST.inet.0: 18 destinations, 22 routes (17 active, 0 holddown, 2 hidden)
+ = Active Route, - = Last Active, * = Both
172.17.0.0/24 [Static/5] 00:23:49
Unusable
Cheers,
Ashvin