BGP Default Route Origination

This chapter describes BGP Default Route Origination.

Topics in this chapter include:

Applicability

The information and configuration in this chapter are based on SR OS Release 20.7.R1. Advertising artificially generated IPv4 and IPv6 default routes is supported in SR OS Release 19.7.R1 and later.

Overview

It is common practice for a BGP router to send an IPv4 and/or IPv6 default route to certain peers rather than a number of more specific routes.

In SR OS Releases earlier than 19.7.R1, a BGP router only advertises a default route that is installed in the Forwarding Information Base (FIB). This default route is either received from a BGP peer and re-advertised, or the default route is configured locally as a static route, with black-hole next-hop. The attributes of this default route can be modified by an export policy. The drawback of depending on a default route installed in the FIB is that when the BGP peer withdraws or modifies the default route, the BGP router must withdraw or re-advertise the default route.

In SR OS Release 19.7.R1 and later, the send-default command allows BGP routers to advertise artificially generated IPv4 (0.0.0.0/0) and/or IPv6 (::/0) default routes. These artificially generated default routes are unrelated to possible default routes installed in the FIB of the local router. If the local FIB contains a default route and a BGP export policy allows that installed default route to be advertised, the send-default command overrides the advertisement of the installed default route. If the default route in the FIB is withdrawn or modified, the artificially generated default route continues to be advertised.

The send-default command can be configured in the general bgp context, in the BGP group context, or in the BGP neighbor context, in both base router instance and VPRN router instances. The command can be used for IPv4, IPv6, or both. An optional send-default export policy can modify the attributes of the artificially generated default routes. Only the default-action part of this send-default export policy is parsed and applied, as follows:

*A:PE-1# configure router bgp send-default
  - no send-default
  - send-default [ipv4] [ipv6] [export-policy <export-policy>]

 <ipv4>               : keyword - provision support of the specific family
 <ipv6>               : keyword - provision support of the specific family
 <export-policy>      : [64 chars max]

Before modification by a send-default export policy, the properties of the artificially generated default route are as follows:

  • The origin is set to Incomplete.

  • When advertised to an iBGP peer, the AS_PATH is empty.

  • When advertised to an eBGP peer, the global Autonomous System Number (ASN) and/or local AS are prepended. If the send-default export policy specifies an as-path-prepend action, these modifications are made before prepending the ASN and/or local AS.

  • The BGP next-hop is the local address used with the receiving peer or the local router ID (if the Network Layer Reachability Information (NLRI) is IPv6, and the local address is an IPv4 address or it refers to an IPv4-only interface).

  • No Multi-Exit Discriminator (MED) attribute is added.

  • When advertised to an iBGP peer, a local preference attribute is added and its value is taken from the configuration of the local-preference command or the value 100, the implicit default.

  • No standard or large communities are attached. When a send-default export policy is applied to change this, confirm that disable-communities is not set.

Configuration

Example topology with IPv4 addresses shows the example topology with two routers. An eBGP session is established between the base routers (PE-1 in AS 64501 and PE-2 in AS 64500) and an iBGP session is established within VPRN 1 in AS 64496.

Figure 1. Example topology with IPv4 addresses

Example topology with IPv6 addresses shows the same example topology with IPv6 addresses.

Figure 2. Example topology with IPv6 addresses

The initial configuration includes:

  • Cards, MDAs, ports

  • Router interfaces

On PE-1, the BGP configuration in the base router is as follows:

# on PE-1:
configure
    router Base
        autonomous-system 64501
        bgp
            router-id 192.0.2.1
            split-horizon
            group "eBGP"
                peer-as 64500
                local-as 64501
                neighbor 192.168.12.2
                    family ipv4 
                    local-address "int-PE-1-PE-2"
                    disable-communities large
                exit
                neighbor 2001:db8::12:2
                    family ipv6
                    local-address 2001:db8::12:1
                exit
            exit
            no shutdown
        exit

On PE-1, the BGP configuration in VPRN 1 is as follows:

# on PE-1:
configure
    service
        vprn 1 name "VPRN 1" customer 1 create
            autonomous-system 64496
            ---snip---
            bgp
                router-id 172.31.0.1
                split-horizon
                group "iBGP-VPRN1"
                    type internal
                    neighbor 172.31.0.2
                        family ipv4
                        local-address 172.31.0.1
                        disable-communities large
                    exit
                    neighbor 2001:db8::31:0:2
                        family ipv6
                    exit
                exit
                no shutdown
            exit
            ---snip---

The configuration is similar on PE-2.

No export policies are applied in BGP, so no routes will be advertised. The following BGP sessions are established on PE-2:

*A:PE-2# show router bgp summary all

===============================================================================
BGP Summary
===============================================================================
Legend : D - Dynamic Neighbor
===============================================================================
Neighbor
Description
ServiceId          AS PktRcvd InQ  Up/Down   State|Rcv/Act/Sent (Addr Family)
                      PktSent OutQ
-------------------------------------------------------------------------------
192.168.12.1
Def. Instance  64501        8    0 00h01m45s 0/0/0 (IPv4)
                            9    0
2001:db8::12:1
Def. Instance  64501        7    0 00h01m39s 0/0/0 (IPv6)
                            7    0

172.31.0.1
Svc: 1         64496        7    0 00h01m33s 0/0/0 (IPv4)
                            7    0
2001:db8::31:0:1
Svc: 1         64496        6    0 00h01m24s 0/0/0 (IPv6)
                            6    0
-------------------------------------------------------------------------------

Initially, no default routes are installed in the route table of the base router or the VPRN; for example, on PE-2, as follows:

*A:PE-2# show router route-table 0.0.0.0/0

===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags]                            Type    Proto     Age        Pref
      Next Hop[Interface Name]                                    Metric
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
No. of Routes: 0
*A:PE-2# show router 1 route-table ipv6 ::/0

===============================================================================
IPv6 Route Table (Service: 1)
===============================================================================
Dest Prefix[Flags]                            Type    Proto     Age        Pref
      Next Hop[Interface Name]                                    Metric
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
No. of Routes: 0

The following use cases are shown in the following subsections:

  • Advertise default routes that are installed in the FIB

  • Advertise artificially generated default routes

Advertise default routes that are installed in the FIB

PE-1 has not received default routes from any other BGP peer, so black-holed default routes for IPv4 and IPv6 are configured locally in the base router and in VPRN 1 routing instances, as follows:

# on PE-1:
configure
    router Base
        static-route-entry 0.0.0.0/0
            black-hole
                no shutdown
            exit
        exit
        static-route-entry ::/0
            black-hole
                no shutdown
            exit
        exit
    exit
    service
        vprn "VPRN 1"
            static-route-entry 0.0.0.0/0
                black-hole
                    no shutdown
                exit
            exit
            static-route-entry ::/0
                black-hole
                    no shutdown
                exit
            exit
        exit
    exit

The following export policies are configured for prefixes 0.0.0.0/0 and ::/0.

# on PE-1:
configure
    router Base
        policy-options
            begin
            prefix-list "route_0/0"
                prefix 0.0.0.0/0 exact
            exit
            prefix-list "route_::/0"
                prefix ::/0 exact
            exit
            policy-statement "export-route_0/0"
                entry 10
                    from
                        prefix-list "route_0/0"
                    exit
                    action accept
                        origin igp
                    exit
                exit
            exit
            policy-statement "export-route_::/0"
                entry 10
                    from
                        prefix-list "route_::/0"
                    exit
                    action accept
                        origin igp
                    exit
                exit
            exit
            commit
        exit

These export policies are applied in BGP group "eBGP" in the base router, as follows:

# on PE-1:
configure
    router Base
        bgp
            group "eBGP"
                export "export-route_0/0" "export-route_::/0"
            exit
        exit

The same export policies are applied in the general bgp context in VPRN 1, as follows:

# on PE-1:
configure
    service
        vprn "VPRN 1"
            bgp
                export "export-route_0/0" "export-route_::/0"
            exit
        exit

No default routes are configured on PE-2.

The following BGP summary on PE-2 shows that in each BGP session one BGP route is received and active:

*A:PE-2# show router bgp summary all

===============================================================================
BGP Summary
===============================================================================
Legend : D - Dynamic Neighbor
===============================================================================
Neighbor
Description
ServiceId          AS PktRcvd InQ  Up/Down   State|Rcv/Act/Sent (Addr Family)
                      PktSent OutQ
-------------------------------------------------------------------------------
192.168.12.1
Def. Instance  64501       22    0 00h08m21s 1/1/0 (IPv4)
                           22    0
2001:db8::12:1
Def. Instance  64501       21    0 00h08m15s 1/1/0 (IPv6)
                           20    0

172.31.0.1
Svc: 1         64496       21    0 00h08m10s 1/1/0 (IPv4)
                           20    0
2001:db8::31:0:1
Svc: 1         64496       21    0 00h08m00s 1/1/0 (IPv6)
                           20    0
-------------------------------------------------------------------------------

The following BGP route is received in the base router:

*A:PE-2# show router bgp routes
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  0.0.0.0/0                                          100         None
      192.168.12.1                                       None        0
      64501                                                          -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

Also, a BGP-IPv6 route for ::/0 is received in the base router, and VPRN 1 receives BGP-IPv4 route 0.0.0.0/0 and BGP-IPv6 route ::/0, as follows:

*A:PE-2# show router 1 bgp routes ipv6
===============================================================================
 BGP Router ID:172.31.0.2       AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv6 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  ::/0                                               100         None
      2001:db8::31:0:1                                   None        10
      No As-Path                                                     -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The default route 0.0.0.0/0 is installed in the route table for the base router, as follows:

*A:PE-2# show router route-table 0.0.0.0/0
===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags]                            Type    Proto     Age        Pref
      Next Hop[Interface Name]                                    Metric
-------------------------------------------------------------------------------
0.0.0.0/0                                     Remote  BGP       00h02m48s  170
       192.168.12.1                                                 0
-------------------------------------------------------------------------------
No. of Routes: 1

Similarly, the default route ::/0 is installed in the IPv6 route table for the base router (not shown here). For VPRN 1, default route 0.0.0.0/0 is installed in the IPv4 route table (not shown here), whereas default route ::/0 is installed in the IPv6, as follows:

*A:PE-2# show router 1 route-table ipv6 ::/0
===============================================================================
IPv6 Route Table (Service: 1)
===============================================================================
Dest Prefix[Flags]                            Type    Proto     Age        Pref
      Next Hop[Interface Name]                                    Metric
-------------------------------------------------------------------------------
::/0                                          Remote  BGP       00h02m52s  170
       fe80::21:88ab:d904:706f-"int-VPRN1-PE-2-PE-1"                10
-------------------------------------------------------------------------------
No. of Routes: 1

Advertise artificially generated default routes

With the send-default command, no default routes need to be installed in the FIB. However, the following example shows that both static default routes in PE-1 remain, but that this static default route will not be advertised anymore. With the send-default command, an artificially generated default route is advertised and overrules the static default route.

The following send-default command is configured on PE-1 and PE-2:

# on PE-1, PE-2:
configure
    router Base
        bgp 
            group "eBGP"
                send-default ipv4 ipv6
            exit
            info
        exit
    exit
    service
        vprn "VPRN 1"
            bgp
                send-default ipv4 ipv6
            exit
        exit
    exit

The following BGP summary on PE-2 shows that in each BGP session, one route is received and active, and one route is advertised:

*A:PE-2# show router bgp summary all 

===============================================================================
BGP Summary
===============================================================================
Legend : D - Dynamic Neighbor
===============================================================================
Neighbor
Description
ServiceId          AS PktRcvd InQ  Up/Down   State|Rcv/Act/Sent (Addr Family)
                      PktSent OutQ
-------------------------------------------------------------------------------
192.168.12.1
Def. Instance  64501       25    0 00h09m03s 1/1/1 (IPv4)
                           25    0           
2001:db8::12:1
Def. Instance  64501       24    0 00h09m01s 1/1/1 (IPv6)
                           23    0           

172.31.0.1
Svc: 1         64496       23    0 00h08m54s 1/1/1 (IPv4)
                           23    0           
2001:db8::31:0:1
Svc: 1         64496       23    0 00h08m54s 1/1/1 (IPv6)
                           22    0           
-------------------------------------------------------------------------------

Because no send-default export policy is configured to modify the attributes, the origin will remain Incomplete, which also proves that the received routes on PE-2 are different from the ones received before the send-default command was configured, as follows:

*A:PE-2# show router bgp routes
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>?  0.0.0.0/0                                          100         None
      192.168.12.1                                       None        0
      64501                                                          -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The following shows the details of the received BGP-IPv4 route and the advertised BGP-IPv6 route in the base router on PE-2:

*A:PE-2# show router bgp routes 0.0.0.0/0 hunt 
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500      
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete
===============================================================================
BGP IPv4 Routes
===============================================================================
-------------------------------------------------------------------------------
RIB In Entries
-------------------------------------------------------------------------------
Network        : 0.0.0.0/0
Nexthop        : 192.168.12.1
Path Id        : None                   
From           : 192.168.12.1
Res. Protocol  : LOCAL                  Res. Metric    : 0
Res. Nexthop   : 192.168.12.1
Local Pref.    : None                   Interface Name : int-PE-2-PE-1
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 0
Connector      : None
Community      : No Community Members
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.1
Fwd Class      : None                   Priority       : None
Flags          : Used Valid Best Incomplete 
Route Source   : External
AS-Path        : 64501 
Route Tag      : 0                      
Neighbor-AS    : 64501
Orig Validation: NotFound               
Source Class   : 0                      Dest Class     : 0
Add Paths Send : Default                
RIB Priority   : Normal                 
Last Modified  : 00h00m49s              
 
-------------------------------------------------------------------------------
RIB Out Entries
-------------------------------------------------------------------------------
Network        : 0.0.0.0/0
Nexthop        : 192.168.12.2
Path Id        : None                   
To             : 192.168.12.1
Res. Protocol  : INVALID                Res. Metric    : 0
Res. Nexthop   : n/a
Local Pref.    : n/a                    Interface Name : NotAvailable
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 0
Connector      : None
Community      : No Community Members
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.1
Origin         : Incomplete             
AS-Path        : 64500 
Route Tag      : 0                      
Neighbor-AS    : 64500
Orig Validation: NotFound               
Source Class   : 0                      Dest Class     : 0
 
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

The origin attribute can be modified by the following export policy that adds the large community 64496:1:1 and sets the MED value to 50 and the origin to IGP (so it will not be Incomplete anymore):

# on PE-1, PE-2:
configure
    router Base
        policy-options
            begin
            community "large1"
                members "64496:1:1"
            exit
            policy-statement "export-default"
                default-action accept
                    community add "large1"
                    origin igp
                    bgp-med set 50
                exit
            exit
            commit

This export policy is included in the send-default command, as follows:

# on PE-1, PE-2:
configure
    router Base
        bgp
            group "eBGP"
                send-default ipv4 ipv6 export-policy "export-default"
            exit
        exit
    exit
    service
        vprn "VPRN 1"
            bgp
                send-default ipv4 ipv6 export-policy "export-default"
            exit
        exit

This export policy sets the origin to IGP instead of Incomplete. PE-2 receives the BGP-IPv4 default route with origin IGP and MED 50, as follows:

*A:PE-2# show router bgp routes
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete
===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  0.0.0.0/0                                          None        50
      192.168.12.1                                       None        0
      64501                                                          -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================
*A:PE-2# show router bgp routes 0.0.0.0/0 hunt | match Flags
Flags          : Used Valid Best IGP

The other artificially generated default routes also have origin IGP and MED 50. In this example, the disable-communities large command is configured on PE-1 for the IPv4 neighbors in the base router and in VPRN 1, so no large community is sent to PE-2 for IPv4; only for IPv6. On PE-2, the details of the received default IPv6 route ::/0 in VPRN 1 are as follows:

*A:PE-2# show router 1 bgp routes ::/0 hunt
===============================================================================
 BGP Router ID:172.31.0.2       AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv6 Routes
===============================================================================
-------------------------------------------------------------------------------
RIB In Entries
-------------------------------------------------------------------------------
Network        : ::/0
Nexthop        : 2001:db8::31:0:1
Path Id        : None
From           : 2001:db8::31:0:1
Res. Protocol  : ISIS                   Res. Metric    : 10
Res. Nexthop   : fe80::10:1ff:fe01:1
Local Pref.    : 100                    Interface Name : int-VPRN1-PE-2-PE-1
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : 50
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : 64496:1:1
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 172.31.0.1
Fwd Class      : None                   Priority       : None
Flags          : Used Valid Best IGP
Route Source   : Internal
AS-Path        : No As-Path
Route Tag      : 0
Neighbor-AS    : n/a
Orig Validation: NotFound
Source Class   : 0                      Dest Class     : 0
Add Paths Send : Default
RIB Priority   : Normal
Last Modified  : 00h02m50s
---snip---

The artificially generated default routes are only modified by the send-default export policy, not involving other export BGP policies.

Conclusion

With the send-default command, BGP routers can advertise artificially generated default routes for IPv4, IPv6, or both. The artificially generated default routes are always advertised, regardless of the presence of default routes installed in the local FIB.