Junos OS

last person joined: 5 days ago 

Ask questions and share experiences about Junos OS.
  • 1.  Route Filter Match in a Policy

    Posted 06-25-2010 11:52

    Hello Guys 

     

    I have been trying to find the answer for this particular question

     

    The question is as follows

     

    Given the following policy, what happens when the 1.1/17 route is evaluated?
     
    [edit policy-options]
    policy-statement test {
        from {
            route-filter 0/0 orlonger accept;
            route-filter 1.1/17 upto /24 reject;
            route-filter 1.1/18 exact;
            }
        then {
            metric 6;
            accept;
            }
    }
    My question is wether this route will be
    1) rejected
     
      OR
    2) Will it be considered a no match
    I think the route will be rejected.
    Thanks & regards
    Malik


  • 2.  RE: Route Filter Match in a Policy

    Posted 06-26-2010 07:14

    Hello,

    In JUNOS routing policies the "from route-filter" statement uses longest match.

    So in Your example, 1.1/17 will match "1.1/17 upto /24 reject" clause, the 1.1/17 route will be rejected and "from" match condition will return FALSE. No metric or accept action will be applied.

    HTH

    Regards

    Alex

     

     



  • 3.  RE: Route Filter Match in a Policy

    Posted 06-26-2010 11:08

    Dear Alex

     

    According to the official "UPTO"statement

     

    upto The upto match type provides the router with a starting prefix and an ending prefix

    length. The match type locates the route specified in the route filter and starts to match all routes

    more specific than the specified route.

     

    Actually the portion highlited in red is a bit confusing to me.

     

    So if the route filter matches 1.1/17 prefix and tries to find something more specific it wont find anything and hence there will be no match.

     

    What do you think regarding this statement highlighted in red.

     

    Regards

    Malik



  • 4.  RE: Route Filter Match in a Policy

    Posted 06-26-2010 14:48

    Hello,

    JUNOS routing policy processes one route at a time. If You have only 1.1/17 route then it will be rejected by Your policy.

    This policy will NOT actively look for any other routes in any routing tables, You need the "condition" match statement for this to happen.

    HTH

    Regards

    Alex



  • 5.  RE: Route Filter Match in a Policy

    Posted 06-27-2010 05:41

    Thank You Alex

     

    Can you please provide one such example.

     

    Regards

     

    Malik



  • 6.  RE: Route Filter Match in a Policy

    Posted 06-27-2010 09:09

    Sure

     

     

    policy-options {
        policy-statement check1 {
            term 1 {
                from {
                    protocol aggregate;
                    route-filter 1.129.0.0/16 exact;
                    condition route1;
                }
                then accept;
            }
            term 2 {
                from protocol bgp;
                then reject;
            }
        }
        condition route1 if-route-exists 1.129.0.1/32 table inet.0;
    }

     

     

    This policy (which can be used _only_ as BGP export policy) accepts 1.129/16 aggregate route _only_if_ 1.129.0.1/32 route exists in inet.0 table.

    HTH

    Regards

    Alex

     



  • 7.  RE: Route Filter Match in a Policy
    Best Answer

    Posted 06-28-2010 22:39

    Thank you very much Alex



  • 8.  RE: Route Filter Match in a Policy

    Posted 06-29-2010 14:54

    You say "thanks" to Alex but you give yourself the "accepted solution"?

     

    And you don't even give him a kudo for helping you through a sticky configuration issue?

     

    By the way "accepted solutions" that you give yourself are not counted towards your community standing anyway, so give them where they are earned.

     

    Kudos to Alex for the real solution.