Advanced CCIE Routing & Switching: Vol-Ii
Advanced CCIE Routing & Switching: Vol-Ii
Advanced CCIE Routing & Switching: Vol-Ii
Narbik Kocharians
CCIE #12410
R&S, Security, SP
VOL-II
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 1 of 48
2012 Narbik Kocharians. All rights reserved
Table of Content:
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 2 of 48
2012 Narbik Kocharians. All rights reserved
Table of Content:
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 3 of 48
2012 Narbik Kocharians. All rights reserved
Lab 17 Regular Expressions 788 Vol-I
Lab 18 Adv BGP Configurations 805 Vol-I
Lab 19 Administrative Distance 816 Vol-I
Lab 20 BGP Confederation 824 Vol-I
Lab 21 BGP Hiding Local AS Number 829 Vol-I
Lab 22 BGP Allowas-in 837 Vol-I
Policy Based Routing
Lab 1 PBR based on Source IP address 843 Vol-I
Redistribution
Lab 1 Basics of Redistribution-I 854 Vol-I
Lab 2 Basics of Redistribution-II 874 Vol-I
Lab 3 Advanced Redistribution 890 Vol-I
Lab 4 Routing Loops 919 Vol-I
IP SLA
Lab 1 IP SLA 938 Vol-I
Lab 2 Reliable Static Routing using IP SLA 944 Vol-I
Lab 3 Reliable Conditional Default Route 951 Vol-I
Injection using IP SLA
Lab 4 Object Tracking in HSRP Using SLA 964 Vol-I
Lab 5 Object Tracking 974 Vol-I
GRE Tunnels
Lab 1 Basic Configuration of GRE Tunnels 988 Vol-I
Lab 2 Configuration of GRE Tunnels II 1000 Vol-I
Lab 3 Configuration of GRE Tunnels III 1010 Vol-I
Lab 4 GRE & Recursive loops 1017 Vol-I
QOS
Lab 1 MLS QOS 14 Vol-II
Lab 2 DSCP Mutation 30 Vol-II
Lab 3 DSCP-CoS Mapping 38 Vol-II
Lab 4 CoS-DSCP Mapping 43 Vol-II
Lab 5 IP-Precedence-DSCP Mapping 49 Vol-II
Lab 6 Individual rate Policing 54 Vol-II
Lab 7 Policed DSCP 60 Vol-II
Lab 8 Aggregate Policer 65 Vol-II
Lab 9 Priority Queuing 70 Vol-II
Lab 10 Custom Queuing 76 Vol-II
Lab 11 WFQ 80 Vol-II
Lab 12 RSVP 84 Vol-II
Lab 13 Match Access-group 90 Vol-II
Lab 14 Match Destination & Source Add MAC 95 Vol-II
Lab 15 Match Input-Interface 101 Vol-II
Lab 16 Match FR-de & Packet Length 104 Vol-II
Lab 17 Match IP Precedence vs. Match Precedence 112 Vol-II
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 4 of 48
2012 Narbik Kocharians. All rights reserved
Lab 18 Match Protocol HTTP URL, MIME & Host 123 Vol-II
Lab 19 Match Fr-dlci 131 Vol-II
Lab 20 Frame-Relay Traffic Shaping 135 Vol-II
Lab 21 Frame-Relay Traffic-shaping II 142 Vol-II
Lab 22 Frame-Relay Fragmentation 151 Vol-II
Lab 23 Frame-Relay PIPQ 155 Vol-II
Lab 24 Frame-Relay DE 162 Vol-II
Lab 25 Frame-Relay and Compression 165 Vol-II
Lab 26 CBWFQ 178 Vol-II
Lab 27 CBWFQ II 184 Vol-II
Lab 28 Converting Custom Queuing to CBWFQ 186 Vol-II
Lab 29 LLQ 189 Vol-II
Lab 30 CAR 193 Vol-II
Lab 31 Class Based Policing I 200 Vol-II
Lab 32 CB Policing II 210 Vol-II
Lab 33 WRED & CB WRED 215 Vol-II
NAT
Lab 1 Static NAT Configuration 221 Vol-II
Lab 2 Advanced Static NAT Configuration 227 Vol-II
Lab 3 Configuration of Dynamic NAT I 231 Vol-II
Lab 4 Configuration of Dynamic NAT II 234 Vol-II
Lab 5 Configuration of Dynamic NAT III 237 Vol-II
Lab 6 NAT and Load Balancing 241 Vol-II
Lab 7 Configuring PAT 244 Vol-II
Lab 8 Configuring PAR 249 Vol-II
Lab 9 Configuring Static NAT Redundancy W/HSRP 253 Vol-II
Lab 10 Stateful Translation Failover With HSRP 258 Vol-II
Lab 11 Translation of the Outside Source 264 Vol-II
Lab 12NAT on a Stick 267 Vol-II
IP Services
Lab 1 DHCP Configuration 273 Vol-II
Lab 2 HSRP Configuration 277 Vol-II
Lab 3 VRRP Configuration 286 Vol-II
Lab 4 GLBP Configuration 293 Vol-II
Lab 5 IRDP Configuration 305 Vol-II
Lab 6 Configuring DRP 312 Vol-II
Lab 7 Configuring WCCP 314 Vol-II
Lab 8 Core Dump Using FTP 315 Vol-II
Lab 9 HTTP Connection Management 317 Vol-II
Lab 10 Configuring NTP 320 Vol-II
Lab 11 More IP Stuff 329 Vol-II
IP Prefix-List
Lab 1 Prefix-Lists 337 Vol-II
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 5 of 48
2012 Narbik Kocharians. All rights reserved
IPv6
Lab 1 Configuring Basic IPv6 364 Vol-II
Lab 2 Configuring OSPFv3 385 Vol-II
Lab 3 Configuring OSPFv3 Multi-Area 394 Vol-II
Lab 4 Summarization of Internal & External N/W 399 Vol-II
Lab 5 OSPFv3 Stub, T/Stub and NSSA networks 408 Vol-II
Lab 6 OSPFv3 Cost and Auto-cost 420 Vol-II
Lab 7 Tunneling IPv6 Over IPv4 426 Vol-II
Lab 8 Eigrp and IPv6 452 Vol-II
Security
Lab 1 Basic Router Security Configuration 477 Vol-II
Lab 2 Standard Named Access List 484 Vol-II
Lab 3 Controlling Telnet Access and SSH 488 Vol-II
Lab 4 Extended Access List IP and ICMP 495 Vol-II
Lab 5 Extended Access List OSPF & Eigrp 501 Vol-II
Lab 6 Using MQC as a Filtering tool 505 Vol-II
Lab 7 Extended Access List With Established 509 Vol-II
Lab 8 Dynamic Access List 512 Vol-II
Lab 9 Reflexive Access-Lists 522 Vol-II
Lab 10 Access-list & Time Range 529 Vol-II
Lab 11 Configuring Basic CBAC 533 Vol-II
Lab 12 Configuring CBAC 535 Vol-II
Lab 13 Configuring CBAC & Java Blocking 542 Vol-II
Lab 14 Configuring PAM 544 Vol-II
Lab 15 Configuring uRPF 546 Vol-II
Lab 16 Configuring Zone Based Firewall 552 Vol-II
Lab 17 Control Plane Policing 559 Vol-II
Lab 18 Configuring IOS IPS 566 Vol-II
Lab 19 Attacks 576 Vol-II
Lab 20 AAA Authentication 587 Vol-II
Multicasting
Lab 1 Configuring IGMP 592 Vol-II
Lab 2 Dense Mode 610 Vol-II
Lab 3 Static RP Configuration 628 Vol-II
Lab 4 Auto-RP 643 Vol-II
Lab 5 Auto-RP Filtering & Listener 665 Vol-II
Lab 6 Configuring BSR 687 Vol-II
Lab 7 Configuring MSDP 702 Vol-II
Lab 8 Anycast RP 720 Vol-II
Lab 9 MSDP/MP-BGP 730 Vol-II
Lab 10 Configuring SSM 749 Vol-II
Lab 11 Helper-Map 760 Vol-II
Lab 12 Bidirectional PIM 767 Vol-II
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 6 of 48
2012 Narbik Kocharians. All rights reserved
MPLS & L3VPNs
Lab 1 Configuring Label Distribution Protocol 785 Vol-II
Lab 2 Static & RIPv2 Routing in a VPN 855 Vol-II
Lab 3 OSPF Routing in a VPN 886 Vol-II
Lab 4 Backdoor links & OSPF 905 Vol-II
Lab 5 Eigrp Routing in a VPN 921 Vol-II
Lab 6 BGP Routing in a VPN 937 Vol-II
Lab 7 Complex VPNs and Filters 954 Vol-II
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 7 of 48
2012 Narbik Kocharians. All rights reserved
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 8 of 48
2012 Narbik Kocharians. All rights reserved
The Serial connection between R1 and R3
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 9 of 48
2012 Narbik Kocharians. All rights reserved
Frame-Relay Switch connections
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 10 of 48
2012 Narbik Kocharians. All rights reserved
Frame-Relay DLCI connections:
www.MicronicsTraining.com
Narbik Kocharians
CCIE #12410
R&S, Security, SP
QOS
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 13 of 48
2012 Narbik Kocharians. All rights reserved
Lab 1 MLS QOS
Lab Setup:
You can copy and paste the initial configurations from the init directory
IP addressing:
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 14 of 48
2012 Narbik Kocharians. All rights reserved
Task 1
On Switch 1
SW1(config)#int range f0/3-18 , f0/20-24
SW1(config-if-range)#shut
On Switch 2
SW2(config)#int range f0/1-2 , f0/4-18 , f0/20-24
SW2(config-if-range)#shut
Task 2
Configure SW1s port F0/2 such that it marks all ingress traffic with a CoS marking of 2,
do not configure MQC for this purpose. For verification purposes, R3 should be
configured to match on CoS values of 0 7 ingress on its F0/1.100 subinterface.
In this step, R3 is configured to match on incoming CoS values of 0 7, this is done so the policy can be
tested and verified.
On R3:
R3(config)#class-map cos0
R3(config-cmap)#match cos 0
R3(config)#class-map cos1
R3(config-cmap)#match cos 1
R3(config)#class-map cos2
R3(config-cmap)#match cos 2
R3(config)#class-map cos3
R3(config-cmap)#match cos 3
R3(config)#class-map cos4
R3(config-cmap)#match cos 4
R3(config)#class-map cos5
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 15 of 48
2012 Narbik Kocharians. All rights reserved
R3(config-cmap)#match cos 5
R3(config)#class-map cos6
R3(config-cmap)#match cos 6
R3(config)#class-map cos7
R3(config-cmap)#match cos 7
R3(config)#policy-map TST
R3(config-pmap)#class cos0
R3(config-pmap)#class cos1
R3(config-pmap)#class cos2
R3(config-pmap)#class cos3
R3(config-pmap)#class cos4
R3(config-pmap)#class cos5
R3(config-pmap)#class cos6
R3(config-pmap)#class cos7
R3(config)#int f0/1.100
R3(config-subif)#service-policy in TST
On SW1
By default, QOS is disabled and the switch will NOT modify the CoS, IP-Precedence, or the DSCP
values of received traffic. To verify:
QoS is disabled
QoS ip packet dscp rewrite is enabled
The following command enables mls QoS; to perform any kind of QoS configuration, MLS QoS must
be enabled.
SW1(config)#mls qos
On SW1
SW1#Show mls qos
QoS is enabled
QoS ip packet dscp rewrite is enabled
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 16 of 48
2012 Narbik Kocharians. All rights reserved
To continue with the configuration:
SW1(config)#int f0/2
The following command assigns a default CoS value of 2 to untagged traffic received through this
interface.
On SW1
SW1#Show mls qos inter f0/2
FastEthernet0/2
trust state: not trusted
trust mode: not trusted
trust enabled flag: ena
COS override: dis
default COS: 2
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: none
qos mode: port-based
On R2:
R2#Ping 10.1.1.3
On R3:
R3#Show policy-map interface | s cos0
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 17 of 48
2012 Narbik Kocharians. All rights reserved
4 packets, 472 bytes
5 minute offered rate 0 bps
Match: cos 0
The mls qos cos command on its own does NOTHING. It should be combined with either mls qos
cos override or mls qos trust cos. When it is combined with MLS qos trust cos, ONLY the
untagged traffic is effected, but if it is combined with mls qos cos override, then, all traffic (tagged or
untagged) is effected.
NOTE: Even though the interface is configured with mls qos cos 2 the traffic coming in on that
interface is NOT effected. To mark ALL traffic with a CoS marking of 2, which means all traffic
regardless of their markings, the port must be configured to override the existing CoS.
The following command configures the switch port to trust the CoS value in ALL incoming untagged
traffic through F0/2 interface. The mls qos cos override command will be tested later:
SW1(config)#int f0/2
SW1(config-if)#mls qos trust cos
On SW1
SW1#Sh mls qos interface f0/2
FastEthernet0/2
trust state: trust cos
trust mode: trust cos
trust enabled flag: ena
COS override: dis
default COS: 2
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: none
qos mode: port-based
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 18 of 48
2012 Narbik Kocharians. All rights reserved
On R3:
R3#Clear counters
Clear "show interface" counters on all interfaces [confirm]
On R2:
R2#Ping 10.1.1.3
On R3:
R3#Sh policy-map inter | s cos0
NOTE: The output of the above show command reveals that all traffic (in this case untagged) that is
sourced from R2 is marked with a CoS value of 2. However, tagged traffic will retain its CoS marking.
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 19 of 48
2012 Narbik Kocharians. All rights reserved
Task 3
On SW1
SW1(config)#default inter f0/1
SW1(config)#int f0/2
SW1(config-if)#no mls qos trust cos
SW1(config-if)#no mls qos cos 2
SW1(config)#int f0/1
SW1(config-if)#swi trunk enc do
SW1(config-if)#swi mode trunk
SW1(config-if)#no shut
On SW1
SW1#Show int trunk
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 20 of 48
2012 Narbik Kocharians. All rights reserved
Port Vlans allowed and active in management domain
Fa0/1 1,100
Fa0/19 1,100
On R1:
R1(config)#default inter f0/0
R1(config-if)#int f0/0.100
R1(config-subif)#encap dot1q 100
R1(config-subif)#ip addr 10.1.1.1 255.255.255.0
R1(config)#policy-map TST
R1(config-pmap)#class class-default
R1(config-pmap-c)#set cos 6
R1(config-pmap-c)#int F0/0.100
R1(config-subif)#service-policy out TST
On R3:
R3#Clear counters
On R1:
R1#Ping 10.1.1.3 rep 60
On R3:
R3#Sh policy-map inter | s cos6
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 21 of 48
2012 Narbik Kocharians. All rights reserved
60 packets, 7080 bytes
5 minute offered rate 0 bps
Match: cos 6
Note: All traffic generated by R1 has a CoS marking of 6. The traffic retained its CoS marking because
the mls qos command is NOT configured.
Task 4
Enable mls qos on SW1 and configure SW1 to trust the CoS marking of any traffic
coming through its F0/1 interface.
On SW1
SW1(config)#mls qos
If ONLY mls qos was configured on SW1, and R1 was generating traffic with a CoS marking of 6,
the switch (SW1) will drop the CoS marking and R3 will see all traffic generated by R1 with a CoS
value of 0. If the F0/1 interface of SW1 is configured to trust CoS, when the switch receives the
traffic, it will NOT rewrite or drop the layer two marking. The switch will also consult the CoS-to-
DSCP mapping. Since SW1s default CoS-to-DSCP mapping is NOT changed, and by default it maps
CoS 0 to DSCP 0, R3 will also see a DSCP value of 0 in the ToS byte of all incoming traffic from R1.
SW1(config)#int f0/1
SW1(config-if)#mls qos trust cos
On R3:
R3#Clear counters
On R1:
R1#Ping 10.1.1.3 repeat 60
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 22 of 48
2012 Narbik Kocharians. All rights reserved
On R3:
R3#Show policy-map interface | s cos6
Task 5
Configure SW1 using the following policy:
1. All ingress untagged traffic from R1 should be marked with a CoS value of 1.
2. All ingress tagged traffic from R1 should retain its CoS value of 6.
3. All ingress traffic (tagged or untagged) from R2 should be marked with a CoS
value of 3.
On SW1
SW1(config)#int f0/1
SW1(config-if)#mls qos trust cos
SW1(config-if)#mls qos cos 1
On R3:
R3#Clear counter
On R1:
R1#Ping 10.1.1.3 rep 10
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 23 of 48
2012 Narbik Kocharians. All rights reserved
!!!!!!!!!!
Success rate is 100 percent (10/10), round-trip min/avg/max = 1/1/4 ms
On R3:
Since the traffic generated by R1 was tagged meaning that it contains the VLAN-ID, it retained its
marking.
Let us configure R1 so that it generates untagged traffic so we can test the first item in the task. This is
done for testing purpose ONLY:
On R1:
R1(config)#int f0/0.100
R1(config-subif)#encapsulation dot1q 100 NATIVE
The above command will pop the VLAN-ID and traffic will be sent in its native form.
On SW1
SW1(config)#int f0/1
SW1(config-if)#switchport trunk native vlan 100
If the above command is NOT configured on the F0/1 interface of SW1, the traffic generated by R1 will
belong to VLAN 1 (the default VLAN) and NOT VLAN 100.
On R3:
R3#Clear counter
On R1:
R1#Ping 10.1.1.3 rep 100
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 24 of 48
2012 Narbik Kocharians. All rights reserved
Sending 100, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/1/4 ms
On R3:
R3#Show policy-map interface | s cos6
To configure item 3; remember that R2 is NOT configured to mark its egress traffic:
On SW1
SW1(config)#int f0/2
SW1(config-if)#mls qos cos 3
SW1(config-if)#mls qos cos override
On R3:
R3#Clear counter
On R2:
R2#Ping 10.1.1.3 rep 30
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 25 of 48
2012 Narbik Kocharians. All rights reserved
On R3:
R3#Show policy-map interface | s cos3
To test tagged and untagged traffic; the following configures R2 with an F0/0.100
subinterface for VLAN 100 marking all outbound traffic with a CoS value of 7.
On R2:
R2(config)#default inter f0/0
R2(config-if)#int f0/0.100
R2(config-subif)#encap dot1q 100
R2(config-subif)#ip address 10.1.1.2 255.255.255.0
R2(config)#policy-map tst
R2(config-pmap)#class class-default
R2(config-pmap-c)#set cos 7
R2(config-pmap-c)#int f0/0.100
R2(config-subif)#service-policy output tst
On SW1
SW1(config)#int f0/2
SW1(config-if)#swi trunk encap dot
SW1(config-if)#swi mode trunk
SW1(config-if)#no swi acc v 100
On SW1
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 26 of 48
2012 Narbik Kocharians. All rights reserved
SW1#Show run int f0/2 | b inter
interface FastEthernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
mls qos cos 3
mls qos cos override
On R3:
R3#Clear counter
On R2:
R2#Ping 10.1.1.3 rep 33
On R3:
R3#Show policy-map interface | s cos3
On R2:
R2(config)#int f0/0.100
R2(config-subif)#encap dot1q 100 NATIVE
On SW1
SW1(config)#int f0/2
SW1(config-if)#swi trun nat vlan 100
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 27 of 48
2012 Narbik Kocharians. All rights reserved
On R3:
R3#Clear counter
On R2:
R2#Ping 10.1.1.3 rep 30
On R3:
R3#Show policy-map interface | s cos3
Reconfigure the F0/0 interfaces of R1, R2, and SW1s F0/1 and F0/2 interfaces such that
they resemble the following:
On R1:
interface FastEthernet0/0.100
encapsulation dot1Q 100 native
ip address 10.1.1.1 255.255.255.0
service-policy output TST
policy-map TST
class class-default
set cos 6
On R2:
interface FastEthernet0/0
ip address 10.1.1.2 255.255.255.0
On SW1
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 28 of 48
2012 Narbik Kocharians. All rights reserved
SW1#Show run int f0/1 | b interface
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport trunk native vlan 100
switchport mode trunk
mls qos cos 1
mls qos trust cos
end
Task 6
SW2 should be configured such that it marks all traffic from any of the routers connected
to SW1 (tagged or untagged) with a CoS value of 5. DO NOT configure R1, R2, or SW1
to accomplish this task.
Based on the existing configuration, untagged traffic from R1 is marked with a CoS value of 1,
whereas, tagged traffic from R1 is marked with a CoS value of 6. All traffic from R2 (tagged or
untagged) is marked with a CoS value of 3.
On R3:
R3#Clear counters
On SW2
SW2(config)#mls qos
NOTE: The mls qos command will drop the CoS marking in all traffic; this means that traffic
generated by R1 or R2 will be marked with a CoS value of 0.
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 29 of 48
2012 Narbik Kocharians. All rights reserved
On R1:
R1#Ping 10.1.1.3 rep 60
On R2:
R2#Ping 10.1.1.3 rep 70
On R3:
R3#Show policy-map interface | s cos6|cos7|cos0
Let us configure the task and mark all traffic ingress to SW2 with a CoS marking of 5:
On SW2
SW2(config)#int f0/19
SW2(config-if)#mls qos cos 5
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 30 of 48
2012 Narbik Kocharians. All rights reserved
SW2(config-if)#mls qos cos override
On R3:
R3#Clear counters
On R1:
R1#Ping 10.1.1.3 rep 60
On R2:
R2#Ping 10.1.1.3 rep 70
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (70/70), round-trip min/avg/max = 1/1/4 ms
On R3:
R3#Show policy-map interface | s cos6|cos7|cos0
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 31 of 48
2012 Narbik Kocharians. All rights reserved
Match: cos 7
NOTE: All traffic regardless of their markings are marked with a CoS value of 5. Therefore, if these
commands are used on a trunk link, all traffic will be affected regardless of their marking or Vlan.
Task 7
Erase the startup configuration On R1-3 and SW1 & SW2 and the Vlan.Dat of the two
switches and reload these devices before proceeding to the next lab.
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 32 of 48
2012 Narbik Kocharians. All rights reserved
Lab 2 DSCP-Mutation
Lab Setup:
Copy and paste the initial configuration from the init directory
Task 1
Configure an MQC On R1 such that all packets going out of its F0/0 interface are marked
with a DSCP value of 1. For verification purposes, R3s F0/1 interface should be
configured to match on DSCP values of 0-7 for all ingress traffic. Ensure that mls qos
is disabled on both switches.
On both switches:
QoS is disabled
QoS ip packet dscp rewrite is enabled
The following configuration marks all egress traffic with a DSCP value of 1:
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 33 of 48
2012 Narbik Kocharians. All rights reserved
On R1:
R1(config)#policy-map TST
R1(config-pmap)#class class-default
R1(config-pmap-c)#set ip dscp 1
R1(config)#int f0/0
R1(config-if)#service-policy out TST
On R3:
R3(config)#class-map dscp0
R3(config-cmap)#match ip dscp 0
R3(config)#class-map dscp1
R3(config-cmap)#match ip dscp 1
R3(config)#class-map dscp2
R3(config-cmap)#match ip dscp 2
R3(config)#class-map dscp3
R3(config-cmap)#match ip dscp 3
R3(config)#class-map dscp4
R3(config-cmap)#match ip dscp 4
R3(config)#class-map dscp5
R3(config-cmap)#match ip dscp 5
R3(config)#class-map dscp6
R3(config-cmap)#match ip dscp 6
R3(config)#class-map dscp7
R3(config-cmap)#match ip dscp 7
R3(config)#policy-map TST
R3(config-pmap)#class dscp0
R3(config-pmap)#class dscp1
R3(config-pmap)#class dscp2
R3(config-pmap)#class dscp3
R3(config-pmap)#class dscp4
R3(config-pmap)#class dscp5
R3(config-pmap)#class dscp6
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 34 of 48
2012 Narbik Kocharians. All rights reserved
R3(config-pmap)#class dscp7
R3(config)#int f0/1
R3(config-if)#service-policy in TST
On R1:
R1#Ping 10.1.1.3 rep 10
On R3:
R3#Sh policy-map inter | s dscp1
Task 2
Configure SW2 such that if the incoming traffic is marked with a DSCP value of 1, it is
overwritten to a DSCP value of 60. DO NOT configure a class-map or a policy-map to
accomplish this task. Use R3 to verify the configuration.
DSCP-Mutation can be configured on SW2 to accomplish this task; there are four steps in configuring
DSCP-mutation, and they are as follows:
Step 1:
On SW2
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 35 of 48
2012 Narbik Kocharians. All rights reserved
SW2(config)#mls qos
Remember, once the mls qos is enabled, the marking of all traffic is zeroed out, meaning that
incoming traffic that is marked with any DSCP value will match to DSCP value of 0 On R3:. The
following proves this point:
On SW2
SW2#Show mls qos
QoS is enabled
QoS ip packet dscp rewrite is enabled
On R3
R3#Clear counter
On R1:
R1#Ping 10.1.1.3 rep 100
On R3:
R3#Sh policy-map inter | s dscp1
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 36 of 48
2012 Narbik Kocharians. All rights reserved
Step 2:
Remember, if mls qos trust dscp is NOT configured, this configuration will NOT have any effect on
the packets, because SW2 will drop the marking of the incoming traffic. To verify this information:
On SW2
SW2(config)#int f0/19
SW2(config-if)#mls qos trust dscp
On SW2
SW2#Show mls qos int f0/19 | inc trust state
NOTE: If CoS was trusted, the output of the above command would have stated trust state: trust
CoS, since ONLY DSCP is trusted, the trust state is DSCP.
On R3:
R3#Clear counters
On R1:
R1#Ping 10.1.1.3 rep 100
On R3:
R3#Sh policy-map inter | s dscp0
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 37 of 48
2012 Narbik Kocharians. All rights reserved
R3#Sh policy-map inter | s dscp1
Step 3:
In this step, a custom DSCP-Mutation map is configured. Remember that if this custom mapping is
NOT configured, the default DSCP-Mutation map will be used. The default DSCP-Mutation map
cannot be changed and it is configured as one to one, meaning that the incoming DSCP value will
always match the outgoing DSCP value.
In this step, a custom DSCP-Mutation map named TST is configured. This custom DSCP-Mutation
map maps the incoming DSCP value (in this case 1) to an outgoing DSCP value of 60:
Note the d1: column (highlighted in yellow) specifies the most significant digit of the DSCP value of
incoming packets, whereas, the d2: row (highlighted in blue) specifies the least significant digit of the
DSCP value of incoming packets.
The intersection of the d1 and d2 values (this is the body of the output highlighted in green) provides
the DSCP value of the outgoing packets.
NOTE: The output of the above show command reveals that by default, the incoming DSCP value of 1,
is re-written to the outgoing DSCP value of 1.
Lets configure a custom DSCP-Mutation map called TST that maps the incoming DSCP value of 1
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 38 of 48
2012 Narbik Kocharians. All rights reserved
SW2(config)#mls qos map dscp-mutation TST 1 to 60
On SW2
SW2#Show mls qos map dscp-mutation TST
Once the custom DSCP-Mutation map is configured, it must be applied to the F0/19 interface (trunk
interface) of SW2.
SW2(config)#int f0/19
SW2(config-if)#mls qos dscp-mutation TST
On SW2
SW2#Show mls qos int f0/19 | inc DSCP
Step 4:
In the final step of this configuration, you MUST ensure that DSCP re-writes are enabled. If this is
disabled, then the DSCP marking will NOT be re-written. Lets verify this information:
On SW2
SW2#Show mls qos
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 39 of 48
2012 Narbik Kocharians. All rights reserved
QoS is enabled
QoS ip packet dscp rewrite is enabled
By default, DSCP rewrites are enabled ONLY if mls qos is enabled. Lets test and see if the incoming
DSCP value of 1 is rewritten to a DSCP value of 60:
On R3, we need to match on DSCP 60 so we can test and verify the configuration:
On R3:
R3(config)#class-map dscp60
R3(config-cmap)#match ip dscp 60
R3(config)#policy-map TST
R3(config-pmap)#class dscp60
On R1:
R1#Ping 10.1.1.3 rep 60
On R3:
R3#Sh policy-map inter | s dscp60
On SW2
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 40 of 48
2012 Narbik Kocharians. All rights reserved
On SW2
QoS is enabled
QoS ip packet dscp rewrite is disabled
On R3:
R3#Clear counters
On R1:
R1#Ping 10.1.1.3 rep 10
On R3:
R3#Sh policy-map inter | s dscp1
On SW2
SW2(config)#mls qos rewrite ip dscp
Task 3
Erase the startup configuration On R1-3 and SW1 & SW2 and the Vlan.Dat of the two
switches and reload these devices before proceeding to the next lab.
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 41 of 48
2012 Narbik Kocharians. All rights reserved
Lab 3 DSCP-CoS Mapping
Lab Setup:
You can copy and paste the initial configuration from the init directory
Task 1
For testing and verification of this lab, configure R3 to match on incoming CoS markings
of 0-7 using an MQC; this policy should be applied inbound to R3s F0/1.100
subinterface.
On R3:
R3(config)#class-map cos0
R3(config-cmap)#match cos 0
R3(config)#class-map cos1
R3(config-cmap)#match cos 1
R3(config)#class-map cos2
R3(config-cmap)#match cos 2
R3(config)#class-map cos3
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 42 of 48
2012 Narbik Kocharians. All rights reserved
R3(config-cmap)#match cos 3
R3(config)#class-map cos4
R3(config-cmap)#match cos 4
R3(config)#class-map cos5
R3(config-cmap)#match cos 5
R3(config)#class-map cos6
R3(config-cmap)#match cos 6
R3(config)#class-map cos7
R3(config-cmap)#match cos 7
R3(config)#policy-map TST
R3(config-pmap)#class cos0
R3(config-pmap)#class cos1
R3(config-pmap)#class cos2
R3(config-pmap)#class cos3
R3(config-pmap)#class cos4
R3(config-pmap)#class cos5
R3(config-pmap)#class cos6
R3(config-pmap)#class cos7
R3(config)#int f0/1.100
R3(config-subif)#service-policy in TST
Task 2
Configure R1 such that it marks all outgoing traffic with a DSCP value of 5.
On R1:
R1(config)#policy-map TST
R1(config-pmap)#class class-default
R1(config-pmap-c)#set ip dscp 5
R1(config)#int f0/0
R1(config-if)#service-policy out TST
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 43 of 48
2012 Narbik Kocharians. All rights reserved
Task 3
Configure SW2 such that it maps the DSCP value of 5 in incoming packets to a CoS
value of 6.
Before configuring this task, the default DSCP-CoS mapping should be displayed, using the following
command:
On SW2
SW2#Sh mls qos map dscp-cos
Dscp-cos map:
d1 : d2 0 1 2 3 4 5 6 7 8 9
---------------------------------------
0 : 00 00 00 00 00 00 00 00 01 01
1 : 01 01 01 01 01 01 02 02 02 02
2 : 02 02 02 02 03 03 03 03 03 03
3 : 03 03 04 04 04 04 04 04 04 04
4 : 05 05 05 05 05 05 05 05 06 06
5 : 06 06 06 06 06 06 07 07 07 07
6 : 07 07 07 07
Note the output of the above show command displays the default DSCP to CoS mapping, it means that
if the mls qos trust dscp command is configured, then the DSCP marking of incoming packets are
mapped to outgoing CoS value according to the DSCP-CoS map.
The incoming DSCP values are shown in the d1 column and the d2 row, whereas, the outgoing CoS
values are identified in the body of this display, this is the intersection of the d1 column and the d2 row.
NOTE: By default every eight DSCP values are mapped to a single CoS value. This mapping can affect
the entire switch, and a custom mapping cannot be configured.
By default, an incoming DSCP value of 5 is rewritten to an outgoing CoS value of 0. To accomplish this
task, we have to modify this mapping so the incoming DSCP value of 5 is rewritten to an outgoing CoS
value of 6.
The following command MUST be configured, so the incoming DSCP values are trusted. If this is NOT
configured, the incoming DSCP values will NOT be rewritten to an outgoing CoS value.
On SW2
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 44 of 48
2012 Narbik Kocharians. All rights reserved
SW2(config)#mls qos
SW2(config)#int f0/19
SW2(config-if)#mls qos trust dscp
On SW2
SW2#Show mls qos int f0/19 | inc trust state
On R1:
R1#Ping 10.1.1.3 repeat 60
On R3:
R3#Sh policy-map interface | s cos0
Note: DSCP 5 is mapped to a CoS value of 0, this is because of the default mapping that is in use.
In the next step the default DSCP-CoS mapping is changed to map an incoming DSCP value of 5 to an
outgoing CoS value of 6:
On SW2
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 45 of 48
2012 Narbik Kocharians. All rights reserved
SW2(config)#mls qos map dscp-cos 5 to 6
NOTE: The first value (5) is the DSCP value in the incoming packets and the second value (6) is the
CoS value in the outgoing packets.
On R3:
R3#Clear counters
On R1:
R1#Ping 10.1.1.3 repeat 60
On R3:
Note: incoming packets that have a marking of DSCP 5 are mapped to an outgoing CoS value of 6 and
NOT 0:
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 46 of 48
2012 Narbik Kocharians. All rights reserved
Question:
What happened to the incoming DSCP value? Was it dropped all together?
Answer:
The best man to explain this is Mr. IOS, lets test:
On R3
R3(config)#class-map d5
R3(config-cmap)#match ip dscp 5
R3(config)#int f0/1.100
R3(config-subif)#No service-policy in tst
R3(config)#Policy-map tst
R3(config-pmap)#No class c6
R3(config-pmap)#class d5
R3(config)#Int f0/1.100
R3(config-subif)#service-policy in tst
R3#Clear counter
On R1
R1#Ping 10.1.1.3 rep 100
On R3
R3#Show policy-map interface | s d5
Class-map: d5 (match-all)
100 packets, 11800 bytes
5 minute offered rate 2000 bps
Match: ip dscp 5
Lets remove the d5 and add c6 which matches CoS value of 6 back in:
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 47 of 48
2012 Narbik Kocharians. All rights reserved
On R3
R3(config)#Int F0/1.100
R3(config-subif)#No service-policy in tst
R3(config)#Policy-map tst
R3(config-pmap)#No class d5
R3(config-pmap)#class c6
R3(config)#Int F0/1.100
R3(config-subif)#service-policy in tst
On R1
R1#Ping 10.1.1.3 rep 60
On R3
R3#Show policy-map interface | s c6
Class-map: c6 (match-all)
60 packets, 7080 bytes
5 minute offered rate 0 bps
Match: cos 6
So we can clearly see that the DSCP value was not changed at all, but the in the
layer 2 encapsulation, the CoS value was changed to 6
Task 4
Erase the startup configuration On R1-3 and SW1 & SW2 and the Vlan.Dat of the two
switches and reload these devices before proceeding to the next lab.
CCIE R&S by Narbik Kocharians Advanced CCIE R&S Work Book 4.0 Page 48 of 48
2012 Narbik Kocharians. All rights reserved