SRX

Expand all | Collapse all

BGP with 2 upstreams and default route only

Jump to Best Answer
  • 1.  BGP with 2 upstreams and default route only

    Posted 01-17-2020 03:22

    Hello,

     

    I configured 2 bgp sessions to receive only 0.0.0.0 from upstreams, so the traffic goes only via 1 upstream (probably the older session). It looks like this:

     

    admin@SRX1# run show route 0.0.0.0    
    
    inet.0: 165304 destinations, 165307 routes (19 active, 0 holddown, 165285 hidden)
    Restart Complete
    + = Active Route, - = Last Active, * = Both
    
    0.0.0.0/0          *[BGP/170] 01:40:02, localpref 100
                          AS path: 1234 I, validation-state: unverified
                        > to 1.1.1.1 via ge-5/0/15.0
                        [BGP/170] 00:00:30, localpref 100
                          AS path: 6789 ?, validation-state: unverified
                        > to 2.2.2.2 via ge-0/0/12.0
    

     

    My current bgp configuration:

     

    admin@SRX1# show protocols bgp 
    group bgp-isp {
        type external;
        import import-default-route;
        export send-my-prefix;
        neighbor 1.1.1.1 {
            description isp1-bgp;
            peer-as 1234;
        }
        neighbor 2.2.2.2 {
            description isp2-bgp;
            peer-as 6789;
        }
    }
    

     

    I tried to add local-pref in neighbor configuration, but without success. I also tried to apply local-pref to import policy, but without success. Always in "show route" I see that local pref didn't change.

     

    What would be the proper way to to this?

     



  • 2.  RE: BGP with 2 upstreams and default route only
    Best Answer

     
    Posted 01-17-2020 04:45

    Hello Gabriel,

     

    you can configure the Local Preference the following way, if you want to prefer neighbor 1.1.1.1 for egress traffic:

     

    -------------

    policy-options {
    policy-statement import-default-route { term 1 {
    from {
    route-filter 0.0.0.0/0 exact;
    } then { local-preference 110; accept; } } }
    }
    group bgp-isp {
        type external;
        export send-my-prefix;
        neighbor 1.1.1.1 {
            description isp1-bgp;
    import import-default-route; peer-as 1234; } neighbor 2.2.2.2 { description isp2-bgp; peer-as 6789; } }

     

    HTH

     



  • 3.  RE: BGP with 2 upstreams and default route only

     
    Posted 01-17-2020 06:32

    Hi,

     

    Not sure what is your question? Do you want traffic to load balance between 2 ISP links?

    If so, you need to do a few things:

    1. In routing-table, it looks correct as you have two candicate routes

    2. In forwarding-table, if you need to have 2 next-hops, you need to have load-balance per-packet policy under "routing-options forwarding-table"

    3. In your case, you might also need bgp multipath multiple-as



  • 4.  RE: BGP with 2 upstreams and default route only

     
    Posted 01-17-2020 13:58

    Hi Gabriel,


    Greetings, you have two options to easily accomplish this task. You can create an import policy to modify the rip-in table before it reaches/installed in the rip local and set the local preference to something higher than 100 or you can create an export policy set the local preference to something higher than 100
    before exporting routes to your IBGP peers.

     

    Can you please share how and where did you configure the local preference statement or the policy? 

    Regards,
    Lil Dexx JNCIE-ENT#863

     

     

    If this solves your problem, please mark this post as "Accepted Solution" so we can help others too.
    If you consider that my input was helpful, giving me a kudos would make my daySmiley Happy