H3C S3600 Series EPON OLT Switches Operation Manual-Release 3103-6W100

22-ACL Configuration

Chapters Download  (212.93 KB)

22-ACL Configuration

Table of Contents

1 ACL Overview·· 1-1

Introduction to IPv4 ACL· 1-1

IPv4 ACL Classification· 1-1

IPv4 ACL Naming· 1-2

IPv4 ACL Match Order 1-2

IPv4 ACL Step· 1-3

Effective Period of an IPv4 ACL· 1-4

IP Fragments Filtering with IPv4 ACL· 1-4

Introduction to IPv6 ACL· 1-4

IPv6 ACL Classification· 1-4

IPv6 ACL Naming· 1-4

IPv6 ACL Match Order 1-5

IPv6 ACL Step· 1-6

Effective Period of an IPv6 ACL· 1-6

2 IPv4 ACL Configuration· 2-1

Creating a Time Range· 2-1

Configuration Procedure· 2-1

Configuration Example· 2-2

Configuring a Basic IPv4 ACL· 2-2

Configuration Prerequisites· 2-2

Configuration Procedure· 2-2

Configuration Example· 2-4

Configuring an Advanced IPv4 ACL· 2-4

Configuration Prerequisites· 2-4

Configuration Procedure· 2-4

Configuration Example· 2-6

Configuring an Ethernet Frame Header ACL· 2-6

Configuration Prerequisites· 2-6

Configuration Procedure· 2-6

Configuration Example· 2-8

Copying an IPv4 ACL· 2-8

Configuration Prerequisites· 2-8

Configuration Procedure· 2-8

Displaying and Maintaining IPv4 ACLs· 2-9

IPv4 ACL Configuration Example· 2-9

Network Requirements· 2-9

Configuration Procedure· 2-10

3 IPv6 ACL Configuration· 3-1

Creating a Time Range· 3-1

Configuring a Basic IPv6 ACL· 3-1

Configuration Prerequisites· 3-1

Configuration Procedure· 3-1

Configuration Example· 3-2

Configuring an Advanced IPv6 ACL· 3-3

Configuration Prerequisites· 3-3

Configuration Procedure· 3-3

Configuration Example· 3-5

Copying an IPv6 ACL· 3-5

Configuration Prerequisites· 3-5

Configuration Procedure· 3-5

Displaying and Maintaining IPv6 ACLs· 3-5

IPv6 ACL Configuration Example· 3-6

Network Requirements· 3-6

Configuration Procedure· 3-6

 


An access control list (ACL) is a set of rules (that is, a set of permit or deny statements) for identifying traffic based on matching criteria such as source address, destination address, and port number. The selected traffic will then be permitted or rejected by predefined security policies.

ACLs are widely used in technologies where traffic identification is desired, such as packet filtering and QoS.

 

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

 

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

l          Introduction to IPv4 ACL

l          Introduction to IPv6 ACL

Introduction to IPv4 ACL

This section covers these topics:

l          IPv4 ACL Classification

l         

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

IPv4 ACL Classification

IPv4 ACLs, identified by ACL numbers, fall into three 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 over 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

 

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 its name.

 

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.

 

IPv4 ACL Match Order

An ACL may consist of multiple rules, which specify different matching criteria. These criteria may have overlapping or conflicting parts. The match order is for determining how packets should be matched against the rules.

Two match orders are available for IPv4 ACLs:

l          config: Packets are compared against ACL rules in the order the rules are configured.

l          auto: Packets are compared against ACL rules in the depth-first match order.

The term depth-first match has different meanings for different types of ACLs:

Depth-first match for a basic IPv4 ACL

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

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

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.

Depth-first match for an advanced IPv4 ACL

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

1)        Sort rules by the protocol carried over IP. A rule with no limit to the protocol type (that is, configured with the ip keyword) has the lowest precedence. Rules each of which has a single specified protocol type are of the same precedence level.

2)        If the protocol types have the same precedence, look at the source IP address wildcards. Then, compare packets against the rule configured with more zeros in the source IP address wildcard.

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.

4)        If the numbers of zeros in the destination IP address wildcards are the same, look at the Layer 4 port number ranges, namely the TCP/UDP port number ranges. Then compare packets against the rule configured with the smaller port number range.

5)        If the port number ranges are the same, compare packets against the rule configured first.

Depth-first match for an Ethernet frame header ACL

The following shows how your device 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.

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.

3)        If the numbers of ones in the destination MAC address masks are the same, compare packets against the one configured first.

The comparison of a packet against ACL rules stops immediately after a match is found. The packet is then processed as per the rule.

IPv4 ACL Step

Meaning of the step

The step defines the difference between two neighboring numbers that are automatically assigned to ACL rules by the device. 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.

Benefits of using the step

With the step and rule numbering/renumbering mechanism, you do not need to assign numbers to rules when defining them. The system will assign a newly defined rule a number that is the smallest multiple of the step bigger than the current 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.

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 becomes active.

IP Fragments Filtering with IPv4 ACL

Traditional packet filtering performs match operation on only the first fragments. All subsequent non-first fragments are handled in the way the first fragments are handled. As attackers may fabricate non-first fragments to attack your network, this results in security risks. To address the risks, the device implements the following packet filtering functions:

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.

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

IPv6 ACL Classification

IPv6 ACLs, identified by ACL numbers, fall into two categories, as shown 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 over IPv6, and other Layer 3 or Layer 4 protocol header information

 

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 its name.

 

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.

 

IPv6 ACL Match Order

Similar to IPv4 ACLs, an IPv6 ACL consists of multiple rules, each of which specifies different matching criteria. These criteria may have overlapping or conflicting parts. The match order is for determining how a packet should be matched against the rules.

Two match orders are available for IPv6 ACLs:

l          config: Packets are compared against ACL rules in the order the rules are configured.

l          auto: Packets are compared against ACL rules in the depth-first match order.

The term depth-first match has different meanings for different types of ACLs:

Depth-first match for a basic IPv6 ACL

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

1)        Sort rules by source IPv6 address prefix first and compare packets against the rule configured with a longer prefix for the source IPv6 address.

2)        In case of a tie, compare packets against the rule configured first.

Depth-first match for an advanced IPv6 ACL

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

1)        Look at the protocol type field in the rules first. A rule with no limit to the protocol type (that is, configured with the ipv6 keyword) has the lowest precedence. Rules each of which has a single specified protocol type are of the same precedence level. Compare packets against the rule with the highest precedence.

2)        In case of a tie, look at the source IPv6 address prefixes. Then, compare packets against the rule configured with a longer prefix for the source IPv6 address.

3)        If the prefix lengths for the source IPv6 addresses are the same, look at the destination IPv6 address prefixes. Then, compare packets against the rule configured with a longer prefix for the destination IPv6 address.

4)        If the prefix lengths for the destination IPv6 addresses are the same, look at the Layer 4 port number ranges, namely the TCP/UDP port number ranges. Then compare packets against the rule configured with the smaller port number range.

5)        If the port number ranges are the same, compare packets against the rule configured first.

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

IPv6 ACL Step

Refer to IPv4 ACL Step.

Effective Period of an IPv6 ACL

Refer to Effective Period of an IPv4 ACL.

 


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

Creating a Time Range

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.

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-range-name { start-time to end-time days [ from time1 date1 ] [ to time2 date2 ] | from time1 date1 [ to time2 date2 ] | to time2 date2 }

Required

Display the configuration and status of one or all time ranges

display time-range { time-range-name | all }

Optional

Available in any view

 

You may create a maximum of 256 time ranges.

A time range can be one of the following:

l          Periodic time range created using the time-range time-range-name start-time to end-time days command. A time range thus created recurs periodically on the day or days of the week. A periodic time range is active only when the system time falls within it.

l          Absolute time range created using the time-range time-range-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-range-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.

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.

If you do not specify the start time and date, the time range starts from the earliest time that the system supports, namely 00:00 01/01/1970. If you do not specify the end time and date, the time range ends at the latest time that the system supports, namely 24:00 12/31/2100.

Configuration Example

# Create a 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

# Verify the configuration.

[Sysname] display time-range test

Current time is 13:27:32 4/16/2005 Saturday

Time-range : test ( Inactive )

08:00 to 18:00 working-day

Configuring a Basic IPv4 ACL

Basic IPv4 ACLs match packets based on only source IP address. They are numbered from 2000 to 2999.

Configuration Prerequisites

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

Configuration Procedure

Follow these steps to configure a basic IPv4 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create a basic IPv4 ACL and enter its 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-range-name ] *

Required

To create or modify multiple rules, repeat this step.

Currently, the logging keyword is not supported on the S3600 series Ethernet PON OLT switches.

Set the rule numbering step

step step-value

Optional

5 by default

Configure a description for the basic IPv4 ACL

description text

Optional

By default, a basic IPv4 ACL has no ACL description.

Configure a rule description

rule rule-id comment text

Optional

By default, an IPv4 ACL rule has no rule description.

 

Note that:

l          After applying a QoS policy that references a basic IPv4 ACL for traffic classification, you cannot modify the rules of the ACL any more.

l          You can only modify the existing rules of an ACL that uses the match order of config. When modifying a rule of such an ACL, you may choose to change just some of the settings, in which case the other settings remain the same.

l          You cannot create a rule with, or modify a rule to have, the same permit/deny statement as an existing rule in the ACL.

l          When the ACL match order is auto, a newly created rule will be inserted among the existing rules in the depth-first match order. Note that the IDs of the rules still remain the same.

 

 

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 the ACL does not contain any rules.

l          The rule specified in the rule comment command must already exist.

 

Configuration Example

# Configure IPv4 ACL 2000 to deny packets with source address 1.1.1.1.

<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 (5 times matched)

Configuring an Advanced IPv4 ACL

Advanced IPv4 ACLs match packets based on source IP address, destination IP address, protocol carried over IP, and other protocol header fields, such as the TCP/UDP source port number, TCP/UDP destination port number, TCP flag, 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.

Configuration Prerequisites

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

Configuration Procedure

Follow these steps to configure an advanced IPv4 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create an advanced IPv4 ACL and enter its 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 [ { ack ack-value | fin fin-value | psh psh-value | rst rst-value | syn syn-value | urg urg-value } * | destination { dest-addr dest-wildcard | any } | destination-port operator port1 [ port2 ] | dscp dscp | 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-range-name | tos tos ] *

Required

To create or modify multiple rules, repeat this step.

Currently, the logging keyword is not supported on the S3600 series Ethernet PON OLT switches.

Set the rule numbering step

step step-value

Optional

5 by default

Configure a description for the advanced IPv4 ACL

description text

Optional

By default, an advanced IPv4 ACL has no ACL description.

Configure a rule description

rule rule-id comment text

Optional

By default, an IPv4 ACL rule has no rule description.

 

Note that

l          For an advanced IPv4 ACL to be referenced by a QoS policy for traffic classification, you cannot configure the neq and reflective keywords.

l          After applying a QoS policy that references an advanced IPv4 ACL for traffic classification, you cannot modify the rules of the ACL any more.

l          You can only modify the existing rules of an ACL that uses the match order of config. When modifying a rule of such an ACL, you may choose to change just some of the settings, in which case the other settings remain the same.

l          You cannot create a rule with, or modify a rule to have, the same permit/deny statement as an existing rule in the ACL.

l          When the ACL match order is auto, a newly created rule will be inserted among the existing rules in the depth-first match order. Note that the IDs of the rules still remain the same.

 

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 the ACL does not contain any rules.

l          The rule specified in the rule comment command must already exist.

 

Configuration Example

# Configure IPv4 ACL 3000 to permit TCP packets with the destination port number of 80 from 129.9.0.0 to 202.38.160.0.

<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 (5 times matched)

Configuring an Ethernet Frame Header ACL

Ethernet frame header ACLs match 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.

Configuration Prerequisites

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

Configuration Procedure

Follow these steps to configure an Ethernet frame header ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create an Ethernet frame header ACL and enter its 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-range-name | type type-code type-wildcard ] *

Required

To create or modify multiple rules, repeat this step.

The lsap and type keywords cannot appear in a rule at the same time.

Set the rule numbering step

step step-value

Optional

5 by default

Configure a description for the Ethernet frame header ACL

description text

Optional

By default, an Ethernet frame header ACL has no ACL description.

Configure a rule description

rule rule-id comment text

Optional

By default, an Ethernet frame header ACL rule has no rule description.

 

Note that:

l          For an Ethernet frame header ACL to be referenced by a QoS policy for traffic classification, you cannot configure the lsap keyword.

l          After applying a QoS policy that references an Ethernet frame header ACL for traffic classification, you cannot modify the rules of the ACL any more.

l          You can only modify the existing rules of an ACL that uses the match order of config. When modifying a rule of such an ACL, you may choose to change just some of the settings, in which case the other settings remain the same.

l          You cannot create a rule with, or modify a rule to have, the same permit/deny statement as an existing rule in the ACL.

l          When the ACL match order is auto, a newly created rule will be inserted among the existing rules in the depth-first match order. Note that the IDs of the rules still remain the same.

 

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 the ACL does not contain any rules.

l          The rule specified in the rule comment command must already exist.

 

Configuration Example

# Configure 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(5 times matched)

Copying an IPv4 ACL

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

Configuration Prerequisites

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

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

 

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

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

 

Displaying and Maintaining IPv4 ACLs

To do...

Use the command…

Remarks

Display information about one or all IPv4 ACLs

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

Available in any view

Display the usage of ACL resources

display acl resource

Available in any view

Display the configuration and status of one or all time ranges

display time-range { time-range-name | all }

Available in any view

Clear statistics on one or all IPv4 ACLs

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

Available in user view

 

IPv4 ACL Configuration Example

For QoS policy configuration details and the relevant commands, refer to QoS Configuration.

 

Network Requirements

As shown in Figure 2-1, an S3600 series Ethernet PON OLT switch connects two ONU devices through two interfaces (Onu 1/0/1:1 and Onu 1/0/1:2), and the ONU devices are both for connecting the hosts of end users.

Configure an ACL to forbid users from accessing the server (192.168.4.1) through ONU 1. Users of ONU 2 can access the server at any time.

Figure 2-1 Network diagram for ACL configuration

 

Configuration Procedure

1)            Configure an ACL for restricting access to the server

# Create an ACL and add a rule for restricting access to the server.

<Switch> system-view

[Switch] acl number 3000

[Switch-acl-adv-3000] rule deny ip source any destination 192.168.4.1 0.0.0.0

[Switch-acl-adv-3000] quit

2)            Apply the QoS policy

# Create class c_1 and configure it to deal with packets matching ACL 3000.

[Switch] traffic classifier c_1

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

[Switch-classifier-c_1] quit

# Create a traffic behavior and configure the traffic filtering action as deny.

[Switch] traffic behavior b_1

[Switch-behavior-b_1] filter deny

[Switch-behavior-b_1] quit

# Create QoS policy p_1 and configure it to use behavior b_1 for class c_1.

[Switch] qos policy p_1

[Switch-qospolicy-p_1] classifier c_1 behavior b_1

[Switch-qospolicy-p_1] quit

# Apply QoS policy p_1 to interface Onu 1/0/1:1.

[Switch] interface Onu 1/0/1:1

[Switch-Onu1/0/1:1] qos apply policy p_1 inbound

 

If it is required to forbid a certain host from accessing the server, you need to configure an Ethernet frame header ACL, using the MAC address of the host as the source MAC address for matching, configure a QoS policy to deny packets matching the ACL, and apply the QoS policy to the interface of the ONU device connecting the host.

 


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

Creating a Time Range

Refer to Creating a Time Range.

Configuring a Basic IPv6 ACL

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

Configuration Prerequisites

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

Configuration Procedure

Follow these steps to configure an IPv6 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create a basic IPv6 ACL view and enter its 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-range-name ] *

Required

To create or modify multiple rules, repeat this step.

Currently, the logging keyword is not supported on the S3600 series Ethernet PON OLT switches.

Set the rule numbering step

step step-value

Optional

5 by default

Configure a description for the basic IPv6 ACL

description text

Optional

By default, a basic IPv6 ACL has no ACL description.

Configure a rule description

rule rule-id comment text

Optional

By default, an IPv6 ACL rule has no rule description.

 

Note that:

l          For a basic IPv6 ACL to be referenced by a QoS policy for traffic classification, you cannot configure the fragment keywords

l          After applying a QoS policy that references a basic IPv6 ACL for traffic classification, you cannot modify the rules of the ACL any more.

l          You can only modify the existing rules of an ACL that uses the match order of config. When modifying a rule of such an ACL, you may choose to change just some of the settings, in which case the other settings remain the same.

l          You cannot create a rule with, or modify a rule to have, the same permit/deny statement as an existing rule in the ACL.

l          When the ACL match order is auto, a newly created rule will be inserted among the existing rules in the depth-first match order. Note that the IDs of the rules still remain the same.

 

 

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 the ACL does not contain any rules.

l          The rule specified in the rule comment command must already exist.

 

Configuration Example

# Configure IPv6 ACL 2000 to permit IPv6 packets with the source address of 2030:5060::9050/64 and deny IPv6 packets with the source address of 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 (4 times matched)

 rule 5 deny source FE80:5060::8050/96 (5 times matched)

Configuring an Advanced IPv6 ACL

Advanced IPv6 ACLs match packets based on the source IPv6 address, destination IPv6 address, protocol carried over IPv6, and other protocol header fields such as the TCP/UDP source port number, TCP/UDP destination port number, 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.

Configuration Prerequisites

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

Configuration Procedure

Follow these steps to configure an advanced IPv6 ACL:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Create an advanced IPv6 ACL and enter its 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 [ { ack ack-value | fin fin-value | psh psh-value | rst rst-value | syn syn-value | urg urg-value } * | 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-range-name ] *

Required

To create or modify multiple rules, repeat this step.

Currently, the logging keyword is not supported on the S3600 series Ethernet PON OLT switches.

Set the rule numbering step

step step-value

Optional

5 by default

Configure a description for the advanced IPv6 ACL

description text

Optional

By default, an advanced IPv6 ACL has no ACL description.

Configure a rule description

rule rule-id comment text

Optional

By default, an IPv6 ACL rule has no rule description.

 

Note that:

l          For an advanced IPv6 ACL to be referenced by a QoS policy for traffic classification, you cannot configure the neq, fragment, and reflective keywords.

l          After applying a QoS policy that references an advanced IPv6 ACL for traffic classification, you cannot modify the rules of the ACL any more.

l          You can only modify the existing rules of an ACL that uses the match order of config. When modifying a rule of such an ACL, you may choose to change just some of the settings, in which case the other settings remain the same.

l          You cannot create a rule with, or modify a rule to have, the same permit/deny statement as an existing rule in the ACL.

l          When the ACL match order is auto, a newly created rule will be inserted among the existing rules in the depth-first match order. Note that the IDs of the rules still remain the same.

 

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 the ACL does not contain any rules.

l          The rule specified in the rule comment command must already exist.

 

Configuration Example

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

<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 (5 times matched)

Copying an IPv6 ACL

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

Configuration Prerequisites

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

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

 

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

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

 

Displaying and Maintaining IPv6 ACLs

To do…

Use the command…

Remarks

Display information about one or all IPv6 ACLs

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

Available in any view

Display the usage of ACL resources

display acl resource

Available in any view

Display the configuration and status of one or all time ranges

display time-range { time-range-name | all }

Available in any view

Clear statistics on one or all basic and advanced IPv6 ACLs

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

Available in user view

 

IPv6 ACL Configuration Example

Network Requirements

Configure interface Onu 1/0/1:1 to deny IPv6 packets with the source IPv6 address being in the range from 4050::9000 to 4050::90FF and to permit all other packets.

Configuration Procedure

# Configure an IPv6 ACL to match IPv6 packets with the source address being in the range from 4050::9000 to 4050::90FF

<Sysname> system-view

[Sysname] acl ipv6 number 2000

[Sysname-acl6-basic-2000] rule permit source 4050::9000/120

[Sysname-acl6-basic-2000] quit

# Create class c1 and configure it to deal with packets matching ACL 3000.

[Switch] traffic classifier c1

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

[Switch-classifier-c1] quit

# Create traffic behavior b1 and configure the traffic filtering action as deny.

[Switch] traffic behavior b1

[Switch-behavior-b1] filter deny

[Switch-behavior-b1] quit

# Create QoS policy p1 and configure it to use behavior b1 for class c1.

[Switch] qos policy p1

[Switch-qospolicy-p1] classifier c1 behavior b1

[Switch-qospolicy-p1] quit

# Apply QoS policy p1 to interface Onu 1/0/1:1.

[Switch] interface Onu1/0/1:1

[Switch-Onu1/0/1:1] qos apply policy p1 inbound


H3C reserves the right to modify its collaterals without any prior notice. For the latest information of the collaterals, please consult H3C sales or call 400 hotline.