View Only


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.

Conditional route advertisement - BGP: ribgroup conditional.inet.0 not a valid primary rib for this nlri

This thread has been viewed 5 times
  • 1.  Conditional route advertisement - BGP: ribgroup conditional.inet.0 not a valid primary rib for this nlri

    Posted 06-02-2022 09:54

    first to say: I am using JunOS 20.4R3.8.

    I want to setup conditional BGP route advertisement in case of lost of connectivity to my main upstream. AS-Path prepending is no option in this case.

    Basically, I receive and import the default route via BGP from my main upstream. I want to setup a conditional behavior: When I lose connectivity to my main upstream and the routes learned from this BGP neighbor (the default route) are removed from my RIB, I want to announce the prefixes that are normally announced to my main upstream to my backup upstream.
    That's my condition:
    # show policy-options condition mainupstream_alive
    if-route-exists {;
    table conditional.inet.0;

    That's my export policy statement for my backup carrier:
    # show policy-options policy-statement exp-mainupstream-fallback 
    term reject-when-alive {
        from {
            prefix-list to-mainupstream;
            condition mainupstream_alive;
        then reject;
    term get-routes {
        from {
            prefix-list to-mainupstream;
        then accept;
    term others {
        then reject;

    Basically I think that should work. Now I want to import the default route learned from my main upstream into another routing table (into conditional.inet.0) in order to check for existance of this route in this table and importing it into the primary inet.0 routing table.
    To accomplish this, I have setup the following RIB-Group:

    # show routing-options rib-groups fallback_mainupstream 
    import-rib [ conditional.inet.0 inet.0 ];
    import-policy default-route-only-accept;

    Under the BGP Group configuration level of the main upstream, I have configured this:

    # show protocols bgp group mainupstream 
    type external;
    import default-route-only-accept;
    family inet {
        unicast {
            rib-group fallback_mainupstream;
    export exp-mainupstream;
    peer-as XXXXX;
    neighbor XXXXXXX;
    neighbor XXXXXXX;

    But when committing this configuration, I receive the following error message:

        BGP: ribgroup fallback_mainupstream: conditional.inet.0 not a valid primary rib for this nlri.
    error: configuration check-out failed

    Do you have any tips why this error message occurs? I have already tried to setup a routing-instance named "conditional".

    Thank you very much in advance!

    Best Regards