Routing

 View Only
last person joined: 16 hours 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.  BGP MED policy not working

    Posted 03-04-2010 07:26

     

     

    policy-statement bgp-export-med {
        term mc-ecr-1-10.170.11.2 {
            to neighbor 10.10.10.3;
            then {
                metric 1000;
            }
        }
        term mc-ecr-1-10.170.11.3 {
            to neighbor 10.10.10.4;
            then {
                metric 2000;
            }
        }
        term nat-pool-165.143.10.0 {
            from {
                route-filter 165.143.10.0/24 exact;
            }
            then accept;
        }
        then reject;
    }

     

     

     

    I have set this policy but both upstream BGP neighbors are getting 2000 as their MED.



  • 2.  RE: BGP MED policy not working

    Posted 03-04-2010 09:15

    Hi,

     

    your policy syntax is not correct. Please change it to:

     

    policy-statement bgp-export-med {
        term mc-ecr-1-10.170.11.2 {
            from {

                  protocol bgp;

                  neighbor 10.10.10.3;
            }

            then {
                metric 1000;
            }
        }
        term mc-ecr-1-10.170.11.3 {

            from {

                  protocol bgp;

                  neighbor 10.10.10.4;
            }

            then {
                metric 2000;
            }
        }
        term nat-pool-165.143.10.0 {
            from {
                route-filter 165.143.10.0/24 exact;
            }
            then accept;
        }
        then reject;
    }

     

    Kind Regards

    Michael Pergament

     

    If this worked for you please flag my post as an "Accepted Solution" so others can benefit. A kudo would be cool if you think I earned it.



  • 3.  RE: BGP MED policy not working

    Posted 03-04-2010 09:25

    Thanks for the response.

     

    Should it not be "to" neighbor?



  • 4.  RE: BGP MED policy not working

    Posted 03-04-2010 09:29

    Hi,

     

    no. "to" is used in conjuction with IS-IS levels.

     

    Kind Regards

    Michael Pergament



  • 5.  RE: BGP MED policy not working

    Posted 03-04-2010 09:47

    Hmmm... Not working.

     

    I just see the default metric on the ebgp peer (I have cisco "bgp bestpath med missing-as-worst"). As a matter of interest I tried it with "to" - no joy.

     

         165.143.0.0/24 is subnetted, 1 subnets
    B       165.143.10.0 [20/4294967294] via 10.170.11.254, 00:14:24

     

     

    policy-statement bgp-export-policy {
        term mc-ecr-1-10.170.11.2 {
            from {
                protocol bgp;
                neighbor 10.170.11.2;
            }
            then {
                metric 1000;
            }
        }
        term mc-ecr-1-10.170.11.3 {
            from {
                protocol bgp;
                neighbor 10.170.11.3;
            }
            then {
                metric 2000;
            }
        }
        term nat-pool-165.143.10.0 {
            from {
                route-filter 165.143.10.0/24 exact;
            }
            then accept;
        }
        then reject;
    }
    policy-statement bgp-import-policy {
        term mc-ecr-1-10.170.11.2 {
            from neighbor 10.170.11.2;
            then {
                local-preference 2000;
            }
        }
        term mc-ecr-2-10.170.11.3 {
            from neighbor 10.170.11.3;
            then {
                local-preference 1000;
            }
        }
        then accept;
    }

     

     



  • 6.  RE: BGP MED policy not working
    Best Answer

    Posted 03-04-2010 09:56

    Hi,

    Just make two policies and apply export policies under neighbor hierarchy:

     

    policy-statement bgp-export-policy-to-neigb1 {
        term nat-pool-165.143.10.0 {
            from {
                route-filter 165.143.10.0/24 exact;
            }
            then {
                metric 1000;

                accept;

            }
        }
        then reject;
    }

     

    policy-statement bgp-export-policy-to-neigb2 {

        term nat-pool-165.143.10.0 {
            from {
                route-filter 165.143.10.0/24 exact;
            }
            then {
                metric 2000;

                accept;

            }
        }

        then reject;
    }

     

    Kind Regards

    Michael Pergament



  • 7.  RE: BGP MED policy not working

    Posted 03-04-2010 11:09

    Thanks Mike that worked.

     

    The only issue I have with this is that the export filters have to be applied to each BGP peer under their policy.

     

    It doesn't scale very well if you have hundreds of export policies with tens of BGP peers, which we will.

     

    The way you first mentioned makes more sense and would allow you to apply a single route filter to all peers. Obvioulsy junos doesn't agree with this logic.