Routing
Routing

policy prefix

‎03-16-2018 03:37 AM

Hello,

 

I am receiving the following prefix on a bgp session , 40.20.100.0/23 and i want to configure a policy to import this route to my own rt  as a /28 . It is possible?   . Is in Junos OS

 

Thanks

 

6 REPLIES 6
Routing

Re: policy prefix

‎03-16-2018 03:45 AM
Can you elaborate this?

Do you want to change the subnet mask and import it?
Routing

Re: policy prefix

‎03-16-2018 03:47 AM

Yes, i want to change the subnet mask and import it

Routing

Re: policy prefix

‎03-16-2018 04:04 AM
I don’t think you can do this.

Can you explain why do you want to do this? Any specific reason ?

You can try to generate a route with the policy but not sure if that will meet your requirement.
Routing

Re: policy prefix

‎03-16-2018 04:23 AM

I need a /28 for manage in my network...

 

How can i generate a route with the policy ? coul you give me an example ?

 

Thanks a lot.

Routing

Re: policy prefix

[ Edited ]
‎03-16-2018 05:32 AM

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#

Routing
Solution
Accepted by topic author fserrano@es.ibm.com
‎03-19-2018 05:37 PM

Re: policy prefix

[ Edited ]
‎03-16-2018 12:21 PM

Hello,

If You don't have a default route and don't care that You would have both /28 and /23 in Your routing table then this is certainly possible, You need to use a static with NH==broadcast IP of larget subnet (in order that this static does not resolve via itself):

set routing-options static route 40.20.100.0/28 next-hop 40.20.101.255 resolve

When You don't have a 0/0 route and have 40.20.100.0/23 then 40.20.100/28' NH will resolve via 40.20.100/23 and You can redistribute it anywhere.

If You have a 0/0 route then this solution won't work without additional config (You have to deny resolution via 0/0).

HTH

Thx
Alex

 

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !