Multicast and Routing Guide K/KA/KB.15.15
4. Configure attributes for route 1.0.0.0/8, making Switch D give priority to the route learned
from Switch C.
# Configure a higher MED value for the route 1.0.0.0/8 advertised from Switch A to peer
192.1.1.2.
# Define a prefix-list to permit route 1.0.0.0/8.
HP Switch(config)# ip prefix-list pl_1 permit 1.0.0.0/24
# Define two routing policies, apply_med_50, which sets the MED for route 1.0.0.0/8 to 50,
and apply_med_100, which sets the MED for route 1.0.0.0/8 to 100.
HP Switch(config)# route-map apply_med_50 permit
HP Switch(route-map-apply_med_50)# match ip address prefix-list pl_1
HP Switch(route policy)# set metric 50
HP Switch(route policy)route-map apply_med_50 permit seq 20
HP Switch(route policy)# exit
HP Switch(config)# route-map apply_med_100 permit
HP Switch(route policy)# match ip address prefix-list pl_1
HP Switch(route policy)# set metric 100
HP Switch(route policy)# route-map apply_med_100 permit seq 20
HP Switch(route policy)# exit
# Apply routing policy apply_med_50 to the route advertised to peer 193.1.1.2 (Switch C),
and apply_med_100 to the route advertised to peer 192.1.1.2 (Switch B.)
HP Switch(config)# bgp 100
HP Switch(bgp)# neighbor 193.1.1.2 route-map apply_med_50 out
HP Switch(bgp)# neighbor 192.1.1.2 route-policy apply_med_100 out
HP Switch(bgp)# exit
# Display the BGP routing table on Switch D.
HP Switch(config)# show ip bgp
Local AS : 100
Local Router-id : 194.1.1.1
BGP Table Version : 1
Status codes: * - valid, > - best, i - internal, e - external, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Nexthop Metric LocalPref Weight AsPath
-------------------------------------------------------
*>e 1.0.0.0/24 194.1.1.2 50 0 100i
*>e 1.0.0.0/24 195.1.1.2 100 0 100i
You can ensure that route 1.0.0.0/8 is the optimal route. Configure different local preferences
on Switch B and C for route 1.0.0.0/ 8, making Switch D give priority to the route from Switch
C.
# Define an ip prefix-list on Router C, permitting route 1.0.0.0/8.
HP Switch(config)# ip prefix-list pl_1 permit 1.0.0.0/8
# Configure a routing policy named localpref on Switch C, setting the local preference of
route 1.0.0.0/8 to 200 (the default is 100.)
HP Switch(config)# route-map localpref permit seq 10
HP Switch(route-policy)# match ip address prefix-list pl_1
HP Switch(route-policy)# set local-preference 200
HP Switch(route-policy)# route-map localpref permit seq 20
# Apply routing policy localpref to routes from peer 193.1.1.1.
BGP configuration examples 327










