Routing policy controls which routes are accepted, modified and advertised. Policy is central to safe inter-domain routing.
Learning objectives
- Differentiate inbound and outbound policy.
- Build prefix lists using exact matches and ge/le.
- Understand route-map sequence, match, set and implicit deny.
- Use LOCAL_PREF, MED and Cisco Weight carefully.
- Verify policy effects and refresh routes safely.
1. Policy direction
| Direction | Meaning | Purpose |
|---|---|---|
| Inbound | Routes received from neighbour | Filter/tag/modify received routes |
| Outbound | Routes sent to neighbour | Control 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
| Attribute | Scope | Preference |
|---|---|---|
| LOCAL_PREF | Within an AS; normally propagated via iBGP | Higher preferred |
| MED | Hint to adjacent AS; comparison scope is policy/platform dependent | Lower preferred when compared |
| Weight | Cisco-specific local attribute; not propagated | Higher 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
- Route refresh lets a router request a peer to resend routes when the capability is negotiated.
- Soft reconfiguration inbound can retain pre-policy routes for comparison but consumes memory and requires support.
- Compare received, accepted and advertised routes; command availability varies.
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
| ID | Test | Expected result |
|---|---|---|
| J-01 | Exact prefix-list permit | Only exact prefix permitted. |
| J-02 | ge/le boundary | Prefix lengths match intended range. |
| J-03 | No prefix-list match | Implicit deny. |
| J-04 | Route-map permit/set | Route accepted and attribute changed. |
| J-05 | Route-map deny | Matching route rejected. |
| J-06 | Multiple sequences | First matching sequence controls. |
| J-07 | Change LOCAL_PREF | Best path changes when earlier criteria do not decide. |
| J-08 | Change MED | Comparison follows configured scope. |
| J-09 | Change Weight | Local best path changes. |
| J-10 | no-export community | Tag and actual export behaviour verified separately. |
| J-11 | Route refresh | Peer resends routes when supported. |
| J-12 | Compare received/accepted/advertised | Policy effects independently visible. |
Interview questions
- Inbound versus outbound policy?
- How do ge and le work?
- What if no prefix-list entry matches?
- How are route-map sequences evaluated?
- Why use LOCAL_PREF?
- How does MED differ?
- Why is Weight Cisco-specific?
- What is route refresh?
- Trade-off of soft-reconfiguration inbound?
- Does no-export automatically block every export?
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.