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.



Expand all | Collapse all

How to properly balance traffic using communities/prepends?

This thread has been viewed 5 times
  • 1.  How to properly balance traffic using communities/prepends?

    Posted 05-31-2022 10:43
    Hi everyone!
    I need help solving a problem ...

    The configuration below works correctly, but there are problems.

    I have 3 upstreams ISP - UPSTREAM-1, UPSTREAM-2, UPSTREAM-3

    My network:
    # show routing-options

    static {
    route yyy.yyy.0.0/16 {
    discard;
    community [ XXXXX:100 XXXXX:111 XXXXX:120 ];
    }

    community UPSTREAM-1-EXP members XXXXX:100
    community UPSTREAM-1-EXP-1 members XXXXX:101
    community UPSTREAM-1-EXP-2 members XXXXX:102
    community UPSTREAM-1-EXP-3 members XXXXX:103
    community UPSTREAM-1-EXP-4 members XXXXX:104
    community UPSTREAM-1-EXP-8 members XXXXX:108
    community UPSTREAM-1-EXP-DENY members XXXXX:109

    community UPSTREAM-2-EXP members XXXXX:110
    community UPSTREAM-2-EXP-1 members XXXXX:111
    community UPSTREAM-2-EXP-2 members XXXXX:112
    community UPSTREAM-2-EXP-3 members XXXXX:113
    community UPSTREAM-2-EXP-4 members XXXXX:114
    community UPSTREAM-2-EXP-8 members XXXXX:118
    community UPSTREAM-2-EXP-DENY members XXXXX:119

    community UPSTREAM-3-EXP members XXXXX:120
    community UPSTREAM-3-EXP-1 members XXXXX:121
    community UPSTREAM-3-EXP-2 members XXXXX:122
    community UPSTREAM-3-EXP-3 members XXXXX:123
    community UPSTREAM-3-EXP-4 members XXXXX:124
    community UPSTREAM-3-EXP-8 members XXXXX:128
    community UPSTREAM-3-EXP-DENY members XXXXX:129


    Out BGP policy:
    # show policy-options policy-statement UPSTREAM-1-OUT-v4

    ...
    term 20 {
    from community [ UPSTREAM-1-EXP-DENY ];
    then reject;
    }

    term 30 {
    from community [ UPSTREAM-1-EXP ];
    then accept;
    }
    term 40 {
    from community [ UPSTREAM-1-EXP-1 ];
    then {
    as-path-prepend XXXXX;
    accept;
    }
    }
    term 50 {
    from community [ UPSTREAM-1-EXP-2 ];
    then {
    as-path-prepend "XXXXX XXXXX";
    accept;
    }
    }
    term 60 {
    from community [ UPSTREAM-1-EXP-3 ];
    then {
    as-path-prepend "XXXXX XXXXX XXXXX";
    accept;
    }
    }
    term 70 {
    from community [ UPSTREAM-1-EXP-4 ];
    then {
    as-path-prepend "XXXXX XXXXX XXXXX XXXXX";
    accept;
    }
    }
    term 80 {
    from community [ UPSTREAM-1-EXP-8 ];
    then {
    as-path-prepend "XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX";
    accept;
    }
    }
    term 100 {
    then reject;
    }


    To change the number of prepends, I change the community to routing-options static.
    This scheme works well, but there was a problem that I still can't solve.
    How can I give my client the ability to balance traffic with the help of the community?

    When he announces a community to me, for example, XXXXX:103, then this community is added to mine:
    run show route zz.zz.zz.0/22 detail
    ......
    Communities: XXXXX:100 XXXXX:111 XXXXX:120 XXXXX:103

    But, I need:
    run show route zz.zz.zz.0/22 detail
    ......
    Communities: XXXXX:103 XXXXX:111 XXXXX:120

    How can I change my configuration to allow the client to properly use the community for traffic balancing?
    The problem is that the network advertised by the client may be part of my networks yyy.yyy.0.0/16.

    P.S. Sorry for my English. it isn't my native language.


  • 2.  RE: How to properly balance traffic using communities/prepends?

    Posted 06-03-2022 06:24
    Problem solved.
    As it turned out it is very simple
    I have added new terms with new client communities.
    I inserted new terms before the old ones so that they worked out earlier.

    New communities:
    community CUSTOMER-UPSTREAM-1-EXP members XXXXX:1100
    community CUSTOMER-UPSTREAM-1-EXP-1 members XXXXX:1101
    community CUSTOMER-UPSTREAM-1-EXP-2 members XXXXX:1102
    community CUSTOMER-UPSTREAM-1-EXP-3 members XXXXX:1103
    community CUSTOMER-UPSTREAM-1-EXP-4 members XXXXX:1104
    community CUSTOMER-UPSTREAM-1-EXP-DENY members XXXXX:1109

    community CUSTOMER-UPSTREAM-2-EXP members XXXXX:1110
    community CUSTOMER-UPSTREAM-2-EXP-1 members XXXXX:1111
    community CUSTOMER-UPSTREAM-2-EXP-2 members XXXXX:1112
    community CUSTOMER-UPSTREAM-2-EXP-3 members XXXXX:1113
    community CUSTOMER-UPSTREAM-2-EXP-4 members XXXXX:1114
    community CUSTOMER-UPSTREAM-2-EXP-DENY members XXXXX:1119

    community CUSTOMER-UPSTREAM-3-EXP members XXXXX:1120
    community CUSTOMER-UPSTREAM-3-EXP-1 members XXXXX:1121
    community CUSTOMER-UPSTREAM-3-EXP-2 members XXXXX:1122
    community CUSTOMER-UPSTREAM-3-EXP-3 members XXXXX:1123
    community CUSTOMER-UPSTREAM-3-EXP-4 members XXXXX:1124
    community CUSTOMER-UPSTREAM-3-EXP-DENY members XXXXX:1129

    Out BGP policy:
    # show policy-options policy-statement UPSTREAM-1-OUT-v4

    ...
    term 20 {
    from community [ UPSTREAM-1-EXP-DENY CUSTOMER-UPSTREAM-1-EXP-DENY ];
    then reject;
    }

    term 50 {
    from community CUSTOMER-UPSTREAM-1-EXP;
    then accept;
    }
    term 60 {
    from community CUSTOMER-UPSTREAM-1-EXP-1;
    then {
    as-path-prepend XXXXX;
    accept;
    }
    }
    term 70 {
    from community CUSTOMER-UPSTREAM-1-EXP-2;
    then {
    as-path-prepend "XXXXX XXXXX";
    accept;
    }
    }
    term 80 {
    from community CUSTOMER-UPSTREAM-1-EXP-2;
    then {
    as-path-prepend "XXXXX XXXXX XXXXX";
    accept;
    }
    }
    term 90 {
    from community CUSTOMER-UPSTREAM-1-EXP-4;
    then {
    as-path-prepend "XXXXX XXXXX XXXXX XXXXX";
    accept;
    }
    }



    term 100 {
    from community [ UPSTREAM-1-EXP ];
    then accept;
    }
    term 110 {
    from community [ UPSTREAM-1-EXP-1 ];
    then {
    as-path-prepend XXXXX;
    accept;
    }
    ...
    }
    }
    term 1000 {
    then reject;
    }