Routing

Expand all | Collapse all

BGP Advertise Default from ISP to BGP Peer

Jump to Best Answer
  • 1.  BGP Advertise Default from ISP to BGP Peer

    Posted 01-27-2020 14:54

    Hello All,

    I am trying to advertise the default route to my BGP peers. Router A (ISP) to Router B (University - Non-Juniper) and Router C (WISP - Non-Juniper)

     

    I have been looking at different config from various people on these forums and after a month I cannot seem to get the default-route to advertise to the peers.

     

    The config is faily simple.

    I have removed all the default route information from the config and just listed my current running BGP and policy options.

    Any help will be greatly appreciated.

     

    Logical Router:

    show configuration logical-systems internet protocols bgp

    advertise-inactive;
    log-updown;
    group internal {
    type internal;
    export next-hop-self;
    neighbor X.X.47.254;
    }
    group internet-peers {
    type external;
    family inet {
    unicast;
    multicast;
    }
    export adv-supernets;
    peer-as XXX34;
    multipath;
    neighbor X.X.46.253 {
    description "ISP 1 - 1G";
    export AS-prepend-ISP-1;
    peer-as XXX81;
    }
    neighbor X.X.86.173 {
    description "ISP 2 - 5G";
    peer-as XXX56;
    }
    neighbor X.X.152.197 {
    description "ISP 3 - 2G";
    peer-as XXX82;
    }
    show configuration logical-systems internet policy-options

    prefix-list all-supernets {
    X.X.224.0/24;
    X.X.225.0/24;
    X.X.28.0/22;
    X.X.32.0/20;

    prefix-list external-supernets {
    X.X.64.0/24;
    X.X.226.0/24;
    X.X.227.0/24;
    X.X.110.0/24;
    X.X.251.0/24;

    policy-statement AS-prepend-ISP-1 {
    from policy adv-supernets;
    then {
    as-path-prepend "XXX34 XXX34";
    accept;
    }
    }

    policy-statement adv-supernets {
    term 10 {
    from {
    protocol static;
    prefix-list-filter all-supernets exact;
    }
    then accept;
    }
    term 15 {
    from {
    protocol bgp;
    prefix-list-filter external-supernets exact;
    }
    then accept;
    }
    term 20 {
    then reject;
    }
    then {
    next-hop self;
    }
    }
    policy-statement redist-default {
    from {
    protocol static;
    route-filter 0.0.0.0/0 exact;
    }
    then accept;
    }

     

     

    Router

    local-address X.X.47.254;
    group internal {
    type internal;
    export next-hop-self;
    neighbor X.X.47.253;
    }
    group external {
    type external;
    neighbor X.X.45.145 {
    description "Peer C";
    local-address X.X.45.150;
    export adv-supernets;
    peer-as XXX98;
    }
    neighbor X.X.47.172 {
    description "Peer A";
    local-address X.X.47.174;
    export adv-supernets;
    peer-as XXX36;
    }
    neighbor X.X.44.201 {
    description "Peer B";
    local-address X.X.44.202;
    export adv-supernets;
    peer-as XXX35;
    }
    neighbor X.X.47.237 {
    description "Peer D";
    local-address X.X.47.238;
    export adv-supernets;
    peer-as XXXX08;
    }
    show configuration policy-options

    prefix-list all-supernets {
    X.X.224.0/24;
    X.X.225.0/24;
    X.X.28.0/22;
    X.X.32.0/20;

    policy-statement adv-supernets {
    term 10 {
    from {
    protocol static;
    prefix-list-filter all-supernets exact;
    }
    then accept;
    }
    term 20 {
    then reject;
    }
    }
    policy-statement next-hop-self {
    then {
    next-hop self;
    }
    }
    policy-statement redist-default {
    from {
    route-filter 0.0.0.0/0 exact;
    }
    then accept;
    }
    policy-statement redist-pppoe {
    from protocol [ access-internal access ];
    then accept;
    }
    policy-statement redist-static {
    from protocol static;
    then accept;
    }

     



  • 2.  RE: BGP Advertise Default from ISP to BGP Peer

     
    Posted 01-27-2020 16:14

    Hi WNMC Jack Gonzales,

     

    I saw that you created the following policy "policy-statement redist-default" but I don't see where it is applied, please let me know if I missed it. 

     


    Regards,
    Lil Dexx JNCIE-ENT#863

     

    If this solves your problem, please mark this post as "Accepted Solution" so we can help others too



  • 3.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 01-29-2020 11:13

    Lil Dex,

     

    Currently I do not have the policy-statement redist-default being exported in BGP to my peers as it was not coming up or being advertised.



  • 4.  RE: BGP Advertise Default from ISP to BGP Peer

     
    Posted 01-29-2020 12:33

    Hi !!

     

    Please go ahead and review the config in this example and let me know if this matches your scenario. 

    If not please share a simple topology of how yours routers are connected. 

     

    https://www.juniper.net/documentation/en_US/junos/topics/example/policy-default-static-route.html 

     

    Hope this helps !!

     

     Please accept this as a solution if it answers your question so others can benefit from your post.

     

    +++++++++++++++++++++++++++++++++++++++++++++

     

    Accept as Solution = cool !

    Accept as Solution+Kudo = You are a Star !

     

    +++++++++++++++++++++++++++++++++++++++++++++



  • 5.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 01-29-2020 13:24
      |   view attached

    Hi,

    I have attached a basic drawing of my BGP setup.

    I have also looked at that sample config, and when ever I add "set routing-options static route 0.0.0.0/0 discard" to the main router config it stops all my traffic.

     

    We use a single MX480 with a logical instance to BGP to our ISP's for access and a main config to provide access to our customers.

    Between that logical instance and the main router config I have BGP and OSPF.

     

    The logical instance router does advertise the default route as I can see it in the received routes from the BGP.

    I just can't seem to get it advertised to my BGP peers.

    Attachment(s)

    pdf
    BGP.pdf   121K 1 version


  • 6.  RE: BGP Advertise Default from ISP to BGP Peer

     
    Posted 01-29-2020 17:16

    Are you receiving a default route from your ISP peers and looking to pass that on to your downstream network?

     

    Or are you getting full tables only from the ISP and looking to generate a default route and send this to your downstream peers?

     



  • 7.  RE: BGP Advertise Default from ISP to BGP Peer

     
    Posted 01-29-2020 19:26

    Hi WNMC Jack Gonzales,

    Please share the "show route 0.0.0.0/0 exact" output.

     

    Based on, from which protocol you are learning the default route we will need to construct the policy which needs to be applied as BGP export policy.

     

    set policy-options policy-statement export term 1 from protocol <protocol-name>
    set policy-options policy-statement export term 1 from route-filter 0.0.0.0/0 exact
    set policy-options policy-statement export term 1 then accept

    If you are not learning the default route you will need to configure a default static route and advertise that (use static as protocol-name).

    PS: Please accept my response as solution if it answers your query, kudos are appreciated too!

    Thanks

    Vishal


     


  • 8.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 01-30-2020 11:21

    Hi

     

    show route logical systems internet 0.0.0.0/0 exact

    + = Active Route, - = Last Active, * = Both

    0.0.0.0/0 *[Static/5] 2w0d 09:43:48
    to X.X.46.253 via ge-0/1/0.0
    to X.X.86.173 via xe-1/1/0.0
    > to X.X.152.197 via xe-1/1/1.0
    [BGP/170] 2w0d 09:43:33, localpref 100
    AS path: XX881 I, validation-state: unverified
    > to X.X.46.253 via ge-0/1/0.0
    [BGP/170] 2w0d 09:43:31, localpref 100
    AS path: XX782 174 I, validation-state: unverified
    > to X.X.152.197 via xe-1/1/1.0

     

    show route 0.0.0.0/0 exact

    + = Active Route, - = Last Active, * = Both

    0.0.0.0/0 *[OSPF/150] 2w0d 09:39:02, metric 0, tag 0
    > to X.X.47.251 via xe-1/0/0.0
    [BGP/170] 2w0d 09:38:59, localpref 100, from X.X.47.253
    AS path: XX881 I, validation-state: unverified
    > to X.X.47.251 via xe-1/0/0.0

     

    I do not belive I am generating the default route to send to my peers.



  • 9.  RE: BGP Advertise Default from ISP to BGP Peer

     
    Posted 01-30-2020 11:29

    Hello,

     

    You have the default route in the logical system:

    show route logical systems internet 0.0.0.0/0 exact

    + = Active Route, - = Last Active, * = Both

    0.0.0.0/0 *[Static/5] 2w0d 09:43:48
    to X.X.46.253 via ge-0/1/0.0
    to X.X.86.173 via xe-1/1/0.0


    You can apply following policy:

    set policy-options policy-statement export term 1 from protocol static
    set policy-options policy-statement export term 1 from route-filter 0.0.0.0/0 exact
    set policy-options policy-statement export term 1 then accept

    PS: Please accpet my response as solution if it answers your query, kudos are appreciated too!

    Thanks
    Vishal



  • 10.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 02-03-2020 12:16

    Hello,

     

    I have added that statement and then added to be exported by BGP.

    The default route is not being advertsied as of yet. I have also restarted my BGP gracefully with no change.



  • 11.  RE: BGP Advertise Default from ISP to BGP Peer

     
    Posted 01-30-2020 15:24

    Your upstream logical system shows that you are getting a default route via bgp from both of your ISPs.

     

    And you also have a static default route pointed to only one of those ISP.

     

    Was this static route override of the dual BGP routes done on purpose?

    I would have expected that you would use the BGP routes combined with local preference if there is a desire to force the traffic to one ISP by default.

     

    Downstream it does seem that the default route is being learned by both BGP and OSPF.  

    If you remove the static route you might need to make sure the BGP default leaks into OSPF fo redistribution via that protocol.

     

    I guess the question here is what are your goals in routing here.  There are lots of options.

     



  • 12.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 02-03-2020 12:22

    Hello,

     

    The ulimate goal is to advertise the default route 0.0.0.0/0 to my eBGP peers.

    The logical system internet has no issues advertising the default route through OSPF and iBGP. Yes I am receiving a default route from 2 of my 3 ISP's upstream providers but I also have a static route for outbound or upstream traffic to one ISP.

     

    I just cannot seem to have the eBGP in my downstream to advertised the default route to the eBGP Peers.



  • 13.  RE: BGP Advertise Default from ISP to BGP Peer

     
    Posted 02-03-2020 18:23

    Hello,

    I checked the default route in the main instance it seems to be learned from OSPF.  Following export policy can be applied on eBGP.

     

    set policy-options policy-statement export term 1 from protocol ospf
    set policy-options policy-statement export term 1 from route-filter 0.0.0.0/0 exact
    set policy-options policy-statement export term 1 then accept

    Once you have applied the policy please check following output and see if the route is advertised or not

    show route 0.0.0.0/0 exact advertising-protocol bgp <neighbor-addresss>


    Route that need to be advertised:

    show route 0.0.0.0/0 exact

    + = Active Route, - = Last Active, * = Both

    0.0.0.0/0 *[OSPF/150] 2w0d 09:39:02, metric 0, tag 0
    > to X.X.47.251 via xe-1/0/0.0
    [BGP/170] 2w0d 09:38:59, localpref 100, from X.X.47.253
    AS path: XX881 I, validation-state: unverified
    > to X.X.47.251 via xe-1/0/0.0



  • 14.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 02-05-2020 10:20

    Hello,

     

    I have added this to my Adv-Default statement:

    term 10 {
    from {
    protocol ospf;
    route-filter 0.0.0.0/0 exact;
    }
    then accept;
    }

     

    The route is still not being advertised to my BGP neighbors.



  • 15.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 02-05-2020 10:35
    Ok and where do you apply that directly under the neighbor in the bgp group?

    Can you do while the export policy with the default route:

    >show route advertising-protocol bgp (neighbor ip)

    The idea to add the term directly on the adv-supernets is because I am guessing that policy is working and you are advertising those supernets so we know that policy is being evaluated so I was curious if you add it there what do you see




  • 16.  RE: BGP Advertise Default from ISP to BGP Peer
    Best Answer

     
    Posted 02-06-2020 09:43

    Can you please try this:

    set policy-options policy-statement adv-supernets term default-route from protocol ospf
    set policy-options policy-statement adv-supernets term default-route from route-filter 0.0.0.0/0 exact
    set policy-options policy-statement adv-supernets term default-route then accept
    insert policy-options policy-statement adv-supernets term default-route before term 10
    commit

    The above suggestion would work if you still have following configuration:


    Router


    group external {
    type external;
    neighbor X.X.45.145 {
    description "Peer C";
    local-address X.X.45.150;
    export adv-supernets;
    peer-as XXX98;
    }
    neighbor X.X.47.172 {
    description "Peer A";
    local-address X.X.47.174;
    export adv-supernets;
    peer-as XXX36;
    }
    neighbor X.X.44.201 {
    description "Peer B";
    local-address X.X.44.202;
    export adv-supernets;
    peer-as XXX35;
    }
    neighbor X.X.47.237 {
    description "Peer D";
    local-address X.X.47.238;
    export adv-supernets;
    peer-as XXXX08;
    }

     


    show configuration policy-options

    policy-statement adv-supernets {
    term 10 {
    from {
    protocol static;
    prefix-list-filter all-supernets exact;
    }
    then accept;
    }
    term 20 {
    then reject;
    }
    }

    PS: Please accpet my answer as solution if it resolves your query, kudos are appreicated too!

    Thanks
    Vishal







  • 17.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 02-06-2020 10:49

    Hello,

     

    I was able to finally get the route 0.0.0.0/0 to be advertised to my eBGP peers

     

    I had to remove term 20 then reject from:

    policy-statement adv-supernets {
    term 10
    from protocol static;
    prefix-list-filter all-supernets exact;
    then accept;
    term 20
    then reject;

     

    This is the final config that it is working on:

    policy-statement adv-supernets
    term 10
    from
    protocol static;
    prefix-list-filter all-supernets exact;
    then accept;

     

    policy-statement Adv-Default {
    term 10
    from
    protocol ospf;
    route-filter 0.0.0.0/0 exact;
    then accept;
    term 20
    then reject;

     

    group external
    type external;
    neighbor X.X.45.145
    local-address X.X.45.150;
    export adv-supernets;
    peer-as XXX98;

    neighbor X.X.47.172
    local-address X.X.47.174;
    export adv-supernets;
    peer-as XXX36;

     

    neighbor X.X.44.201
    local-address X.X.44.202;
    export adv-supernets;
    peer-as XXX535;

    neighbor X.X.47.237
    local-address X.X.47.238;
    export [ adv-supernets Adv-Default ];
    peer-as XXX108;

     

    run show route 0.0.0.0/0 advertising-protocol bgp X.X.47.237

    inet.0: 782263 destinations, 782265 routes (782263 active, 0 holddown, 0 hidden)
    Prefix Nexthop MED Lclpref AS path
    * 0.0.0.0/0 Self 0 I
    * X.X.224.0/24 Self I
    * X.X.225.0/24 Self I
    * X.X.28.0/22 Self I
    * X.X.32.0/20 Self I

     

    Thank you all for all the assistance.

    This is a great community to be part of



  • 18.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 02-04-2020 17:19

    Hi WNMC Jack Gonzales

     

    This looks interesting, can you try this (try using incomplete value and export it to other BGP peers)? 

     

    https://tools.ietf.org/html/rfc1397 
    2. Default Route Advertisement

    A default route is advertised in an UPDATE message that carries
    reachability information for network 0.0.0.0. A Network field of
    such an UPDATE message must contain the IP address 0.0.0.0 as the
    indication that it carries a default route. The NEXT_HOP path
    attribute of such a message provides the IP address of a border

    gateway that can be used as a default next hop to destinations that
    are not listed in the BGP peer's routing table. The value of the
    ORIGIN attribute should be 2 (INCOMPLETE). The AS_PATH attribute
    should be constructed according to the same rules that apply to a
    conventional network advertisement.

    If multiple default routes are advertised by a BGP speaker, the
    INTER-AS-METRIC path attribute can be included in the corresponding
    UPDATE messages to express preference levels for entry points to the
    same AS.

    The UNREACHABLE path attribute is used to indicate that a previously
    advertised default route has become unreachable.

    UPDATE messages containing the default route advertisements should be
    handled according to the rules that apply to all other UPDATE
    messages. If multiple default route are acquired by a BGP speaker, a
    route is selected according to the local policies adopted by this BGP
    speaker.

     

    If this solves your problem, please mark this post as "Accepted Solution".
    If you think that my answer was helpful, please spend some Kudos.



  • 19.  RE: BGP Advertise Default from ISP to BGP Peer

    Posted 02-04-2020 19:50

    Hi!

     

    can you try just adding a term to export the defult route before term 20 on the policy adv-supernets?