Routing

 View Only
last person joined: 3 days ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  Router-Filter or Policy-Statement Match Solely on Prefix-Length

    Posted 03-20-2013 14:54

    This is one scenario that I have been struggling with and it appears to come up often.

     

    Essentially, I want to take all the routes that have a certain prefix length, eg. /32 and then reject or accept them. There seems to be no way using a route-filter to do this.

     

    Just to illustrate, suppose I have following three routes :-

     

    1.1.1.1/32

    2.2.2.2/32

    3.3.3.3/32

     

    I want to take the same action, reject or accept on all three of them but using a single "from" statement. Is this doable within the framework of Junos?

     

    Thanks in advance,

     

    Nic


    #route-filter
    #policy-statement


  • 2.  RE: Router-Filter or Policy-Statement Match Solely on Prefix-Length

    Posted 03-20-2013 16:06

    create a prefix list and add each of the /32 that you want reject; then in your policy statement, say from prefix-list <name> then reject

    That is assuming that is what you want to do. In the then action you can use reject or accept


    [edit policy-options]

    prefix-list block-them-32 {
    1.1.1.1/32;
    2.2.2.2/32;
    10.10.10.10/32;
    12.12.12.12/32;
    }
    policy-statement accept-them-thirty-two {
    from {
    prefix-list block-them-32;
    }
    then accept;
    }
    policy-statement block-them-thirty-two {
    from {
    prefix-list block-them-32;
    }
    then reject;
    }

     And you can always modify the prefix list as you wish. You can also use it in firewall filters if you want to also.



  • 3.  RE: Router-Filter or Policy-Statement Match Solely on Prefix-Length

    Posted 03-20-2013 16:51

    That looks good for the given scenario.

     

    Sorry about this but I have to change the scenario a bit to make my predicament clearer.

     

    Suppose you wanted to take care of all future /32 routes that will be added as well. Can it be done with a, say future-proof, policy? Suppose I do not want to alter the prefix-list every single time a /32 is added to the network.

     

    Thanks,

     

    Nic

     

     



  • 4.  RE: Router-Filter or Policy-Statement Match Solely on Prefix-Length
    Best Answer

    Posted 03-20-2013 19:23

    Try this:

     

    from route-filter 0.0.0.0/0 prefix-length-range /32-/32;

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

    /paraphrasing master alex



  • 5.  RE: Router-Filter or Policy-Statement Match Solely on Prefix-Length

    Posted 03-20-2013 19:35

    That is it. It works. Thank you so much.

     

    Kudos,

     

    Nic