Cisco – How does one specify certain IPs or MAC addresses for NBAR policy enforcement

ciscocisco-isrqosrouter

In an office environment, if I wanted to block youtube using a Cisco ISR router, I would set up the following with NBAR:

class-map match-all YOUTUBE
 match protocol http host "*youtube.com*"
!
policy-map DROP_YOUTUBE
 class YOUTUBE
   drop
!
interface FastEthernet0/0
 description TO INTERNET
 service-policy output DROP_YOUTUBE

This is a global configuration, but how does one tweak it so that it only applies to certain workstations (via IP or MAC addresses)?

Best Answer

You could create a second match condition in the class-map matching all source IP networks you want to block (with an ACL). Any requests to youtube.com from a source IP not matched by this ACL will not be dropped.