Hi Dramage,
I did some testing
on this device I configured the /16 on the lo0 interface
{master:0}[edit]
root@SW1# show interfaces lo0
unit 0 {
family inet {
address 1.1.1.1/32;
address 1.2.1.1/16;
}
then advertised the route with a policy with route filter (should work the same with the prefix list)
root@SW1# show policy-options
policy-statement test {
from {
route-filter 1.2.0.0/16 longer;
}
then accept;
}
root@SW1# show protocols bgp
group TEST {
export test;
neighbor 10.10.31.93 {
peer-as 11111;
}
}
note that I used "longer" as you did, lets see the BGP peer's routing table:
root@SW2# run show route 1.2/16
inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.2.1.1/32 *[BGP/170] 00:07:18, localpref 100
AS path: 22222 I, validation-state: unverified
> to 10.10.31.92 via et-0/0/53.10
now I am going to change the policy on the first one to "orlonger" meaning /16 and anything longer
{master:0}[edit policy-options]
root@SW1# show
policy-statement test {
from {
route-filter 1.2.0.0/16 orlonger;
}
then accept;
}
Now let us look at the peer table:
{master:0}[edit]
root@SW2# run show route 1.2/16
inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.2.0.0/16 *[BGP/170] 00:00:02, localpref 100
AS path: 22222 I, validation-state: unverified
> to 10.10.31.92 via et-0/0/53.10
1.2.1.1/32 *[BGP/170] 00:09:36, localpref 100
AS path: 22222 I, validation-state: unverified
> to 10.10.31.92 via et-0/0/53.10
you can try that, you can also see the routes like this:
SW1:
{master:0}[edit policy-options]
root@SW1# run show route advertising-protocol bgp 10.10.31.93 <----------neighbor
inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 1.2.0.0/16 Self I
* 1.2.1.1/32 Self I
SW2
root@SW2# run show route receive-protocol bgp 10.10.31.92
inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 1.2.0.0/16 10.10.31.92 22222 I
* 1.2.1.1/32 10.10.31.92 22222 I
inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
That should do it, Hope it helps!