Routing

 View Only

IMPORTANT MODERATION NOTICE

This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.



  • 1.  Remove default route from BGP

    Posted 03-21-2022 10:13
    hi everyone, 

    I have a BGP tunnel to Azure, but I'm trying to remove the published 0.0.0.0/0 route from the BGP advertisements..  I created a policy-option to remove it, but it's still being published:

    policy-statement preprend1 {
    term prependterm1 {
    from neighbor [ 172.16.5.120 172.16.5.121 ];
    then {
    preference subtract 10;
    accept;
    }
    }
    term removeDefault {
    from {
    route-filter 0.0.0.0/0 through 0.0.0.0/32;
    }
    to neighbor [ 172.16.9.228 172.16.9.229 ];
    then reject;
    }
    term send-direct {
    from protocol direct;
    then accept;
    }
    }

    and on the BGP peer: 
    group azure {
    type external;
    multihop {
    ttl 50;
    }
    local-address 172.16.5.1;
    export preprend1;
    peer-as 65515;
    local-as 65050;
    neighbor 172.16.83.254;
    neighbor 172.16.160.242;
    neighbor 172.16.9.228;
    neighbor 172.16.9.229;
    }

    (sorry not sure how to do the correct formatting)

    Any ideas why 0.0.0.0/0 is not removed?

    ------------------------------
    Roelf Zomerman
    ------------------------------


  • 2.  RE: Remove default route from BGP

     
    Posted 03-21-2022 20:17
    Policy terms are processed in order and the first matching term is the one used.

    So the term removeDefault needs to be the first one in your policy.

    Also the match condition you want  to remove only the default route is as follows
    0.0.0.0/0 exact

    Junos also processes imports and exports as separate policies.  So it looks like you want to remove the third term and make that an export policy for you bgp group.

    Finally, both policies should end with a final term of just reject.  Because the default bgp behavior is to accept anything that makes it to the end of the policy chain.  And I think you only want to accept or send the terms you are declaring.

    ------------------------------
    Steve Puluka BSEET - Juniper Ambassador
    IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
    http://puluka.com/home
    ------------------------------



  • 3.  RE: Remove default route from BGP

    Posted 03-22-2022 09:49
    ah thanks!.. I will try

    ------------------------------
    Roelf Zomerman
    ------------------------------