In part 1 of the “Basic BGP configuration in Nokia 7750 SR/7705 SAR” article, we learned about ibgp, export policy and some basic attributes. Next we will Understanding on how to best manage BGP attributes including next-hop, local preferences,and AS-path and Fundamentals of route aggregation and managing the atomic aggregate BGP attribute.

Configure routers R1 and R2 with the minimum required eBGP peering to routers R3 and R4 respectively. Also configure routers R1 and R2 to detect loops and to discard prefixes that contain AS 65540’s own AS number.
#R1#
/configure router bgp group "EBGP"
type external
peer-as 65550
neighbor 10.0.2.2
#R2#
/configure router bgp group "EBGP"
type external
peer-as 65550
neighbor 10.0.4.1
#R3#
/configure router bgp group "EBGP"
type external
peer-as 65540
neighbor 10.0.2.1
#R4#
/configure router bgp group "EBGP"
type external
peer-as 65540
neighbor 10.0.4.2
On routers R3 and R4 create default routes and export them to routers R1 and R2. No other routes are to be exported downstream. This allows downstream ASes (AS 65540 and its external clients), to reach the internet backbone. The same policy is to be applied for both routers R3 and R4.
/configure router static-route-entry 0.0.0.0/0 black-hole no shutdown
/configure router policy-options
begin
prefix-list "Default-Route" prefix 0.0.0.0/0 exact
policy-statement "Default_route_AS_65540"
entry 10
from prefix-list "Default-Route"
action accept
exit
exit
default-action reject
exit
commit
exit all
/configure router bgp group "EBGP" export "Default_route_AS_65540"
Checking the route 0.0.0.0/0 on R5 will see that it is still not the best, which means there is a route in the BGP table but it has not been selected for inclusion in the routing-table.
#R5#
show router bgp routes 0.0.0.0/0
===============================================================================
BGP Router ID:10.40.10.5 AS:65540 Local AS:65540
===============================================================================
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 Label
As-Path
-------------------------------------------------------------------------------
? 0.0.0.0/0 100 None
10.0.2.2 None -
65550
? 0.0.0.0/0 100 None
10.0.4.1 None -
65550
-------------------------------------------------------------------------------
Routes : 2
===============================================================================
If you verify the route to the next-hop address above, you see that a next-hop cannot be resolved:
#R5#
show router route-table 10.0.2.2
===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags] Type Proto Age Pref
Next Hop[Interface Name] Metric
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
No. of Routes: 0
Flags: n = Number of times nexthop is repeated
B = BGP backup route available
L = LFA nexthop available
S = Sticky ECMP requested
===============================================================================
The IGP is not able to resolve the next-hop address. The above can be resolved by using next-hop-self at routers R1 and R2. Routers R1 and R2 will replace the next-hop of routes learned through eBGP with their own system addresses, which are reachable by all AS 65540 systems using IGP.
Apply the command next-hop-self to the iBGP group on routers R1 and R2.
#R1 and R2#
/configure router bgp group IBGP next-hop-self
Check the route 0.0.0.0/0 again after applying next-hop-self in R1 and R2:
#R5#
show router bgp routes 0.0.0.0/0
...
===============================================================================
Flag Network LocalPref MED
Nexthop (Router) Path-Id Label
As-Path
-------------------------------------------------------------------------------
u*>? 0.0.0.0/0 100 None
10.40.10.1 None -
65550
*? 0.0.0.0/0 100 None
10.40.10.2 None -
65550
-------------------------------------------------------------------------------
...
show router route-table 10.40.10.1
...
===============================================================================
Dest Prefix[Flags] Type Proto Age Pref
Next Hop[Interface Name] Metric
-------------------------------------------------------------------------------
10.40.10.1/32 Remote ISIS 00h08m58s 15
10.40.0.2 100
-------------------------------------------------------------------------------
...
show router route-table
===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags] Type Proto Age Pref
Next Hop[Interface Name] Metric
-------------------------------------------------------------------------------
0.0.0.0/0 Remote BGP 00h01m21s 170
10.40.0.2 0
...
What is the BGP tie-breaker used for the default route learned from AS 65550 on routers R5 and R6?
The tie-breaker is the lowest Originator ID as can be seen below:
#R5#
show router bgp routes 0.0.0.0/0 detail
...
Network : 0.0.0.0/0
Nexthop : 10.40.10.2
Path Id : None
From : 10.40.10.2
Res. Nexthop : 10.40.0.18
Local Pref. : 100 Interface Name : toR2
...
TieBreakReason : OriginatorID
...
On router R4, examine the route to 192.168.2.24/29. Why did BGP select the external route over the internal route?
#R4#
show router bgp routes 192.168.2.24/29
...
===============================================================================
BGP IPv4 Routes
===============================================================================
Flag Network LocalPref MED
Nexthop (Router) Path-Id Label
As-Path
-------------------------------------------------------------------------------
u*>i 192.168.2.24/29 None None
10.0.4.2 None -
65540 65539
*i 192.168.2.24/29 100 None
10.0.2.1 None -
65540 65539
-------------------------------------------------------------------------------
Routes : 2
===============================================================================
A local preference of “none” means that this attribute has not been received from the peer 10.0.4.2 (router R2), which is as expected. The default local preference is set to 100 before an eBGP route is forwarded to iBGP. This is verified using the following command:
A:R4# show router bgp routes 192.168.2.24/29 hunt
...
Network : 192.168.2.24/29
Nexthop : 10.0.2.1
Path Id : None
From : 10.50.10.3
Res. Nexthop : 0.0.0.0
...
TieBreakReason : EBGPRoute
...
The local preference set by both routers R3 and R4 for the prefix 192.168.2.24/29 is 100 (the default), therefore falling through decision criteria:
If the entry is valid and loop-free and the next-hop is reachable, prefer the:
(1) Route with the higher local preference (same at 100)
(2) Route with the shorter AS path (same string “65540″)
(3) Route with the lower origin code (same, set as IGP from AS 65540)
(4) Route with the lowest MED (none set by AS 65540)
(5) Route learned from an eBGP peer before one learned from an iBGP peer
(6) Route with the lowest IGP cost to the next-hop
(7) Route with the lowest BGP router ID
(8) Route with the shortest cluster list
(9) Route with the lowest peer IP address
Because origin, MED, and AS paths are all equal, the router prefers the eBGP over the iBGP peer as can be observed in the TieBreakReason in the above display.
On routers R1 and R2, use the aggregate command and create/apply a new export policy to generate a summary of the prefixes 10.40.0.0/13 and 192.168.0.0/16 into AS 65550.
#R1 and R2#
/configure router aggregate 10.40.0.0/13
/configure router aggregate 192.168.0.0/16
/configure router policy-options
begin
policy-statement "Advertise-aggregates-upstream"
entry 10
from protocol aggregate
action accept
exit
exit
exit
commit
exit all
/configure router bgp group "EBGP" export "Advertise-aggregates-upstream"
The aggregate route of the CIDR network of AS 65540, 10.40.0.0/13, does not have the Atomic Aggregate attribute set, however the aggregate route for the external network, 192.168.0.0/16, has the Atomic Aggregate attribute set because of the loss of the ASPath information due to aggregation. AS-Path information can be preserved by using the “as-set” option of the aggregate command:
#R1 and R2#
configure router aggregate 192.168.0.0/16 as-set
Compare before and after applying as-set:

That’s all the basics of BGP finished. Good luck!
Follow us on social networks: