H3C MSR1000[2600][3600] Routers Configuration Examples All-in-One-R9141-6W100

HomeSupportConfigure & DeployConfiguration ExamplesH3C MSR1000[2600][3600] Routers Configuration Examples All-in-One-R9141-6W100
Table of Contents
Related Documents
65-Traffic Accounting Configuration Examples
Title Size Download
65-Traffic Accounting Configuration Examples 197.83 KB

H3C Routers

Traffic Accounting Configuration Examples

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2024 New H3C Technologies Co., Ltd. All rights reserved

No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.

Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.

The information in this document is subject to change without notice.



Introduction

The following information provides examples for configuring traffic accounting.

Prerequisites

The following information applies to Comware 9-based routers. Procedures and information in the examples might be slightly different depending on the software or hardware version of the MSR routers.

The configuration examples were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.

The following information is provided based on the assumption that you have basic knowledge of traffic accounting.

Example: Configuring traffic accounting

Network configuration

As shown in Figure 1, configure the routers as follows:

·     Configure LDP to establish LSPs between Router A and Router C, so subnets 11.1.1.0/24 and 21.1.1.0/24 can reach each other over MPLS.

·     Configure LDP to establish LSPs only for destinations 1.1.1.9/32, 2.2.2.9/32, 3.3.3.9/32, 11.1.1.0/24, and 21.1.1.0/24 on Router A, Router B, and Router C. Configure the penultimate hop not to pop the label on Router B.

·     On Router A, Router B, and Router C, configure traffic accounting for traffic from subnet 11.1.1.0/24 to subnet 21.1.1.0/24 to identify links that have packet loss.

Figure 1 Network diagram

Device

Interface

IP address

Device

Interface

IP address

Router A

Loop0

1.1.1.9/32

Router B

Loop0

2.2.2.9/32

 

GE0/0/1

10.1.1.1/24

 

GE0/0/1

10.1.1.2/24

 

GE0/0/2      

11.1.1.1/24

 

GE0/0/2      

20.1.1.1/24

Router C

Loop0

3.3.3.9/32

 

 

 

 

GE0/0/1

20.1.1.2/24

 

 

 

 

GE0/0/2      

21.1.1.1/24

 

 

 

 

Software versions used

This configuration example was created and verified on Release 9141P16 of the MSR2630E-X1 router.

Procedures

Configuring Router A

1.     Assign IP addresses to interfaces.

Configure IP addresses and masks for interfaces as shown in Figure 1. (Details not shown.)

2.     Configure OSPF to ensure IP connectivity between the routers.

<RouterA> system-view

[RouterA] ospf

[RouterA-ospf-1] area 0

[RouterA-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0

[RouterA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[RouterA-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255

[RouterA-ospf-1-area-0.0.0.0] quit

[RouterA-ospf-1] quit

3.     Enable MPLS and LDP.

[RouterA] mpls lsr-id 1.1.1.9

[RouterA] mpls ldp

[RouterA-ldp] quit

[RouterA] interface gigabitethernet 0/0/1

[RouterA-GigabitEthernet0/0/1] mpls enable

[RouterA-GigabitEthernet0/0/1] mpls ldp enable

[RouterA-GigabitEthernet0/0/1] quit

4.     Configure IP prefix list routera, and configure LDP to use only the routes permitted by the prefix list to establish LSPs.

[RouterA] ip prefix-list routera index 10 permit 1.1.1.9 32

[RouterA] ip prefix-list routera index 20 permit 2.2.2.9 32

[RouterA] ip prefix-list routera index 30 permit 3.3.3.9 32

[RouterA] ip prefix-list routera index 40 permit 11.1.1.0 24

[RouterA] ip prefix-list routera index 50 permit 21.1.1.0 24

[RouterA] mpls ldp

[RouterA-ldp] lsp-trigger prefix-list routera

[RouterA-ldp] quit

5.     Configure traffic classes to match IPv4 traffic from subnet 11.1.1.0/24 to subnet 21.1.1.0/24.

[RouterA] acl advanced 3000

[RouterA-acl-ipv4-adv-3000] rule permit ip destination 21.1.1.0 0.0.0.255 source 11.1.1.0 0.0.0.255

[RouterA-acl-ipv4-adv-3000] quit

[RouterA] traffic classifier FEC

[RouterA-classifier-classifier_FEC] if-match acl 3000

[RouterA-classifier-classifier_FEC] quit

[RouterA] traffic classifier Other

[RouterA-classifier-classifier_Other] if-match any

[RouterA-classifier-classifier_Other] quit

6.     Configure traffic behavior IP_statistic to count IPv4 traffic from subnet 11.1.1.0/24 to subnet 21.1.1.0/24. You do not need to configure any traffic accounting action in the traffic behavior.

[RouterA] traffic behavior IP_statistic

[RouterA-behavior-behavior_IP_statistic] quit

7.     Associate traffic class FEC with traffic behavior IP_statistic in QoS policy IP_statistic.

[RouterA] qos policy IP_statistic

[RouterA-qospolicy-IP_statistic] classifier FEC behavior IP_statistic

[RouterA-qospolicy-IP_statistic] quit

8.     Apply QoS policy IP_statistic to the incoming traffic on GigabitEthernet 0/0/2.

[RouterA] interface gigabitethernet 0/0/2

[RouterA-GigabitEthernet0/0/2] qos apply policy IP_statistic inbound

[RouterA-GigabitEthernet0/0/2] quit

9.     Configure traffic behaviors to set the EXP value in the first label to 7 and 1 for MPLS packets from subnet 11.1.1.0/24 to subnet 21.1.1.0/24 and other MPLS packets, respectively.

[RouterA] traffic behavior MPLS_statistic

[RouterA-behavior-behavior_MPLS_statistic] remark mpls-exp 7

[RouterA-behavior-behavior_MPLS_statistic] quit

[RouterA] traffic behavior Other

[RouterA-behavior-behavior_Other] remark mpls-exp 1

[RouterA-behavior-behavior_Other] quit

10.     Associate traffic class FEC with traffic behavior MPLS_statistic in QoS policy MPLS_statistic.

[RouterA] qos policy MPLS_statistic

[RouterA-qospolicy-MPLS_statistic] classifier FEC behavior MPLS_statistic

[RouterA-qospolicy-MPLS_statistic] classifier Other behavior Other

[RouterA-qospolicy-MPLS_statistic] quit

11.     Apply QoS policy MPLS_statistic to the outgoing traffic on GigabitEthernet 0/0/1.

[RouterA] interface gigabitethernet 0/0/1

[RouterA-GigabitEthernet0/0/1] qos apply policy MPLS_statistic outbound

[RouterA-GigabitEthernet0/0/1] quit

Configuring Router B

1.     Assign IP addresses to interfaces.

Configure IP addresses and masks for interfaces as shown in Figure 1. (Details not shown.)

2.     Configure OSPF to ensure IP connectivity between the routers.

<RouterB> system-view

[RouterB] ospf

[RouterB-ospf-1] area 0

[RouterB-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0

[RouterB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[RouterB-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[RouterB-ospf-1-area-0.0.0.0] quit

[RouterB-ospf-1] quit

3.     Enable MPLS and LDP.

[RouterB] mpls lsr-id 2.2.2.9

[RouterB] mpls ldp

[RouterB-ldp] quit

[RouterB] interface gigabitethernet 0/0/1

[RouterB-GigabitEthernet0/0/1] mpls enable

[RouterB-GigabitEthernet0/0/1] mpls ldp enable

[RouterB-GigabitEthernet0/0/1] quit

[RouterB] interface gigabitethernet 0/0/2

[RouterB-GigabitEthernet0/0/2] mpls enable

[RouterB-GigabitEthernet0/0/2] mpls ldp enable

[RouterB-GigabitEthernet0/0/2] quit

4.     Configure IP prefix list routerb, and configure LDP to use only the routes permitted by the prefix list to establish LSPs.

[RouterB] ip prefix-list routerb index 10 permit 1.1.1.9 32

[RouterB] ip prefix-list routerb index 20 permit 2.2.2.9 32

[RouterB] ip prefix-list routerb index 30 permit 3.3.3.9 32

[RouterB] ip prefix-list routerb index 40 permit 11.1.1.0 24

[RouterB] ip prefix-list routerb index 50 permit 21.1.1.0 24

[RouterB] mpls ldp

[RouterB-ldp] lsp-trigger prefix-list routerb

[RouterB-ldp] quit

5.     Configure Router B to advertise an explicit null label to the penultimate hop.

[RouterB] mpls label advertise explicit-null

6.     Configure traffic class MPLS_statistic on Router B to match MPLS packets with EXP value 7 in the first MPLS label.

[RouterB] traffic classifier MPLS_statistic

[RouterB-classifier-classifier_MPLS_statistic] if-match mpls-exp 7

[RouterB-classifier-classifier_MPLS_statistic] quit

7.     Configure traffic behavior MPLS_statistic_in to count MPLS packets with EXP value 7 in the first MPLS label. You do not need to configure any traffic accounting action in the traffic behavior.

[RouterB] traffic behavior MPLS_statistic_in

[RouterB-behavior-behavior_MPLS_statistic_in] quit

8.     Associate traffic class MPLS_statistic with traffic behavior MPLS_statistic_in in QoS policy MPLS_statistic_in.

[RouterB] qos policy MPLS_statistic_in

[RouterB-qospolicy-MPLS_statistic_in] classifier MPLS_statistic behavior MPLS_statistic_in

[RouterB-qospolicy-MPLS_statistic_in] quit

9.     Apply QoS policy MPLS_statistic_in to the incoming traffic on GigabitEthernet 0/0/1.

[RouterB] interface gigabitethernet 0/0/1

[RouterB-GigabitEthernet0/0/1] qos apply policy MPLS_statistic_in inbound

[RouterB-GigabitEthernet0/0/1] quit

10.     Configure traffic behavior MPLS_statistic_out to count packets with EXP value 7 in the first MPLS label. You do not need to configure any traffic accounting action in the traffic behavior.

[RouterB] traffic behavior MPLS_statistic_out

[RouterB-behavior-behavior_MPLS_statistic_out] quit

11.     Associate traffic class MPLS_statistic with traffic behavior MPLS_statistic_out in QoS policy MPLS_statistic_out.

[RouterB] qos policy MPLS_statistic_out

[RouterB-qospolicy-MPLS_statistic] classifier MPLS_statistic behavior MPLS_statistic_out

[RouterB-qospolicy-MPLS_statistic] quit

12.     Apply QoS policy MPLS_statistic_out to the outgoing traffic on GigabitEthernet 0/0/2.

[RouterB] interface gigabitethernet 0/0/2

[RouterB-GigabitEthernet0/0/2] qos apply policy MPLS_statistic_out outbound

[RouterB-GigabitEthernet0/0/2] quit

Configuring Router C

1.     Assign IP addresses to interfaces.

Configure IP addresses and masks for interfaces as shown in Figure 1. (Details not shown.)

2.     Configure OSPF to ensure IP connectivity between the routers.

<RouterC> system-view

[RouterC] ospf

[RouterC-ospf-1] area 0

[RouterC-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0

[RouterC-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[RouterC-ospf-1-area-0.0.0.0] network 21.1.1.0 0.0.0.255

[RouterC-ospf-1-area-0.0.0.0] quit

[RouterC-ospf-1] quit

3.     Enable MPLS and LDP.

[RouterC] mpls lsr-id 3.3.3.9

[RouterC] mpls ldp

[RouterC-ldp] quit

[RouterC] interface gigabitethernet 0/0/1

[RouterC-GigabitEthernet0/0/1] mpls enable

[RouterC-GigabitEthernet0/0/1] mpls ldp enable

[RouterC-GigabitEthernet0/0/1] quit

4.     Configure IP prefix list routerc, and configure LDP to use only the routes permitted by the prefix list to establish LSPs.

[RouterC] ip prefix-list routerc index 10 permit 1.1.1.9 32

[RouterC] ip prefix-list routerc index 20 permit 2.2.2.9 32

[RouterC] ip prefix-list routerc index 30 permit 3.3.3.9 32

[RouterC] ip prefix-list routerc index 40 permit 11.1.1.0 24

[RouterC] ip prefix-list routerc index 50 permit 21.1.1.0 24

[RouterC] mpls ldp

[RouterC-ldp] lsp-trigger prefix-list routerc

[RouterC-ldp] quit

5.     Configure traffic class MPLS_statistic to match MPLS packets with EXP value 7 in the first MPLS label.

[RouterB] traffic classifier MPLS_statistic

[RouterB-classifier-classifier_MPLS_statistic] if-match mpls-exp 7

[RouterB-classifier-classifier_MPLS_statistic] quit

6.     Configure traffic behavior MPLS_statistic to count packets with EXP value 7 in the first MPLS label. You do not need to configure any traffic accounting action in the traffic behavior.

[RouterC] traffic behavior MPLS_statistic

[RouterC-behavior-behavior_MPLS_statistic] quit

7.     Associate traffic class MPLS_statistic with traffic behavior MPLS_statistic in QoS policy MPLS_statistic.

[RouterC] qos policy MPLS_statistic

[RouterC-qospolicy-MPLS_statistic] classifier MPLS_statistic behavior MPLS_statistic

[RouterC-qospolicy-MPLS_statistic] quit

8.     Apply QoS policy MPLS_statistic to the incoming traffic on GigabitEthernet 0/0/1.

[RouterC] interface gigabitethernet 0/0/1

[RouterC-GigabitEthernet0/0/1] qos apply policy MPLS_statistic inbound

[RouterC-GigabitEthernet0/0/1] quit

9.     Configure a traffic class to match IPv4 traffic from subnet 11.1.1.0/24 to subnet 21.1.1.0/24.

[RouterC] acl advanced 3000

[RouterC-acl-ipv4-adv-3000] rule permit ip destination 21.1.1.0 0.0.0.255 source 11.1.1.0 0.0.0.255

[RouterC-acl-ipv4-adv-3000] quit

[RouterC] traffic classifier FEC operator and

[RouterC-classifier-classifier_FEC] if-match acl 3000

[RouterC-classifier-classifier_FEC] quit

10.     Configure traffic behavior IP_statistic to count IPv4 traffic from subnet 11.1.1.0/24 to subnet 21.1.1.0/24. You do not need to configure any traffic accounting action in the traffic behavior.

[RouterC] traffic behavior IP_statistic

[RouterC-behavior-behavior_IP_statistic] quit

11.     Associate traffic class FEC with traffic behavior IP_statistic in QoS policy IP_statistic.

[RouterC] qos policy IP_statistic

[RouterC-qospolicy-IP_statistic] classifier FEC behavior IP_statistic

[RouterC-qospolicy-IP_statistic] quit

12.     Apply QoS policy IP_statistic to the outgoing traffic on GigabitEthernet 0/0/2.

[RouterC] interface gigabitethernet 0/0/2

[RouterC-GigabitEthernet0/0/2] qos apply policy IP_statistic outbound

[RouterC-GigabitEthernet0/0/2] quit

Verifying the configuration

# Display the QoS policies applied to all interfaces on each router. Verify that the traffic accounting information of the traffic input and output interfaces on the routers is the same. The following uses Router A as an example.

[RouterA-GigabitEthernet0/0/1] display qos policy interface

Interface: GigabitEthernet0/0/1

  Direction: Inbound

  Policy: IP_statistic

   Classifier: default-class

     Matched : 0 (Packets) 0 (Bytes)

     5-minute statistics:

      Forwarded: 0/0 (pps/bps)

      Dropped  : 0/0 (pps/bps)

     Operator: AND

     Rule(s) :

      If-match any

     Behavior: be

      -none-

   Classifier: FEC

     Matched : 0 (Packets) 0 (Bytes)

     5-minute statistics:

      Forwarded: 123/41248 (pps/bps)

      Dropped  : 0/0 (pps/bps)

     Operator: AND

     Rule(s) :

      If-match acl 3000

     Behavior: IP_statistic

      -none-

 

Interface: GigabitEthernet0/0/2

  Direction: Outbound

  Policy: MPLS_statistic

   Classifier: default-class

     Matched : 0 (Packets) 0 (Bytes)

     5-minute statistics:

      Forwarded: 123/41248 (pps/bps)

      Dropped  : 0/0 (pps/bps)

     Operator: AND

     Rule(s) :

      If-match any

     Behavior: be

      -none-

   Classifier: FEC

     Matched : 123 (Packets) 41248 (Bytes)

     5-minute statistics:

      Forwarded: 123/41248 (pps/bps)

      Dropped  : 0/0 (pps/bps)

     Operator: AND

     Rule(s) :

      If-match acl 3000

     Behavior: MPLS_statistic

      Marking:

        Remark mpls-exp 7

Configuration files

·     Router A:

#

ospf 1

 area 0.0.0.0

  network 1.1.1.9 0.0.0.0

  network 10.1.1.0 0.0.0.255

  network 11.1.1.0 0.0.0.255

#

 mpls lsr-id 1.1.1.9

#

traffic classifier FEC operator and

 if-match acl 3000

#

traffic classifier Other operator and

 if-match any

#

traffic behavior IP_statistic

#

traffic behavior MPLS_statistic

 remark mpls-exp 7

#

traffic behavior Other

 remark mpls-exp 1

#

qos policy IP_statistic

 classifier FEC behavior IP_statistic

#

qos policy MPLS_statistic

 classifier FEC behavior MPLS_statistic

 classifier Other behavior Other

#

mpls ldp

 lsp-trigger prefix-list routera

#

#

interface LoopBack0

 ip address 1.1.1.9 255.255.255.255

#

interface GigabitEthernet0/0/1

 port link-mode route

 combo enable copper

 ip address 10.1.1.1 255.255.255.0

 mpls enable

 mpls ldp enable

 qos apply policy MPLS_statistic outbound

#

interface GigabitEthernet0/0/2

 port link-mode route

 combo enable copper

 ip address 11.1.1.1 255.255.255.0

 qos apply policy IP_statistic inbound

#

 ip prefix-list routera index 10 permit 1.1.1.9 32

 ip prefix-list routera index 20 permit 2.2.2.9 32

 ip prefix-list routera index 30 permit 3.3.3.9 32

 ip prefix-list routera index 40 permit 11.1.1.0 24

 ip prefix-list routera index 50 permit 21.1.1.0 24

#

acl advanced 3000

 rule 5 permit ip source 11.1.1.0 0.0.0.255 destination 21.1.1.0 0.0.0.255

#

·     Router B:

#

ospf 1

 area 0.0.0.0

  network 2.2.2.9 0.0.0.0

  network 10.1.1.0 0.0.0.255

  network 20.1.1.0 0.0.0.255

#

 mpls lsr-id 2.2.2.9

 mpls label advertise explicit-null

#

traffic classifier MPLS_statistic operator and

 if-match mpls-exp 7

#

traffic behavior MPLS_statistic_in

#

traffic behavior MPLS_statistic_out

#

qos policy MPLS_statistic_in

 classifier MPLS_statistic behavior MPLS_statistic_in

#

qos policy MPLS_statistic_out

 classifier MPLS_statistic behavior MPLS_statistic_out

#

mpls ldp

 lsp-trigger prefix-list routerb

#

#

interface LoopBack0

 ip address 2.2.2.9 255.255.255.255

#

interface GigabitEthernet0/0/1

 port link-mode route

 combo enable copper

 ip address 10.1.1.2 255.255.255.0

 mpls enable

 mpls ldp enable

 qos apply policy MPLS_statistic_in inbound

#

interface GigabitEthernet0/0/2

 port link-mode route

 combo enable copper

 ip address 20.1.1.1 255.255.255.0

 qos apply policy MPLS_statistic_out outbound

#

 ip prefix-list routerb index 10 permit 1.1.1.9 32

 ip prefix-list routerb index 20 permit 2.2.2.9 32

 ip prefix-list routerb index 30 permit 3.3.3.9 32

 ip prefix-list routerb index 40 permit 11.1.1.0 24

 ip prefix-list routerb index 50 permit 21.1.1.0 24

#

·     Router C:

#

ospf 1

 area 0.0.0.0

  network 3.3.3.9 0.0.0.0

  network 20.1.1.0 0.0.0.255

  network 21.1.1.0 0.0.0.255

#

 mpls lsr-id 3.3.3.9

#

traffic classifier FEC operator and

 if-match acl 3000

#

traffic behavior IP_statistic

#

traffic behavior MPLS_statistic

#

qos policy IP_statistic

 classifier FEC behavior IP_statistic

#

qos policy MPLS_statistic

 classifier MPLS_statistic behavior MPLS_statistic

#

mpls ldp

 lsp-trigger prefix-list routerc

#

#

interface LoopBack0

 ip address 3.3.3.9 255.255.255.255

#

interface GigabitEthernet0/0/1

 port link-mode route

 combo enable copper

 ip address 20.1.1.2 255.255.255.0

 mpls enable

 mpls ldp enable

 qos apply policy MPLS_statistic inbound

#

interface GigabitEthernet0/0/2

 port link-mode route

 combo enable copper

 ip address 21.1.1.1 255.255.255.0

 qos apply policy IP_statistic outbound

#

 ip prefix-list routerc index 10 permit 1.1.1.9 32

 ip prefix-list routerc index 20 permit 2.2.2.9 32

 ip prefix-list routerc index 30 permit 3.3.3.9 32

 ip prefix-list routerc index 40 permit 11.1.1.0 24

 ip prefix-list routerc index 50 permit 21.1.1.0 24

#

acl advanced 3000

 rule 5 permit ip source 11.1.1.0 0.0.0.255 destination 21.1.1.0 0.0.0.255

#

Related documentation

·     ACL and QoS Configuration Guide in H3C MSR1000[2600][3600] Routers Configuration Guides(V9)

·     ACL and QoS Command Reference in H3C MSR1000[2600][3600] Routers Command References(V9)

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网