PBAR configuration example

Network requirements

As shown in Figure 177, configure PBAR on the router to recognize the HTTP packets sent by the host and destined for port 8080.

The router drops the packets recognized by PBAR.

Figure 172: Network diagram

Configuration procedure

# Create an application group named group1, and enter application group view.

<Router> system-view
[Router] app-group group1

# Add HTTP to the application group.

[Router-app-group-group1] include application http
[Router-app-group-group1] quit

# Map HTTP to TCP and port 8080.

[Router] port-mapping application http port 8080 protocol tcp

# Create a traffic class named classifier_1, and match group1 to the class.

[Router] traffic classifier classifier_1 
[Router-classifier-classifier_1] if-match app-group group1
[Router-classifier-classifier_1] quit

# Create a traffic behavior named bdeny, and configure the action as deny.

[Router] traffic behavior bdeny
[Router-behavior-bdeny] filter deny
[Router-behavior-bdeny] quit

# Create QoS policy 1, associate classifier_1 with traffic behavior bdeny to create a class-behavior association in the QoS policy.

[Router] qos policy 1
[Router-qospolicy-1] classifier classifier_1 behavior bdeny
[Router-qospolicy-1] quit

# Apply the QoS policy to the inbound direction of GigabitEthernet 1/0/1.

[Router] interface gigabitethernet 1/0/1
[Router-GigabitEthernet1/0/1] qos apply policy 1 inbound
[Router-GigabitEthernet1/0/1] quit

Verifying the configuration

# Verify that the host fails to establish an HTTP connection with the public network. (Details not shown.)