← Back to Part 2 Modules
PART 2 · ADVANCED BGP THEORY · MODULE J

Module J – BGP Routing Policies

Lesson content presented from the approved Part 2 master documentation.

Routing policy controls which routes are accepted, modified and advertised. Policy is central to safe inter-domain routing.

Learning objectives

1. Policy direction

DirectionMeaningPurpose
InboundRoutes received from neighbourFilter/tag/modify received routes
OutboundRoutes sent to neighbourControl route export

2. Prefix lists

ip prefix-list CUSTOMER-IN seq 10 permit 203.0.113.0/24
ip prefix-list CUSTOMER-IN seq 20 permit 198.51.100.0/24 le 26
router bgp 65001
 neighbor 11.1.1.2 prefix-list CUSTOMER-IN in

Prefix lists are evaluated in sequence order. ge/le define prefix-length ranges. If no entry matches, the implicit result is deny.

3. Route maps

route-map PEER-IN permit 10
 match ip address prefix-list CUSTOMER-IN
 set local-preference 200
!
route-map PEER-IN deny 100
!
router bgp 65001
 neighbor 11.1.1.2 route-map PEER-IN in

The first matching route-map sequence determines the action. If no sequence permits a route, the implicit deny applies.

4. Common policy attributes

AttributeScopePreference
LOCAL_PREFWithin an AS; normally propagated via iBGPHigher preferred
MEDHint to adjacent AS; comparison scope is policy/platform dependentLower preferred when compared
WeightCisco-specific local attribute; not propagatedHigher preferred
route-map PREFER-PRIMARY permit 10
 set local-preference 250
!
router bgp 65001
 neighbor 11.1.1.2 route-map PREFER-PRIMARY in

A community such as no-export is a tag; peer behaviour or explicit policy must honour it. For a specific export restriction, use outbound filtering or a policy matching the community.

5. Route refresh and soft reconfiguration

show ip bgp neighbors <peer>
show ip bgp neighbors <peer> routes
show ip bgp neighbors <peer> advertised-routes
show ip prefix-list
show route-map

Senior QA scenarios

IDTestExpected result
J-01Exact prefix-list permitOnly exact prefix permitted.
J-02ge/le boundaryPrefix lengths match intended range.
J-03No prefix-list matchImplicit deny.
J-04Route-map permit/setRoute accepted and attribute changed.
J-05Route-map denyMatching route rejected.
J-06Multiple sequencesFirst matching sequence controls.
J-07Change LOCAL_PREFBest path changes when earlier criteria do not decide.
J-08Change MEDComparison follows configured scope.
J-09Change WeightLocal best path changes.
J-10no-export communityTag and actual export behaviour verified separately.
J-11Route refreshPeer resends routes when supported.
J-12Compare received/accepted/advertisedPolicy effects independently visible.

Interview questions

Student Knowledge Assessment – Module J (reconstructed)

Q1. Which policy direction controls routes received from a neighbour?

A. Outbound

B. Inbound

C. Local-only

D. Redistribution-only

Correct answer: B. Inbound

Explanation: Inbound policy applies to routes received from a peer.

Q2. Which direction controls routes advertised to a neighbour?

A. Inbound

B. Outbound

C. IGP

D. TCP

Correct answer: B. Outbound

Explanation: Outbound policy controls route export.

Q3. What does le specify in a prefix list?

A. Lowest AS number

B. Maximum permitted prefix length

C. MED value

D. TCP port

Correct answer: B. Maximum permitted prefix length

Explanation: le defines the maximum prefix length that can match.

Q4. What happens if no prefix-list entry matches?

A. Implicit permit

B. Implicit deny

C. Route becomes static

D. BGP resets

Correct answer: B. Implicit deny

Explanation: Prefix lists have an implicit deny.

Q5. Which LOCAL_PREF value is preferred?

A. Lower

B. Higher

C. Zero only

D. Equal only

Correct answer: B. Higher

Explanation: Higher LOCAL_PREF is preferred.

Q6. Which MED value is generally preferred when compared?

A. Higher

B. Lower

C. 255 only

D. Never compared

Correct answer: B. Lower

Explanation: Lower MED is preferred when the comparison is reached and applicable rules permit it.

Q7. Which attribute is Cisco-specific and local?

A. AS_PATH

B. ORIGIN

C. Weight

D. LOCAL_PREF

Correct answer: C. Weight

Explanation: Weight is Cisco-specific and is not advertised to BGP peers.

Q8. What does the first matching route-map sequence do?

A. Combines all sequences

B. Determines the action for that route

C. Resets session

D. Changes ASN

Correct answer: B. Determines the action for that route

Explanation: Route-map processing stops at the first matching sequence.

Q9. What is route refresh used for?

A. Request routes again from peer

B. Change TCP port

C. Change router ID

D. Disable updates

Correct answer: A. Request routes again from peer

Explanation: Route refresh requests a peer to resend routes when supported.

Q10. Does set community no-export alone guarantee blocking to every specific neighbour?

A. Yes

B. No; policy/peer handling must honour it

C. Only eBGP

D. Only iBGP

Correct answer: B. No; policy/peer handling must honour it

Explanation: The tag needs to be honoured by peer behaviour or explicit policy.

Source and assessment note

Technical explanations, tables, examples, QA scenarios and assessments are presented from the approved Part 2 master documentation. Verify illustrative CLI syntax against the target router platform and software release before lab or production use.