Hands-On Lab: Configuring NBAR2 for Application Visibility

This hands-on lab enables NBAR2 protocol discovery on a router interface, identifying application-layer traffic by signature rather than port number alone, then uses that classification directly within a QoS policy-map to prioritize a specific application.

NBAR2 Protocol DiscoveryApplication-Based Classificationmatch protocol Deep Packet Inspection

~4 دقیقه مطالعه · آخرین به‌روزرسانی ۴ مهر ۱۴۰۵

Lab Objective

Enable NBAR2 protocol discovery on an interface, review the resulting application breakdown of observed traffic, then configure a class-map matching a specific application by NBAR2 signature rather than port number, and apply QoS treatment based on that classification.

Lab Purpose

Every class-map covered throughout the QoS labs in this series matched traffic using ACLs, DSCP values, or simple protocol/port matches — none of which reliably identify an application that uses dynamic ports or disguises itself on a common port. NBAR2 performs deep packet inspection to identify the actual application by signature, enabling classification that port-based matching alone cannot achieve.

Lab Topology

R1 ---- Gi0/1 (WAN-facing interface)

Mixed traffic including a video conferencing
application using dynamic UDP ports that
change per session, making static port-based
ACL matching unreliable

Task 1: Enable NBAR2 Protocol Discovery

Enable protocol discovery on the WAN-facing interface to passively observe traffic composition.

Task 2: Generate Mixed Traffic Including the Video Application

Generate a variety of traffic types, including the video conferencing application using its dynamic ports.

Task 3: Review the Protocol Discovery Statistics

Examine the breakdown of identified applications and their bandwidth consumption.

Task 4: Create a Class-Map Matching the Video Application by NBAR2 Signature

Configure a class-map using match protocol referencing the specific application NBAR2 identified, rather than a port number.

Task 5: Apply Priority Treatment Based on This Classification

Configure a policy-map giving this NBAR2-classified traffic priority queuing, and verify it takes effect despite the application's dynamic port usage.

Solution and Verification

R1(config)# interface gigabitethernet0/1
R1(config-if)# ip nbar protocol-discovery

VideoApp-PC> [initiates a video conferencing
              session, negotiating dynamic
              UDP ports for the session]

R1# show ip nbar protocol-discovery interface gigabitethernet0/1

Protocol                Total       Input        Output
                         (packets)   (packets)    (packets)
webex-meeting            48210       24105        24105
http                     12403       6201         6202
unknown                  3204        1602         1602
-- NBAR2 correctly identified the video
-- conferencing application by signature
-- ("webex-meeting" in this example), despite
-- its use of dynamic UDP ports that would
-- defeat a static port-based ACL entirely

R1(config)# class-map match-all VIDEO-APP
R1(config-cmap)# match protocol webex-meeting

-- "match protocol" referencing the NBAR2
-- signature name, rather than "match
-- protocol udp" combined with a port range
-- that would need constant updating as the
-- application's dynamic ports shift

R1(config)# policy-map CBWFQ-POLICY
R1(config-pmap)# class VIDEO-APP
R1(config-pmap-c)# priority percent 15

-- Adding this to the existing LLQ policy
-- from the previous lab, alongside the
-- voice priority queue and CBWFQ classes
-- already configured

R1(config)# interface gigabitethernet0/1
R1(config-if)# service-policy output CBWFQ-POLICY

VideoApp-PC> [conducts another video call,
              negotiating a DIFFERENT set of
              dynamic UDP ports than before]

R1# show policy-map interface gigabitethernet0/1

    Class-map: VIDEO-APP
      Strict Priority
      (pkts matched/bytes matched) 38942/...
      (total drops) 0
-- The policy correctly matched and
-- prioritized this session too, despite
-- using an entirely different set of
-- dynamic ports than the earlier session
-- NBAR2 initially observed -- confirming
-- classification is based on the
-- application's actual signature, not any
-- specific port number

Key Takeaway

NBAR2's match protocol classification identifies traffic by its actual application-layer signature rather than by port number, making it uniquely capable of consistently classifying applications that use dynamic or non-standard ports — a capability every port-based or ACL-based class-map covered earlier in this series's QoS labs fundamentally lacks, since those approaches would require constant manual updates every time an application's port usage changed.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه