Beruflich Dokumente
Kultur Dokumente
What we want to do is to configure default local preference attribute, which will determine the
optimal route, for traffic that leaves AS 100. In our case, the whole traffic leaving AS 100 will go
through AR3.
If a BGP device obtains multiple routes from different IBGP peers and these routes have different
next hops to the same destination, the BGP device will select the route with the greatest Local_Pref
value.
If you want to recall how to configure BGP, just go to basic BGP in Huawei CLI.
AR1,AR2,AR3,AR4
[AR1]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 18 Routes : 18
As you can see in the IP routing table, Loopback0 of router AR4 is available through IBGP, with the
next hop 10.1.1.2 (AR2). From BGP routing table you can notice that there are 2 paths to network
4.4.4.4/32. One of them is chosen as the best path by BGP.
Lets focus on Local Preference attribute. In our case, we can see that both paths have the same local
preference value. Now we will change it to let BGP to choose the best path, based on local
preference attribute:
[AR2]bgp 100
[AR2-bgp]default local-preference 200
[AR3]bgp 100
[AR3-bgp]default local-preference 300
[AR1]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 18 Routes : 19
It means that AR3 router is a gateway for the whole outgoing traffic leaving AS 100.
[AR4]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
As you can see the whole incoming traffic from AS 200 is going through AR2. So we have proved that
BGP local preference attribute is applicable only for traffic leaving AS.