297
# Display the BGP routing table on Router D.
[RouterD] display bgp routing-table ipv4
Total number of routes: 2
BGP local router ID is 195.1.1.1
Status codes: * - valid, > - best, d - dampened, h - history,
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* >i 1.0.0.0 193.1.1.1 50 100 0 100i
* i 192.1.1.1 100 100 0 100i
The route 1.0.0.0/8 learned from Router C is the optimal route.
{
(Method 2.) Specify different local preferences for route 1.0.0.0/8 on Router B and C to make
Router D give priority to the route learned from Router C.
# Define ACL 2000 to permit the route 1.0.0.0/8 on Router C.
[RouterC] acl number 2000
[RouterC-acl-basic-2000] rule permit source 1.0.0.0 0.255.255.255
[RouterC-acl-basic-2000] quit
# Define routing policy
localpref
on Router C to set the local preference of route 1.0.0.0/8 to
200 (the default is 100).
[RouterC] route-policy localpref permit node 10
[RouterC-route-policy-localpref-10] if-match ip address acl 2000
[RouterC-route-policy-localpref-10] apply local-preference 200
[RouterC-route-policy-localpref-10] quit
# Apply the routing policy
localpref
to the route from the peer 193.1.1.1 on Router C.
[RouterC] bgp 200
[RouterC-bgp] address-family ipv4 unicast
[RouterC-bgp-ipv4] peer 193.1.1.1 route-policy localpref import
[RouterC-bgp-ipv4] quit
[RouterC-bgp] quit
# Display the BGP routing table on Router D.
[RouterD] display bgp routing-table ipv4
Total number of routes: 2
BGP local router ID is 195.1.1.1
Status codes: * - valid, > - best, d - dampened, h - history,
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* >i 1.0.0.0 193.1.1.1 200 0 100i
* i 192.1.1.1 100 0 100i