zNetLaB › Guided labs › Service Provider
IOS XR routing policy: sets, drop and attributes
Service Provider Advanced 2 devices 4 checked tasks 100 points Plan lab
A customer sends three prefixes. Write one inbound route-policy that raises the preference of the first and tags it, throws the second away and passes the rest. You build it in a browser, type real commands at each device, and every task below is
checked against the running configuration — so you find out it is wrong before anybody else does.
Open this lab in the simulator
The simulator runs in your browser with nothing to install. This lab is part of the full simulator: open it free for 7 days with a new account, then with a plan. It needs an account, which keeps your progress.
The scenario
A customer sends three prefixes. Write one inbound route-policy that raises the preference of the first and tags it, throws the second away and passes the rest.
Your role: an engineer in the provider’s network operations centre. Level: Advanced Done when: all 4 goals show as passed (100 points).
Network status
Devices: 2 routers, cabled as drawn. No Layer 1 or Layer 2 faults: every link is connected and up. A, B start with an empty configuration.
Known problems
The network worked and now does not: the scenario above says what users report. The cause is a configuration fault, not a cable. Find it with show commands (interfaces, routes, neighbours, running-config) before you change anything; fix only what is wrong.
Goals
B keeps 172.16.3.0/24 from A (20 pts) B drops 172.16.2.0/24 (25 pts) B prefers 172.16.1.0/24 with local preference 300 (30 pts) B tags 172.16.1.0/24 with community 65002:7 (25 pts)
The activity, in order
B keeps 172.16.3.0/24 from A On A advertise the three /24s and attach a pass policy both ways to the neighbour; on B attach policies too, or eBGP sends and keeps nothing.Why: Each goal is a state the lab can check on the running device. Verify with: show bgp B drops 172.16.2.0/24 Put 172.16.2.0/24 in a prefix-set and send it to drop in the inbound policy.Why: Each goal is a state the lab can check on the running device. Verify with: show bgp B prefers 172.16.1.0/24 with local preference 300 Match 172.16.1.0/24 with its own prefix-set and set local-preference 300.Why: Each goal is a state the lab can check on the running device. Verify with: show bgp 172.16.1.0/24 B tags 172.16.1.0/24 with community 65002:7 Define community-set CS with 65002:7 and add set community CS additive in the same branch.Why: Each goal is a state the lab can check on the running device. Verify with: show bgp 172.16.1.0/24
Tips
Work in the order given: later goals depend on the earlier ones. After every change, run the verify command before moving on; do not guess. Stuck? Read the verify output first. It names the interface, neighbour or route that is wrong.
Why this matters
A customer sends three prefixes. Write one inbound route-policy that raises the preference of the first and tags it, throws the second away and passes the rest.
What you will be able to do
B keeps 172.16.3.0/24 from A
B drops 172.16.2.0/24
B prefers 172.16.1.0/24 with local preference 300
B tags 172.16.1.0/24 with community 65002:7
The network
ASR 9001 — 2 devices in all, already cabled.
Gi0/0/0/0 Gi0/0/0/0 A B Drawn from this lab: devices, cables, ports and the addresses already set.
Device Model Address already set
A ASR 9001 configure it
B ASR 9001 configure it
Cabling
A Gi0/0/0/0 ↔ B Gi0/0/0/0
What is configured at the start
Nothing is configured to start with beyond the addresses above: you build the configuration from a clean start.
Tasks, and how each one is checked
Every task is decided by reading the live network — a neighbour in FULL, a ping that succeeds, a line in the running configuration — not by looking for a keyword you typed. The same command shows you what the lab sees.
# Task Pts How to verify it yourself
1 B keeps 172.16.3.0/24 from A 20 On B: show bgp output matches 172\.16\.3\.0/24.
2 B drops 172.16.2.0/24 25 On B: show bgp output matches 172\.16\.3\.0/24. and On B: show bgp output matches 172\.16\.2\.0/24 — it must not .
3 B prefers 172.16.1.0/24 with local preference 300 30 On B: show bgp 172.16.1.0/24 output matches localpref 300.
4 B tags 172.16.1.0/24 with community 65002:7 25 On B: show bgp 172.16.1.0/24 output matches 65002:7.
Stuck? Ask the coach
Tell the coach what you see or what you tried. It gives you a hint, not the answer, the way a senior engineer would. Included with a free trial or any plan.
Ask the coach
Reference solution
Try it yourself first — the lab checks your work either way. This is one configuration that makes every task pass, device by device:
A configure
interface GigabitEthernet0/0/0/0
ipv4 address 10.0.0.1 255.255.255.0
no shutdown
exit
interface Loopback1
ipv4 address 172.16.1.1 255.255.255.0
no shutdown
exit
interface Loopback2
ipv4 address 172.16.2.1 255.255.255.0
no shutdown
exit
interface Loopback3
ipv4 address 172.16.3.1 255.255.255.0
no shutdown
exit
route-policy P
pass
end-policy
router bgp 65001
bgp router-id 1.1.1.1
address-family ipv4 unicast
network 172.16.1.0/24
network 172.16.2.0/24
network 172.16.3.0/24
exit
neighbor 10.0.0.2
remote-as 65002
address-family ipv4 unicast
route-policy P in
route-policy P out
exit
exit
exit
commit
B configure
interface GigabitEthernet0/0/0/0
ipv4 address 10.0.0.2 255.255.255.0
no shutdown
exit
prefix-set ONE
172.16.1.0/24
end-set
prefix-set TWO
172.16.2.0/24
end-set
community-set CS
65002:7
end-set
route-policy IN
if destination in ONE then
set local-preference 300
set community CS additive
elseif destination in TWO then
drop
else
pass
endif
end-policy
route-policy OUT
pass
end-policy
router bgp 65002
bgp router-id 2.2.2.2
address-family ipv4 unicast
exit
neighbor 10.0.0.1
remote-as 65001
address-family ipv4 unicast
route-policy IN in
route-policy OUT out
exit
exit
exit
commit
Related labs
Where to start
The lessons are open to everyone, all guided labs are listed by track, and
plans explains what is free and what is not.
CCNA®, CCNP® and Cisco® are trademarks of Cisco Systems, Inc. zNetLaB is not affiliated with or endorsed by Cisco.
Try the simulator in your browser, no sign-up