Routing

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.
Expand all | Collapse all

Adding a BGP Community to Routes

  • 1.  Adding a BGP Community to Routes

    Posted 09-23-2013 05:55

    Hi,

     

    I have term in my export bgp policy:

     

    term bgp_network {
        from {
            route-filter 192.168.0.0/22 exact;
        }
        then {
                 accept;
        }
    }
    term default {
        then reject;
    }

    and i try add community 112 to only one prefix. I put this term before term bgp_network

     

    term blackhole {
        from {
            route-filter 192.168.1.1/32 exact;
        }
        then {
            community add bh-isp-112;
            next term;
            accept;
        }
    }

    but i don't see this community:

     

    run show route advertising-protocol bgp 199.199.199.1

    inet.0: 467672 destinations, 1707207 routes (467660 active, 12 holddown, 2 hidden)
      Prefix                  Nexthop              MED     Lclpref    AS path
    * 192.168.0.0/22          Self                                    I

    how it should be implemented ? What i make wrong ?

     

    thanks for help

    Ted



  • 2.  RE: Adding a BGP Community to Routes



  • 3.  RE: Adding a BGP Community to Routes

    Posted 09-23-2013 07:25
    There is a typo: you used a /32 in the term named blackhole.
    Also make sure that the order of the terms is correct (as mentioned in youngnetworkguy's page).


  • 4.  RE: Adding a BGP Community to Routes

    Posted 09-23-2013 07:46

    It's not a mistake. I try to send prefix 192.168.0.0/22 without community tags and simultaneously prefix 192.168.1.1/32 with community 112.

     

     So now my export policy  looks like this and don't work:

     

    term blackhole {
        from {
            route-filter 192.168.1.1/32 exact;
        }
        then {
            community add bh-isp-112;
            next term;
            accept;
        }
    }

    term bgp_network {
        from {
            route-filter 192.168.0.0/22 exact;
        }
        then {
                 accept;
        }
    }
    term default {
        then reject;
    }



  • 5.  RE: Adding a BGP Community to Routes

    Posted 09-23-2013 08:32
    I see. Your 'show' output didn't show a /32 route, so I assumed that you had only the /22 route and it was a typo in the configuration. Are you summarizing the /32 before exporting it into BGP?

    Can you paste the complete relevant configurations (BGP, policy, interfaces)?


  • 6.  RE: Adding a BGP Community to Routes

    Posted 09-23-2013 17:10

    Hi,

     

    I would like to request the whole configuration please. 

     

    Thanks.



  • 7.  RE: Adding a BGP Community to Routes

    Posted 09-23-2013 17:18

    Let me also agrre with everyone else by posting this:

    http://forums.juniper.net/t5/Routing/Please-include-configurations-and-topologies-when-you-re-having/m-p/81312#U81312

    Did you create the community for example:

    set policy-options community bh-isp-112 members 112:123



  • 8.  RE: Adding a BGP Community to Routes

    Posted 09-24-2013 02:22

    whole config:


    MX240# show protocols bgp group
    type external;
    multihop;
    hold-time 60;
    import BGP_import;
    export BGP_export;
    peer-as 5555;
    neighbor 10.0.0.85;


    MX240# show policy-options community bh-isp-112
    members 5555:112;

    MX240# show policy-options policy-statement BGP_export

    term blackhole {
        from {
            route-filter 192.168.1.1/32 exact;
        }
        then {
            community add bh-isp-112;
            next term;
            accept;
        }
    }
        

    term bgp_network {
        from {
            route-filter 192.168.0.0/22 exact;
        }
        then {
                 accept;
        }
    }
    term default {
        then reject;
    }



    output, i see only prefixes /22, no /32:

    @MX240# run show route advertising-protocol bgp 10.0.0.85

    inet.0: 467225 destinations, 1703997 routes (467206 active, 19 holddown, 2 hidden)
      Prefix                  Nexthop              MED     Lclpref    AS path
    * 192.168.0.0/22          Self                 100                I


    @MX240# run show route 192.168.1.1

    inet.0: 467211 destinations, 1703999 routes (467211 active, 0 holddown, 2 hidden)
    + = Active Route, - = Last Active, * = Both

    192.168.1.1/32     *[Local/0] 1w5d 21:44:39
                          Local via ae0.7
                       





  • 9.  RE: Adding a BGP Community to Routes

    Posted 09-24-2013 12:50

    show the hidden routes detail?



  • 10.  RE: Adding a BGP Community to Routes

    Posted 09-24-2013 15:05

    Hi,

     

    To see the community on a BGP route you have to issue the command with the modifier "detail"

     

    Example:

     

    show route advertising-protocol bgp 10.116.119.24 detail

     

    GboIP.inet.0: 8 destinations, 9 routes (8 active, 0 holddown, 0 hidden)
    * 172.17.29.52/30 (1 entry, 1 announced)
    BGP group Internal type Internal
    Route Distinguisher: 65116:101
    VPN Label: 16
    Nexthop: Self
    Flags: Nexthop Change
    Localpref: 100
    AS path: [65116] I
    Communities: target:65116:201

     

    * 172.17.29.64/30 (2 entries, 1 announced)
    BGP group Internal type Internal
    Route Distinguisher: 65116:101
    VPN Label: 16
    Nexthop: Self
    Flags: Nexthop Change
    MED: 2
    Localpref: 100
    AS path: [65116] I
    Communities: target:65116:201



  • 11.  RE: Adding a BGP Community to Routes

    Posted 09-25-2013 01:56

    Hi,

     

    Can you remove "next-term" statement from your first term in policy and try. I feel it is hitting default term next and hence prefix is getting denied.

     

    Thanks,



  • 12.  RE: Adding a BGP Community to Routes

    Posted 09-25-2013 06:37

    I removed "next term" but still doesn't work. Hidden routes are to my second AS, "detail" options also don't help

     



  • 13.  RE: Adding a BGP Community to Routes
    Best Answer

    Posted 09-25-2013 07:06

    just saw that you are trying to export a local route in BGP. By default local routes are not advertised, pls try configuring below config as well:

     

    # show routing-options interface-routes
    family inet {
    export {
    point-to-point;
    lan;
    }
    }



  • 14.  RE: Adding a BGP Community to Routes

    Posted 09-26-2013 04:49

    it works ! Thanks a lot.