You can refer to below example for generating the route. However if you receive /24 prefix and generate route with /28 prefix, the route will be hidden as there will be no contributing route learned from the bgp for /28.
Can you explain how will you manage you network with /28 and when you re receiving the /24 from the upstream peer?
[edit]
root@CE4_re# show policy-options
policy-statement test {
term 1 {
from {
protocol bgp;
route-filter 150.0.0.10/32 exact;
}
then accept;
}
term 2 {
then reject;
}
}
[edit]
root@CE4_re# show routing-options
generate {
route 150.0.0.0/28 {
policy test;
full;
}
}
autonomous-system 1000;
[edit]
root@CE4_re# run show route 150.0.0.10/32
inet.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
150.0.0.10/32 *[BGP/170] 00:01:57, localpref 100
AS path: 100 I, validation-state: unverified
> to 192.168.44.44 via ge-0/0/4.0
[edit]
root@CE4_re# run show route 150.0.0.0/28
inet.0: 18 destinations, 18 routes (18 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
150.0.0.0/28 *[Aggregate/130] 00:00:48
> to 192.168.44.44 via ge-0/0/4.0
150.0.0.10/32 *[BGP/170] 00:02:04, localpref 100
AS path: 100 I, validation-state: unverified
> to 192.168.44.44 via ge-0/0/4.0
[edit]
root@CE4_re#