H3C S5500-SI Series Ethernet Switches Operation Manual(V1.01)

HomeSupportSwitchesH3C S5500 Switch SeriesConfigure & DeployConfiguration GuidesH3C S5500-SI Series Ethernet Switches Operation Manual(V1.01)
19-ACL Configuration
Title Size Download
19-ACL Configuration 182 KB

Table of Contents

Chapter 1 ACL Overview.. 1-1

1.1 Introduction to ACL. 1-1

1.1.1 Introduction. 1-1

1.1.2 Application of ACLs on the Switch. 1-1

1.2 Introduction to IPv4 ACL. 1-2

1.2.1 IPv4 ACL Classification. 1-2

1.2.2 IPv4 ACL Naming. 1-3

1.2.3 IPv4 ACL Match Order 1-3

1.2.4 IPv4 ACL Step. 1-4

1.2.5 Effective Period of an IPv4 ACL. 1-5

1.2.6 IP Fragments Filtering with IPv4 ACL. 1-5

1.3 Introduction to IPv6 ACL. 1-5

1.3.1 IPv6 ACL Classification. 1-6

1.3.2 IPv6 ACL Naming. 1-6

1.3.3 IPv6 ACL Match Order 1-6

1.3.4 IPv6 ACL Step. 1-7

1.3.5 Effective Period of an IPv6 ACL. 1-7

Chapter 2 IPv4 ACL Configuration. 2-1

2.1 Creating a Time Range. 2-1

2.1.1 Configuration Procedure. 2-1

2.1.2 Configuration Examples. 2-2

2.2 Configuring a Basic IPv4 ACL. 2-2

2.2.1 Configuration Prerequisites. 2-3

2.2.2 Configuration Procedure. 2-3

2.2.3 Configuration Examples. 2-4

2.3 Configuring an Advanced IPv4 ACL. 2-4

2.3.1 Configuration Prerequisites. 2-4

2.3.2 Configuration Procedure. 2-5

2.3.3 Configuration Examples. 2-6

2.4 Configuring an Ethernet Frame Header ACL. 2-6

2.4.1 Configuration Prerequisites. 2-6

2.4.2 Configuration Procedure. 2-6

2.4.3 Configuration Examples. 2-8

2.5 Copying an IPv4 ACL. 2-8

2.5.1 Configuration Prerequisites. 2-8

2.5.2 Configuration Procedure. 2-8

2.6 Displaying and Maintaining IPv4 ACLs. 2-9

2.7 IPv4 ACL Configuration Example. 2-9

2.7.1 Network Requirements. 2-9

2.7.2 Network Diagram.. 2-10

2.7.3 Configuration Procedure. 2-10

Chapter 3 IPv6 ACL Configuration. 3-1

3.1 Creating a Time Range. 3-1

3.2 Configuring a Basic IPv6 ACL. 3-1

3.2.1 Configuration Prerequisites. 3-1

3.2.2 Configuration Procedure. 3-1

3.2.3 Configuration Examples. 3-2

3.3 Configuring an Advanced IPv6 ACL. 3-3

3.3.1 Configuration Prerequisites. 3-3

3.3.2 Configuration Procedure. 3-3

3.3.3 Configuration Examples. 3-5

3.4 Copying an IPv6 ACL. 3-5

3.4.1 Configuration Prerequisites. 3-5

3.4.2 Configuration Procedure. 3-5

3.5 Displaying and Maintaining IPv6 ACLs. 3-6

3.6 IPv6 ACL Configuration Example. 3-6

3.6.1 Network Requirements. 3-6

3.6.2 Network Diagram.. 3-6

3.6.3 Configuration Procedure. 3-6

 


Chapter 1  ACL Overview

In order to filter traffic, network devices use sets of rules, called access control lists (ACLs), to identify and handle packets.

When configuring ACLs, go to these chapters for information you are interested in:

l           ACL Overview

l           IPv4 ACL Configuration

l           IPv6 ACL Configuration

 

&  Note:

Unless otherwise stated, ACLs refer to both IPv4 ACLs and IPv6 ACLs throughout this document.

 

1.1  Introduction to ACL

1.1.1  Introduction

As network scale and network traffic are increasingly growing, network security and bandwidth allocation become more and more critical to network management. Packet filtering can be used to efficiently prevent illegal users from accessing networks and to control network traffic and save network resources. Access control lists (ACL) are often used to filter packets with configured matching rules.

ACLs are sets of rules (or sets of permit or deny statements) that decide what packets can pass and what should be rejected based on matching criteria such as source MAC address, destination MAC address, source IP address, destination IP address, and port number.

1.1.2  Application of ACLs on the Switch

The switch supports two ACL application modes:

l           Hardware-based application: An ACL is assigned to a piece of hardware. For example, an ACL can be referenced by QoS for traffic classification. Note that when an ACL is referenced to implement QoS, the actions defined in the ACL rules, deny or permit, do not take effect; actions to be taken on packets matching the ACL depend on the traffic behavior definition in QoS. For details about traffic behavior, refer to the QoS part in this manual.

l           Software-based application: An ACL is referenced by a piece of upper layer software. For example, an ACL can be referenced to configure login user control behavior, thus controlling Telnet, SNMP and Web users. Note that when an ACL is reference by the upper layer software, actions to be taken on packets matching the ACL depend on those defined by the ACL rules. For details about login user control, refer to the part about login configuration in this manual.

 

&  Note:

l      When an ACL is assigned to a piece of hardware and referenced by a QoS policy for traffic classification, the switch does not take action according to the traffic behavior definition on a packet that does not match the ACL.

l      When an ACL is referenced by a piece of software to control Telnet, SNMP, and Web login users, the switch denies all packets that do not match the ACL.

 

1.2  Introduction to IPv4 ACL

This section covers these topics:

l           IPv4 ACL Classification

l           IPv4 ACL Naming

l           IPv4 ACL Match Order

l           IPv4 ACL Step

l           Effective Period of an IPv4 ACL

l           IP Fragments Filtering with IPv4 ACL

1.2.1  IPv4 ACL Classification

IPv4 ACLs, identified by ACL numbers, fall into four categories, as shown in Table 1-1.

Table 1-1 IPv4 ACL categories

Category

ACL number

Matching criteria

Basic IPv4 ACL

2000 to 2999

Source IP address

Advanced IPv4 ACL

3000 to 3999

Source IP address, destination IP address, protocol carried on IP, and other Layer 3 or Layer 4 protocol header information

Ethernet frame header ACL

4000 to 4999

Layer 2 protocol header fields such as source MAC address, destination MAC address, 802.1p priority, and link layer protocol type

 

1.2.2  IPv4 ACL Naming

When creating an IPv4 ACL, you can specify a unique name for it. Afterwards, you can identify the ACL by its name.

An IPv4 ACL can have only one name. Whether to specify a name for an ACL is up to you. After creating an ACL, you cannot specify a name for it, nor can you change or remove the name of the ACL.

 

&  Note:

The name of an IPv4 ACL must be unique among IPv4 ACLs. However, an IPv4 ACL and an IPv6 ACL can share the same name.

 

1.2.3  IPv4 ACL Match Order

An ACL consists of multiple rules, each of which specifies different matching criteria. These criteria may have overlapping or conflicting parts. This is where the order in which a packet is matched against the rules comes to rescue.

Two match orders are available for IPv4 ACLs: 

l           config: where packets are compared against ACL rules in the order in which they are configured.

l           auto: where depth-first match is performed. The term depth-first match has different meanings for different types of ACLs.

I. Depth-first match for a basic IPv4 ACL

The following shows how your switch performs depth-first match in a basic IPv4 ACL:

1)         Sort rules by source IP address wildcard first and compare packets against the rule configured with more zeros in the source IP address wildcard prior to other rules.

2)         If two rules are present with the same number of zeros in their source IP address wildcards, compare packets against the rule configured first prior to the other.

II. Depth-first match for an advanced IPv4 ACL

The following shows how your switch performs depth-first match in an advanced IPv4 ACL:

1)         Sort rules by protocol range and compare packets against the rule with the protocol carried on IP specified prior to the other.

2)         If the protocol ranges are the same, look at source IP address wildcard. Then, compare packets against the rule configured with more zeros in the source IP address wildcard prior to the other.

3)         If the numbers of zeros in the source IP address wildcards are the same, look at the destination IP address wildcards. Then, compare packets against the rule configured with more zeros in the destination IP address wildcard prior to the other.

4)         If the numbers of zeros in the destination IP address wildcards are the same, look at the Layer 4 port number (TCP/UDP port number). Then compare packets against the rule configured with the lower port number prior to the other.

5)         If the port numbers are the same, compare packets against the rule configured first prior to the other.

III. Depth-first match for an Ethernet frame header ACL

The following shows how your switch performs depth-first match in an Ethernet frame header ACL:

1)         Sort rules by source MAC address mask first and compare packets against the rule configured with more ones in the source MAC address mask prior to other rules.

2)         If two rules are present with the same number of ones in their source MAC address masks, look at the destination MAC address masks. Then, compare packets against the rule configured with more ones in the destination MAC address mask prior to the other.

3)         If the numbers of ones in the destination MAC address masks are the same, the one configured first is compared prior to the other.

The comparison of a packet against an ACL stops once a match is found. The packet is then processed as per the rule.

1.2.4  IPv4 ACL Step

I. Meaning of the step

When defining rules in an IPv4 ACL, you do not necessarily assign them numbers; the system can do this automatically, and the step defines the increment between two neighboring numbers. For example, with a step of 5, rules are automatically numbered 0, 5, 10, 15, and so on. By default, the step is 5.

Whenever the step changes, the rules are renumbered, starting from 0. For example, if four rules are numbered 5, 10, 15, and 20 respectively, changing the step from 5 to 2 will cause the rules to be renumbered 0, 2, 4, and 6.

II. Benefits of using the step

With the step and rule numbering/renumbering mechanism, you do not need to assign rules numbers when defining them. The system will assign a newly defined rule a number that is the smallest multiple of the step bigger than the currently biggest number. For example, with a step of five, if the biggest number is currently 28, the newly defined rule will get a number of 30. If the ACL has no rule defined already, the first defined rule will get a number of 0.

Another benefit of using the step is that it allows you to insert new rules between existing ones as needed. For example, after creating four rules numbered 0, 5, 10, and 15 in an ACL with a step of five, you can insert a rule numbered 1.

1.2.5  Effective Period of an IPv4 ACL

You can control when a rule can take effect by referencing a time range in the rule.

A referenced time range can be one that has not been created yet. The rule, however, can take effect only after the time range is defined and comes active.

1.2.6  IP Fragments Filtering with IPv4 ACL

Traditional packet filtering performs match operation on, rather than all IP fragments, the first ones only. All subsequent non-first fragments are handled in the way the first fragments are handled. This causes security risk as attackers may fabricate non-first fragments to attack your network.

As for the configuration of a rule of an IPv4 ACL, the fragment keyword specifies that the rule applies to non-first fragment packets only, and does not apply to non-fragment packets or the first fragment packets. ACL rules that do not contain this keyword is applicable to both non-fragment packets and fragment packets.

1.3  Introduction to IPv6 ACL

This section covers these topics:

l           IPv6 ACL Classification

l           IPv6 ACL Naming

l           IPv6 ACL Match Order

l           IPv6 ACL Step

l           Effective Period of an IPv6 ACL

1.3.1  IPv6 ACL Classification

IPv6 ACLs, identified by ACL numbers, fall into three categories, as show in Table 1-2.

Table 1-2 IPv6 ACL categories

Category

ACL number

Matching criteria

Basic IPv6 ACL

2000 to 2999

Source IPv6 address

Advanced IPv6 ACL

3000 to 3999

Source IPv6 address, destination IPv6 address, protocol carried on IPv6, and other Layer 3 or Layer 4 protocol header fields

 

1.3.2  IPv6 ACL Naming

When creating an IPv6 ACL, you can specify a unique name for it. Afterwards, you can identify the IPv6 ACL by its name.

An IPv6 ACL can have only one name. Whether to specify a name for an ACL is up to you. After creating an ACL, you cannot specify a name for it, nor can you change or remove the name of the ACL.

 

&  Note:

The name of an IPv6 ACL must be unique among IPv6 ACLs. However, an IPv6 ACL and an IPv4 ACL can share the same name.

 

1.3.3  IPv6 ACL Match Order

Similar to IPv4 ACLs, IPv6 ACLs are sequential collections of rules defined with different matching parameters. The order in which a packet is matched against the rules in an IPv6 ACL may affect how the packet is handled.

Like in IPv4 ACLs, the following two match orders are available in IPv6 ACLs:

l           config: where rules are compared against in the order in which they are configured.

l           auto: where depth-first match is performed.

I. Depth-first match for a basic IPv6 ACL

The following shows how your switch performs depth-first match in a basic IPv6 ACL:

1)         Sort rules by source IPv6 address wildcard first and compare packets against the rule configured with a longer prefix in the source IPv6 address wildcard prior to other rules.

2)         If two rules are present with the same prefix length in their source IPv6 address wildcards, compare packets against the rule configured first prior to the other.

II. Depth-first match for an advanced IPv6 ACL

The following shows how your switch performs depth-first match in an advanced IPv6 ACL:

1)         Sort rules by protocol range first, and compare packets against the rule with the protocol carried on IPv6 specified prior to other rules.

2)         If two rules are present with the same protocol range, look at source IPv6 address wildcard in addition. Then, compare packets against the rule configured with a larger prefix length in the source IPv6 address wildcard prior to the other.

3)         If the prefix lengths in the source IPv6 address wildcards are the same, look at the destination IPv6 address wildcards. Then, compare packets against the rule configured with a larger prefix length in the destination IPv6 address wildcard prior to the other.

4)         If the prefix lengths in the destination IPv6 address wildcards are the same, look at the Layer 4 port number (TCP/UDP port number). Then compare packets against the rule configured with the lower port number prior to the other.

5)         If the port numbers are the same, compare packets against the rule configured first prior to the other.

The comparison of a packet against an ACL stops once a match is found. The packet is then processed as per the rule.

1.3.4  IPv6 ACL Step

Refer to IPv4 ACL Step.

1.3.5  Effective Period of an IPv6 ACL

Refer to Effective Period of an IPv4 ACL.

 


Chapter 2  IPv4 ACL Configuration

When configuring an IPv4 ACL, go to these sections for information you are interested in:

l           Creating a Time Range

l           Configuring a Basic IPv4 ACL

l           Configuring an Advanced IPv4 ACL

l           Configuring an Ethernet Frame Header ACL

l           Copying an IPv4 ACL

l           Displaying and Maintaining IPv4 ACLs

l           IPv4 ACL Configuration Example

2.1  Creating a Time Range

You can specify a time range for each rule in an ACL. A time range-based ACL takes effect only in specified time ranges. Only after a time range is configured and the system time is within the time range, can an ACL rule take effect.

Two types of time ranges are available:

l           Periodic time range, which recurs periodically on the day or days of the week.

l           Absolute time range, which takes effect only in a period of time and does not recur.

2.1.1  Configuration Procedure

Follow these steps to create a time range:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create a time range

time-range time-name { start-time to end-time days [ from time1 date1 ] [ to time2 date2 ] | from time1 date1 [ to time2 date2 ] | to time2 date2 }

Required

 

Note that:

l           Periodic time range created using the time-range time-name start-time to end-time days command. A time range thus created recurs periodically on the day or days of the week.

l           Absolute time range created using the time-range time-name { from time1 date1 [ to time2 date2 ] | to time2 date2 } command. Unlike a periodic time range, a time range thus created does not recur. For example, to create an absolute time range that is active between January 1, 2004 00:00 and December 31, 2004 23:59, you may use the time-range test from 00:00 01/01/2004 to 23:59 12/31/2004 command.

l           Compound time range created using the time-range time-name start-time to end-time days { from time1 date1 [ to time2 date2 ] | to time2 date2 } command. A time range thus created recurs on the day or days of the week only within the specified period. For example, to create a time range that is active from 12:00 to 14:00 on Wednesdays between January 1, 2004 00:00 and December 31, 2004 23:59, you may use the time-range test 12:00 to 14:00 wednesday from 00:00 01/01/2004 to 23:59 12/31/2004 command.

l           You may create individual time ranges identified with the same name. They are regarded as one time range whose active period is the result of ORing periodic ones, ORing absolute ones, and ANDing periodic and absolute ones.

l           With no start time specified, the time range is from the earliest time that the system can express (that is, 00:00 01/01/1970) to the end time. With no end time specified, the time range is from the time the configuration takes effect to the latest time that the system can express (that is, 24:00 12/31/2100).

l           Up to 256 time ranges can be defined.

2.1.2  Configuration Examples

# Create a periodic time range that is active from 8:00 to 18:00 every working day.

<Sysname> system-view

[Sysname] time-range test 8:00 to 18:00 working-day

[Sysname] display time-range test

Current time is 22:17:42 1/5/2006 Thursday

 

Time-range : test ( Inactive )

 08:00 to 18:00 working-day

# Create an absolute time range from 15:00, Jan 28, 2006 to 15:00, Jan 28, 2008.

<Sysname> system-view

[Sysname] time-range test from 15:00 1/28/2006 to 15:00 1/28/2008

[Sysname] display time-range test

Current time is 22:20:18 1/5/2006 Thursday

 

Time-range : test ( Inactive )

 from 15:00 1/28/2006 to 15:00 1/28/2008

2.2  Configuring a Basic IPv4 ACL

Basic IPv4 ACLs filter packets based on source IP address. They are numbered in the range 2000 to 2999.

2.2.1  Configuration Prerequisites

If you want to reference a time range to a rule, define it with the time-range command first.

2.2.2  Configuration Procedure

Follow these steps to configure a basic IPv4 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create and enter basic IPv4 ACL view

acl number acl-number  [ name acl-name ] [ match-order { auto | config } ]

Required

The default match order is config.

If you specify a name for an IPv4 ACL when creating the ACL, you can use the acl name acl-name command to enter the view of the ACL later.

Create or modify a rule

rule [ rule-id ] { deny | permit } [ fragment | logging | source { sour-addr sour-wildcard | any } | time-range time-name ] *

Required

To create multiple rules, repeat this step.

Note that the logging keyword is not supported if the ACL is to be referenced by a QoS policy for traffic classification.

Set a rule numbering step

step step-value

Optional

The default step is 5.

Create an IPv4 ACL description

description text

Optional

By default, no IPv4 ACL description is present.

Create a rule description

rule rule-id comment text

Optional

By default, no rule description is present.

 

Note that:

l           You will fail to create or modify a rule if its permit/deny statement is exactly the same as another rule. In addition, if the ACL match order is set to auto rather than config, you cannot modify ACL rules.

l           You may use the display acl command to verify rules configured in an ACL. If the match order for this ACL is auto, rules are displayed in the depth-first match order rather than by rule number.

 

  Caution:

l      You can modify the match order of an ACL with the acl number acl-number [ name acl-name ] match-order { auto | config } command but only when it does not contain any rules.

l      The rule specified in the rule comment command must have existed.

 

2.2.3  Configuration Examples

# Create IPv4 ACL 2000 to deny the packets with source address 1.1.1.1 to pass.

<Sysname> system-view

[Sysname] acl number 2000

[Sysname-acl-basic-2000] rule deny source 1.1.1.1 0

# Verify the configuration.

[Sysname-acl-basic-2000] display acl 2000

Basic ACL  2000, named -none-, 1 rule,

ACL's step is 5

 rule 0 deny source 1.1.1.1 0

2.3  Configuring an Advanced IPv4 ACL

Advanced IPv4 ACLs filter packets based on source IP address, destination IP address, protocol carried on IP, and other protocol header fields, such as the TCP/UDP source port, TCP/UDP destination port, ICMP message type, and ICMP message code.

In addition, advanced IPv4 ACLs allow you to filter packets based on three priority criteria: type of service (ToS), IP precedence, and differentiated services codepoint (DSCP) priority.

Advanced IPv4 ACLs are numbered in the range 3000 to 3999. Compared with basic IPv4 ACLs, they allow of more flexible and accurate filtering.

2.3.1  Configuration Prerequisites

If you want to reference a time range to a rule, define it with the time-range command first.

2.3.2  Configuration Procedure

Follow these steps to configure an advanced IPv4 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create and enter advanced IPv4 ACL view

acl number acl-number [ name acl-name ] [ match-order { auto | config } ]

Required

The default match order is config.

If you specify a name for an IPv4 ACL when creating the ACL, you can use the acl name acl-name command to enter the view of the ACL later.

Create or modify a rule

rule [ rule-id ] { deny | permit } protocol [ destination { dest-addr dest-wildcard | any } | destination-port operator port1 [ port2 ] | dscp dscp | established | fragment | icmp-type { icmp-type icmp-code | icmp-message } | logging | precedence precedence | reflective | source { sour-addr sour-wildcard | any } | source-port operator port1 [ port2 ] | time-range time-name | tos tos ] *

Required

To create multiple rules, repeat this step.

Note that if the ACL is to be referenced by a QoS policy for traffic classification, the logging and reflective keywords are not supported and the operator argument cannot be neq.

Set a rule numbering step

step step-value

Optional

The default step is 5.

Create an IPv4 ACL description

description text

Optional

By default, no IPv4 ACL description is present.

Create a rule description

rule rule-id comment text

Optional

By default, no rule description is present.

 

Note that:

l           You will fail to create or modify a rule if its permit/deny statement is exactly the same as another rule. In addition, if the ACL match order is set to auto rather than config, you cannot modify ACL rules.

l           You may use the display acl command to verify rules configured in an ACL. If the match order for this ACL is auto, rules are displayed in the depth-first match order rather than by rule number.

 

  Caution:

l      You can modify the match order of an ACL with the acl number acl-number [ name acl-name ] match-order { auto | config } command but only when it does not contain any rules.

l      The rule specified in the rule comment command must have existed.

 

2.3.3  Configuration Examples

# Create IPv4 ACL 3000, permitting TCP packets with port number 80 sent from 129.9.0.0 to 202.38.160.0 to pass.

<Sysname> system-view

[Sysname] acl number 3000

[Sysname-acl-adv-3000] rule permit tcp source 129.9.0.0 0.0.255.255 destination 202.38.160.0 0.0.0.255 destination-port eq 80

# Verify the configuration.

[Sysname-acl-adv-3000] display acl 3000

Advanced ACL  3000, named -none-, 1 rule,

ACL's step is 5

 rule 0 permit tcp source 129.9.0.0 0.0.255.255 destination 202.38.160.0 0.0.0.255 destination-port eq www

2.4  Configuring an Ethernet Frame Header ACL

Ethernet frame header ACLs filter packets based on Layer 2 protocol header fields such as source MAC address, destination MAC address, 802.1p priority (VLAN priority), and link layer protocol type. They are numbered in the range 4000 to 4999.

2.4.1  Configuration Prerequisites

If you want to reference a time range to a rule, define it with the time-range command first.

2.4.2  Configuration Procedure

Follow these steps to configure an Ethernet frame header ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create and enter Ethernet frame header ACL view

acl number acl-number [ name acl-name ] [ match-order { auto | config } ]

Required

The default match order is config.

If you specify a name for an IPv4 ACL when creating the ACL, you can use the acl name acl-name command to enter the view of the ACL later.

Create or modify a rule

rule [ rule-id ] { deny | permit } [ cos vlan-pri | dest-mac dest-addr dest-mask | lsap lsap-code lsap-wildcard | source-mac sour-addr source-mask | time-range time-name | type type-code type-wildcard ] *

Required

To create multiple rules, repeat this step.

Note that the lsap keyword is not supported if the ACL is to be referenced by a QoS policy for traffic classification.

Set a rule numbering step

step step-value

Optional

The default step is 5.

Create an ACL description

description text

Optional

By default, no IPv4 ACL description is present.

Create a rule description

rule rule-id comment text

Optional

By default, no rule description is present.

 

Note that:

l           You will fail to create or modify a rule if its permit/deny statement is exactly the same as another rule. In addition, if the ACL match order is set to auto rather than config, you cannot modify ACL rules.

l           You may use the display acl command to verify rules configured in an ACL. If the match order for this ACL is auto, rules are displayed in the depth-first match order rather than by rule number.

 

  Caution:

l      You can modify the match order of an ACL with the acl number acl-number [ name acl-name ] match-order { auto | config } command but only when it does not contain any rules.

l      The rule specified in the rule comment command must have existed.

 

2.4.3  Configuration Examples

# Create ACL 4000 to deny frames with the 802.1p priority of 3.

<Sysname> system-view

[Sysname] acl number 4000

[Sysname-acl-ethernetframe-4000] rule deny cos 3

# Verify the configuration.

[Sysname-acl-ethernetframe-4000] display acl 4000

Ethernet frame ACL  4000, named -none-, 1 rule,

ACL's step is 5

 rule 0 deny cos excellent-effort

2.5  Copying an IPv4 ACL

This feature allows you to copy an existent IPv4 ACL to generate a new one, which is of the same type and has the same match order, match rules, rule numbering step and descriptions as the source IPv4 ACL.

2.5.1  Configuration Prerequisites

Make sure that the source IPv4 ACL exists while the destination IPv4 ACL does not.

2.5.2  Configuration Procedure

Follow these steps to copy an IPv4 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

Copy an existing IPv4 ACL to generate a new one of the same type

acl copy { source-acl-number | name source-acl-name } to { dest-acl-number | name dest-acl-name }

Required

 

  Caution:

l      The source IPv4 ACL and the destination IPv4 ACL must be of the same type.

l      The generated ACL does not take the name of the source IPv4 ACL.

 

2.6  Displaying and Maintaining IPv4 ACLs

To do...

Use the command…

Remarks

Display information about a specified or all IPv4 ACLs

display acl { acl-number | all | name acl-name }

Available in any view

Display information about ACL uses of a switch

display acl resource

Available in any view

Display the configuration and state of a specified or all time ranges

display time-range { time-name | all }

Available in any view

Clear statistics about a specified or all IPv4 ACLs that are referenced by upper layer software

reset acl counter { acl-number | all | name acl-name }

Available in user view

 

2.7  IPv4 ACL Configuration Example

2.7.1  Network Requirements

As shown in Figure 2-1, a company interconnects its departments through the switch.

Configure an ACL to deny access of all departments but the President’s office to the salary query server during office hours (from 8:00 to 18:00) in working days.

2.7.2  Network Diagram

Figure 2-1 Network diagram for IPv4 ACL configuration

2.7.3  Configuration Procedure

1)         Create a time range for office hours

# Create a periodic time range spanning 8:00 to 18:00 in working days.

<Switch> system-view

[Switch] time-range trname 8:00 to 18:00 working-day

2)         Define an ACL to control access to the salary query server

# Configure a rule to control access of the R&D Department to the salary query server.

[Switch] acl number 3000

[Switch-acl-adv-3000] rule deny ip source 192.168.2.0 0.0.0.255 destination 192.168.4.1 0.0.0.0 time-range trname

[Switch-acl-adv-3000] quit

# Configure a rule to control access of the Marketing Department to the salary query server.

[Switch] acl number 3001

[Switch-acl-adv-3001] rule deny ip source 192.168.3.0 0.0.0.255 destination 192.168.4.1 0.0.0.0 time-range trname

[Switch-acl-adv-3001] quit

3)         Apply the IPv4 ACL

# Configure class c_rd for packets matching IPv4 ACL 3000.

[Switch] traffic classifier c_rd

[Switch-classifier-c_rd] if-match acl 3000

[Switch-classifier-c_rd] quit

# Configure traffic behavior b_rd to deny matching packets.

[Switch] traffic behavior b_rd

[Switch-behavior-b_rd] filter deny

[Switch-behavior-b_rd] quit

# Configure class c_market for packets matching IPv4 ACL 3001.

[Switch] traffic classifier c_market

[Switch-classifier-c_market] if-match acl 3001

[Switch-classifier-c_market] quit

# Configure traffic behavior b_ market to deny matching packets.

[Switch] traffic behavior b_market

[Switch-behavior-b_market] filter deny

[Switch-behavior-b_market] quit

# Configure QoS policy p_rd to use traffic behavior b_rd for class c_rd.

[Switch] qos policy p_rd

[Switch-qospolicy-p_rd] classifier c_rd behavior b_rd

[Switch-qospolicy-p_rd] quit

# Configure QoS policy p_market to use traffic behavior b_market for class c_market.

[Switch] qos policy p_market

[Switch-qospolicy-p_market] classifier c_market behavior b_market

[Switch-qospolicy-p_market] quit

# Apply QoS policy p_rd to interface GigabitEthernet 1/0/2.

[Switch] interface GigabitEthernet 1/0/2

[Switch-GigabitEthernet1/0/2] qos apply policy p_rd inbound

[Switch-GigabitEthernet1/0/2] quit

# Apply QoS policy p_market to interface GigabitEthernet 1/0/3.

[Switch] interface GigabitEthernet 1/0/3

[Switch-GigabitEthernet1/0/3] qos apply policy p_market inbound

 


Chapter 3  IPv6 ACL Configuration

When configuring IPv6 ACLs, go to these sections for information you are interested in:

l           Creating a Time Range

l           Configuring a Basic IPv6 ACL

l           Configuring an Advanced IPv6 ACL

l           Copying an IPv6 ACL

l           Displaying and Maintaining IPv6 ACLs

l           IPv6 ACL Configuration Example

3.1  Creating a Time Range

Refer to section Creating a Time Range.

3.2  Configuring a Basic IPv6 ACL

Basic IPv6 ACLs filter packets based on source IPv6 address. They are numbered in the range 2000 to 2999.

3.2.1  Configuration Prerequisites

If you want to reference a time range to a rule, define it with the time-range command first.

3.2.2  Configuration Procedure

Follow these steps to configure a basic IPv6 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create and enter basic IPv6 ACL view

acl ipv6 number acl6-number [ name acl6-name ] [ match-order { auto | config } ]

Required

The default match order is config.

If you specify a name for an IPv6 ACL when creating the ACL, you can use the acl ipv6 name acl6-name command to enter the view of the ACL later.

Create or modify a rule

rule [ rule-id ] { deny | permit } [ fragment | logging | source { ipv6-address prefix-length | ipv6-address/prefix-length | any } | time-range time-name ] *

Required

To create multiple rules, repeat this step.

Note that the logging and fragment keywords are not supported if the ACL is to be referenced by a QoS policy for traffic classification.

Set a rule numbering step

step step-value

Optional

The default step is 5.

Create an IPv6 ACL description

description text

Optional

By default, no IPv6 ACL description is present.

Create a rule description

rule rule-id comment text

Optional

By default, no rule description is present.

 

Note that:

l           You will fail to create or modify a rule if its permit/deny statement is exactly the same as another rule. In addition, if the ACL match order is set to auto rather than config, you cannot modify ACL rules.

l           You may use the display acl command to verify rules configured in an ACL. If the match order for this ACL is auto, rules are displayed in the depth-first match order rather than by rule number.

 

  Caution:

l      You can modify the match order of an IPv6 ACL with the acl ipv6 number acl6-number [ name acl6-name ] match-order { auto | config } command but only when it does not contain any rules.

l      The rule specified in the rule comment command must have existed.

 

3.2.3  Configuration Examples

# Create IPv6 ACL 2000 to permit IPv6 packets with source address 2030:5060::9050/64 to pass while denying IPv6 packets with source address fe80:5060::8050/96.

<Sysname> system-view

[Sysname] acl ipv6 number 2000

[Sysname-acl6-basic-2000] rule permit source 2030:5060::9050/64

[Sysname-acl6-basic-2000] rule deny source fe80:5060::8050/96

# Verify the configuration.

[Sysname-acl6-basic-2000] display acl ipv6 2000

 Basic IPv6 ACL  2000, named -none-, 2 rules,

 ACL's step is 5

 rule 0 permit source 2030:5060::9050/64

 rule 5 deny source FE80:5060::8050/96

3.3  Configuring an Advanced IPv6 ACL

Advanced ACLs filter packets based on the source IPv6 address, destination IPv6 address, protocol carried on IPv6, and other protocol header fields such as the TCP/UDP source port, TCP/UDP destination port, ICMP message type, and ICMP message code.

Advanced IPv6 ACLs are numbered in the range 3000 to 3999. Compared with basic IPv6 ACLs, they allow of more flexible and accurate filtering.

3.3.1  Configuration Prerequisites

If you want to reference a time range to a rule, define it with the time-range command first.

3.3.2  Configuration Procedure

Follow these steps to configure an advanced IPv6 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create and enter advanced IPv6 ACL view

acl ipv6 number acl6-number [ name acl6-name ] [ match-order { auto | config } ]

Required

The default match order is config.

If you specify a name for an IPv6 ACL when creating the ACL, you can use the acl ipv6 name acl6-name command to enter the view of the ACL later.

Create or modify a rule

rule [ rule-id ] { deny | permit } protocol [ destination { dest dest-prefix | dest/dest-prefix | any } | destination-port operator port1 [ port2 ] | dscp dscp | fragment | icmpv6-type { icmpv6-type icmpv6-code | icmpv6-message } | logging | source { source source-prefix | source/source-prefix | any } | source-port operator port1 [ port2 ] | time-range time-name ] *

Required

To create multiple rules, repeat this step.

Note that if the ACL is to be referenced by a QoS policy for traffic classification, the logging and fragment keywords are not supported and the operator argument cannot be neq.

Set a rule numbering step

step step-value

Optional

The default step is 5.

Create an ACL description

description text

Optional

By default, no IPv6 ACL description is present.

Create a rule description

rule rule-id comment text

Optional

By default, no rule description is present.

 

Note that:

l           You will fail to create or modify a rule if its permit/deny statement is exactly the same as another rule. In addition, if the ACL match order is set to auto rather than config, you cannot modify ACL rules.

l           You may use the display acl command to verify rules configured in an ACL. If the match order for this ACL is auto, rules are displayed in the depth-first match order rather than by rule number.

 

  Caution:

l      You can modify the match order of an IPv6 ACL with the acl ipv6 number acl6-number [ name acl6-name ] match-order { auto | config } command but only when it does not contain any rules.

l      The rule specified in the rule comment command must have existed.

 

3.3.3  Configuration Examples

# Create IPv6 ACL 3000 to permit the TCP packets with the source address 2030:5060::9050/64 to pass.

<Sysname> system-view

[Sysname] acl ipv6 number 3000

[Sysname-acl6-adv-3000] rule permit tcp source 2030:5060::9050/64

# Verify the configuration.

[Sysname-acl6-adv-3000] display acl ipv6 3000

 Advanced IPv6 ACL  3000, named -none-, 1 rule,

 ACL's step is 5

 rule 0 permit tcp source 2030:5060::9050/64

3.4  Copying an IPv6 ACL

This feature allows you to copy an existent IPv6 ACL to generate a new one, which is of the same type and has the same match order, match rules, rule numbering step and descriptions as the source IPv6 ACL.

3.4.1  Configuration Prerequisites

Make sure that the source IPv4 ACL exists while the destination IPv4 ACL does not.

3.4.2  Configuration Procedure

Follow these steps to copy an IPv6 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

Copy an existing IPv6 ACL to generate a new one of the same type

acl ipv6 copy { source-acl6-number | name source-acl6-name } to { dest-acl6-number | name dest-acl6-name }

Required

 

  Caution:

l      The source IPv6 ACL and the destination IPv6 ACL must be of the same type.

l      The generated IPv6 ACL does not take the name of the source IPv6 ACL.

 

3.5  Displaying and Maintaining IPv6 ACLs

To do…

Use the command…

Remarks

Display information about a specified or all IPv6 ACLs

display acl ipv6 { acl6-number | all | name acl6-name }

Available in any view

Display information about ACL uses of a switch

display acl resource

Available in any view

Display the configuration and status on time range

display time-range { time-name | all }

Available in any view

Clear statistics about a specified or all IPv6 ACLs that are referenced by upper layer software

reset acl ipv6 counter { acl6-number | all | name acl6-name }

Available in user view

 

3.6  IPv6 ACL Configuration Example

3.6.1  Network Requirements

As shown in Figure 3-1, a company interconnects its departments through the switch.

Configure an ACL to deny access of the R&D department to external networks.

3.6.2  Network Diagram

Figure 3-1 Network diagram for IPv6 ACL configuration

3.6.3  Configuration Procedure

# Create an IPv6 ACL 2000.

<Switch> system-view

[Switch] acl ipv6 number 2000

[Switch-acl6-basic-2000] rule deny source 4050::9000/120

[Switch-acl6-basic-2000] quit

# Configure class c_rd for packets matching IPv6 ACL 2000.

[Switch] traffic classifier c_rd

[Switch-classifier-c_rd] if-match acl ipv6 2000

[Switch-classifier-c_rd] quit

# Configure traffic behavior b_rd to deny matching packets.

[Switch] traffic behavior b_rd

[Switch-behavior-b_rd] filter deny

[Switch-behavior-b_rd] quit

# Configure QoS policy p_rd to use traffic behavior b_rd for class c_rd.

[Switch] qos policy p_rd

[Switch-qospolicy-p_rd] classifier c_rd behavior b_rd

[Switch-qospolicy-p_rd] quit

# Apply QoS policy p_rd to interface GigabitEthernet 1/0/1.

[Switch] interface GigabitEthernet 1/0/1

[Switch-GigabitEthernet1/0/1] qos apply policy p_rd inbound

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
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
新华三官网