151
# Configure a QoS policy to mark the traffic from VPNA with local QoS ID 1.
<Router> system-view
[Router] traffic classifier any
[Router-classifier-any] if-match any
[Router] traffic behavior vpnA
[Router-behavior-vpnA] remark qos-local-id 1
[Router] qos policy vpnA
[Router-qospolicy-vpnA] classifier any behavior vpnA
[Router-qospolicy-vpnA] quit
# Configure a QoS policy to mark the traffic from VPNB with local QoS ID 2.
[Router] traffic behavior vpnB
[Router-behavior-vpnA] remark qos-local-id 2
[Router] qos policy vpnB
[Router-qospolicy-vpnB] classifier any behavior vpnB
[Router-qospolicy-vpnB] quit
# Apply the QoS policies to the incoming traffic of GigabitEthernet 2/1/0 and GigabitEthernet 2/1/1,
through which VPNA and VPNB are connected to the public network.
[Router] interface GigabitEthernet 2/1/0
[Router-GigabitEthernet2/1/0] qos apply policy vpnA inbound
[Router] interface GigabitEthernet 2/1/1
[Router-GigabitEthernet2/1/1] qos apply policy vpnB inbound
[Router-GigabitEthernet2/1/1] quit
# Configure traffic classes for the parent QoS policy, which is to be applied to the public network
interface, to match local QoS ID 1 and 2, respectively.
[Router] traffic classifier publicvpnA
[Router-classifier-publicvpnA] if-match qos-local-id 1
[Router-classifier-publicvpnA] quit
[Router] traffic classifier publicvpnB
[Router-classifier-publicvpnB] if-match qos-local-id 2
[Router-classifier-publicvpnB] quit
# Configure a class for the child QoS policy to match the voice traffic with MPLS EXP 7.
[Router] traffic classifier mplsvoice
[Router-classifier-mplsvoice] if-match mpls-exp 7
[Router-classifier-mplsvoice] quit
# Configure traffic behaviors for the child QoS policy, and configure EF to guarantee 4 Mbps and 3
Mbps of bandwidth.
[Router] traffic behavior vpnAvoice
[Router-behavior-vpnAvoice] queue ef bandwidth 4000
[Router-behavior-vpnAvoice] quit
[Router] traffic behavior vpnBvoice
[Router-behavior-vpnBvoice] queue ef bandwidth 3000
[Router-behavior-vpnBvoice] quit
# Associate the traffic behavior with the corresponding traffic class in each child QoS policy.
[Router] qos policy vpnAvoice
[Router-qospolicy-vpnAvoice] classifier mplsvoice behavior vpnAvoice
[Router-qospolicy-vpnAvoice] quit
[Router] qos policy vpnBvoice
[Router-qospolicy-vpnBvoice] classifier mplsvoice behavior vpnBvoice