01-02 ACL Configuration
01-02 ACL Configuration
Switches
Configuration Guide - Security 2 ACL Configuration
2 ACL Configuration
This chapter describes how to configure access control lists (ACLs) on devices.
2.1 Overview of ACLs
2.2 Understanding ACLs
2.3 Application Scenarios for ACLs
2.4 Licensing Requirements and Limitations for ACLs
2.5 Summary of ACL Configuration Tasks
2.6 Default Settings for ACLs
2.7 Configuring and Applying a Basic ACL
2.8 Configuring and Applying an Advanced ACL
2.9 Configuring and Applying a Layer 2 ACL
2.10 Configuring and Applying a User-Defined ACL
2.11 Configuring and Applying a User ACL
2.12 Configuring and Applying a Basic ACL6
2.13 Configuring and Applying an Advanced ACL6
2.14 Maintaining ACLs
2.15 Configuration Examples for ACLs
2.16 Troubleshooting ACLs
2.17 FAQ About ACLs
Definition
Access Control Lists (ACLs) filter packets based on rules that define the packet
filtering conditions, such as the source address, destination address, and port
number of packets.
An ACL is a packet filter, while ACL rules are the filter elements. Based on ACL
rules, a device perform packet filtering to control whether to forward or discard
packets that match the rules according to the policies used by the service module
to which the ACL is applied.
An ACL can be applied to various service modules, such as Telnet, FTP, and
routing. Usually, an ACL is applied to a traffic policy or simplified traffic policy.
This enables the device to deliver ACL rules globally, in a VLAN, or on an interface
to filter packets to be forwarded. The service modules use different actions and
mechanisms to process the packets filtered by ACL. For details, see 2.2.7 Default
ACL Actions and Mechanisms of Different Service Modules.
NOTE
Purpose
The fast growth of network technologies brings challenges to network security
and Quality of Service (QoS). ACL is a security policy that is enforced on networks
to prevent the following problems:
● To prevent information leaks and unauthorized access of resources on key
servers of an enterprise network
● To prevent viruses on the Internet from entering and spreading on the
enterprise intranet
● To prevent random services from occupying network bandwidth, thereby
guaranteeing bandwidth for delay-sensitive services such as voice and video
These problems are detrimental to network communication, so network security is
critical.
ACL accurately identifies and controls packets on the network to manage network
access behaviors, prevent network attacks, and improve bandwidth use efficiency.
In this way, ACL ensures security and high service quality on networks.
Figure 2-1 shows a typical network with ACL configured.
Int
erf
R&D ac
192.168.2.0/24
e1
Internet
2
face Interface 3
Inter
Switch Router
VLAN20
Permitted packets
President office Denied packets
192.168.3.0/24
● To ensure financial data security, access to the financial server is allowed only
from the president office; access from the R&D department to the financial
server is blocked. The implementation method is as follows:
Configure an ACL in the inbound direction of Interface 1 to block the packets
from the R&D department to the financial server. The ACL does not need to
be configured on Interface 2, so the packets from the president office to the
financial server are allowed.
● Protect the enterprise intranet against viruses entering and spreading from
the Internet. The implementation method is as follows:
Configure an ACL in the inbound direction of Interface 3 to block packets that
match virus signatures.
Related Information
Support Community
● ACL Application
● Basic Knowledge About ACL
● ACL Matching
An ACL matches packets against the rules in contains to filter packets. The device
supports software and hardware-based ACLs. The two types of ACLs differ in types
of packets to be filtered, filter methods, and actions to be taken on the packets
that do not match any rule.
ACL Structure
Figure 2-2 shows the structure of an ACL.
ACL number
Time Range
acl number 2000
Action Source IP
rule 4294967294 deny
Matching Mechanism
The device stops matching packets against ACL rules as long as the packets match
one rule, as shown in Figure 2-3.
Start
No
Yes
No
Does the ACL contain
rules?
Yes
Yes permit
Is the ACL
Do packets
action permit or
match the rule?
deny?
No
deny
No
Are there other
rules?
Yes
Packets do not
Result is deny Result is permit
match a rule
Analyze the next
rule
End
▪ When the packets match a permit rule, the device stops matching
and returns the result "positive match (permit)."
▪ When the packets match a deny rule, the device stops matching and
returns the result "positive match (deny)."
▪ If the packets do not match any rule in the ACL, the device returns
the result "negative match."
The ACL matching results include "positive match" and "negative match."
● Positive match: Packets match a rule in an ACL.
The result is "positive match" regardless of whether packets match a permit
or deny rule in an ACL.
● Negative match: No ACL exists, the ACL does not contain rules, or packets do
not match any rule in an ACL.
Different service modules process the packets that match and do not match ACL
rules in different ways. For example, the Telnet module forwards the packets
matching the permit rules. Conversely, the traffic policy module discards the
packets matching the permit rule if the action configured in the traffic policy
module is deny. For details about ACL processing in each service module, see 2.2.7
Default ACL Actions and Mechanisms of Different Service Modules.
● They take different actions on the packets that do not match any ACL rule.
When packets do not match any ACL rule, software-based ACL rejects the
packets, whereas hardware-ACL permits the packets.
You can specify a number for a created ACL. Different types of ACLs have different
number ranges, as described in Table 2-1. You can also specify a name for the
created ACL to help you remember the ACL's purpose. A named ACL consists of a
name and number. That is, you can specify an ACL number when you define an
ACL name. If you do not specify a number for a numbered ACL, the device
automatically allocates a number to it.
NOTE
The name of a named ACL cannot be modified. Deleting an ACL name will delete the ACL.
Repeated ACL names can only be used between basic ACL and basic ACL6, and between
advanced ACL and advanced ACL6.
In this document, ACL refers to ACL4, ACL6, and the ACL supporting both IPv4 and
IPv6 packet filtering. Table 2-1 describes how each type of ACLs support IPv4 and
IPv6 packets.
2.2.3 Step
What Is a Step
A step is an increment between neighboring rule IDs automatically allocated by
the system.
If a rule is added to an empty ACL without a rule ID manually specified, the
system allocates the step value as the ID to this rule. If an ACL contains rules with
manually configured IDs and a new rule is added without an ID manually
configured, the system allocates to this new rule the minimum multiple of the
step value which is greater than the largest rule ID in the ACL. Rule IDs must be
integers. For example, an ACL (basic ACL, advanced ACL, Layer 2 ACL, user ACL,
user-defined ACL) contains rule 5 and rule 12, and the default step is 5. When a
new rule is added to the ACL, the system allocates ID 15 to this new rule (15 is
greater than 12 and is the minimum multiple of 5).
NOTE
Basic ACL6 and advanced ACL6 do not support step configuration, and use a step of 1.
[HUAWEI-acl-basic-2001] display this
#
acl number 2001 //Empty ACL
#
return
[HUAWEI-acl-basic-2001] rule deny source 10.1.1.0 0.0.0.255 //Configure the first rule without specifying
an ID.
[HUAWEI-acl-basic-2001] display this
#
acl number 2001
rule 5 deny source 10.1.1.0 0.0.0.255
#
return
[HUAWEI-acl-basic-2001] rule 12 deny source 10.2.2.0 0.0.0.255 //Configure a rule with ID 12.
[HUAWEI-acl-basic-2001] display this
#
acl number 2001
rule 5 deny source 10.1.1.0 0.0.0.255
rule 12 deny source 10.2.2.0 0.0.0.255
#
return
[HUAWEI-acl-basic-2001] rule deny source 10.3.3.0 0.0.0.255 //Configure another rule without specifying
an ID.
[HUAWEI-acl-basic-2001] display this
#
acl number 2001
rule 5 deny source 10.1.1.0 0.0.0.255
rule 12 deny source 10.2.2.0 0.0.0.255
rule 15 deny source 10.3.3.0 0.0.0.255
#
return
If the step value of an ACL is changed, the system reallocates IDs to rules in the
ACL. For example, when the step value is changed to 2, the system allocates 2, 4,
6... to rules. After the step is restored to the default value, the system reallocates
IDs to the rules using the default step, that is, 5, 10, 15....
[HUAWEI-acl-basic-2001] display acl 2001
Basic ACL 2001, 3 rules
Acl's step is 5
rule 5 deny source 10.1.1.0 0.0.0.255
rule 12 deny source 10.2.2.0 0.0.0.255
rule 15 deny source 10.3.3.0 0.0.0.255
[HUAWEI-acl-basic-2001] step 2 //Set the step to 2
[HUAWEI-acl-basic-2001] display acl 2001
Basic ACL 2001, 3 rules
Acl's step is 2
rule 2 deny source 10.1.1.0 0.0.0.255
rule 4 deny source 10.2.2.0 0.0.0.255
rule 6 deny source 10.3.3.0 0.0.0.255
For example, an ACL contains rule 5, rule 10, and rule 15. The network
administrator wants to add a rule that denies the packets from source IP address
10.1.1.3. The rules are as follows:
rule 5 deny source 10.1.1.1 0 //Reject the packets from source IP address 10.1.1.1.
rule 10 deny source 10.1.1.2 0 //Reject the packets from source IP address 10.1.1.2.
rule 15 permit source 10.1.1.0 0.0.0.255 //Reject the packets from source IP address segment 10.1.1.0/24.
The system stops matching packets once the packets match a rule. The packets
from source addresses 10.1.1.1 and 10.1.1.2 match rule 5 and rule 10, and are
therefore discarded. The packets from source address 10.1.1.3 match rule 15, and
are therefore forwarded. To deny the packets from source IP address 10.1.1.3, add
a new deny rule. You can add rule 11 before rule 15 so that the packets from
source IP address 10.1.1.3 match rule 11 and are discarded. Rule 11 does not
affect existing rule IDs in the ACL. The rule IDs are 5, 10, 11, and 15.
rule 5 deny source 10.1.1.1 0 //Reject the packets from source IP address 10.1.1.1.
rule 10 deny source 10.1.1.2 0 //Reject the packets from source IP address 10.1.1.2.
rule 11 deny source 10.1.1.3 0 //Reject the packets from source IP address 10.1.1.3.
rule 15 permit source 10.1.1.0 0.0.0.255 //Reject the packets from source IP address segment 10.1.1.0.
To add a rule to an ACL with the step value of 1 (rule 1, rule 2, rule 3...), you must
first delete existing rules. Then, add the new rule and reconfigure the deleted
rules.
An ACL consists of multiple deny | permit clauses, each of which describes a rule.
These rules may repeat or conflict. For example, an ACL contains two rules:
rule deny ip destination 10.1.0.0 0.0.255.255 //Reject the packets destined for network segment 10.1.0.0/16.
rule permit ip destination 10.1.1.0 0.0.0.255 //Permit the packets destined for network segment
10.1.1.0/24, which has a smaller range than 10.1.0.0/16.
The permit and deny rules conflict. If the system first matches a packet destined
for 10.1.1.1 against the deny rule, the packet is discarded. However, if the system
matches the packet against the permit rule first, the packet is forwarded.
Therefore, if ACL rules repeat or conflict, the matching order decides the matching
result.
The device supports two matching orders: the configuration order (config) and
the automatic order (auto). The default order is config.
Config Order
The system matches packets against ACL rules in ascending order of rule IDs. That
is, the rule with the smallest ID is processed first.
● If a smaller rule ID is manually specified for a rule, the rule is inserted in one
of the front lines of an ACL. This rule is processed earlier.
● If no ID is manually specified for a rule, the system allocates an ID to the rule.
The rule ID is greater than the largest rule ID in the ACL and is the minimum
multiple of the step; therefore, this rule is processed last.
Auto Order
The system arranges rules according to the precision degree of the rules (depth
first principle), and matches packets against the rules in descending order of
precision. A rule with the highest precision defines strictest conditions, and has the
highest priority. The system matches packets against this rule first. Table 2-2
describes how the auto order is applied to each type of ACL.
For details about the ACL matching conditions mentioned in Table 2-2, such as IP
address wildcard mask, types of protocols carried by IP, TCP/UDP ports, Layer 2
protocol type wildcard mask, and MAC address wildcard mask, see 2.2.5 Matching
Conditions.
Basic ACL 1. The rule that defines a VPN instance is processed first.
and basic 2. The rule that defines the smallest source IP address range is
ACL6 processed. The wildcard mask with the most 0 bits identifies the
smallest source IP address range.
3. If the source IP address ranges are the same, the rule with the
smallest ID is processed.
Layer 2 1. The rule with the largest L2 protocol type wildcard (with the
ACL most 1 bit in the wildcard mask) is processed first.
2. The rule that defines the smallest source MAC address range is
processed. The wildcard mask with the most 1 bit identifies the
smallest source MAC address range.
3. If the source MAC address ranges are the same, the rule that
defines the smallest destination MAC address range is processed.
The wildcard mask with the most 1 bit identifies the smallest
destination MAC address range.
4. If the source and destination MAC address ranges are the same,
the rule with the smallest ID is processed.
User ACL 1. The rule that defines a protocol type is processed first.
2. If the protocol types are the same, the source IP address ranges
are compared. If all source IP addresses are IP network segments,
the rule with a smaller source IP address (with more 0 bits in
wildcard mask) is processed. If not all the source IP addresses are
IP network segments, the rule in which the source IP address is
an IP network segment is processed earlier than the rule in
which the source IP address is a UCL group.
3. If the protocol types and source IP address ranges are the same,
the destination IP address ranges are compared. If all destination
IP addresses are IP network segments, the rule with a smaller
destination IP address (with more 0 bits in wildcard mask) is
processed. If not all the destination IP addresses are IP network
segments, the rule in which the destination IP address is an IP
network segment is processed earlier than the rule in which the
destination IP address is a UCL group.
4. If the protocol types, source IP address ranges, and destination IP
address ranges are the same, the rule that defines the smallest
Layer 4 port number (TCP/UDP port number) range is processed.
5. If the preceding ranges are all the same, the rule with the
smallest ID is processed.
If you add a rule to an ACL in auto mode, the system automatically identifies the
rule priority and assigns an ID to the rule.
For example, two rules are added to advanced ACL 3001 in auto mode:
rule deny ip destination 10.1.0.0 0.0.255.255 //Reject the packets destined for network segment 10.1.0.0/16.
rule permit ip destination 10.1.1.0 0.0.0.255 //Permit the packets destined for network segment
10.1.1.0/24, which has a smaller range than 10.1.0.0/16.
The two rules do not specify VPN instances, and specify identical protocol range
and source IP address range. According to the auto matching principle in Table
2-2, the system compares the destination IP address ranges in the rules. The
destination IP address range specified in the permit rule is smaller than that
specified in the deny rule, so the permit rule has a higher precision. The system
allocates a smaller ID to the permit rule. Therefore, the system arranges the two
rules in ACL 3001 in the following order:
#
acl number 3001 match-order auto
rule 5 permit ip destination 10.1.1.0 0.0.0.255
rule 10 deny ip destination 10.1.0.0 0.0.255.255
#
A rule rule deny ip destination 10.1.1.1 0 is added to ACL 3001. (This rule has a
higher priority than the previous two rules because the destination IP address is a
host address.) The system reassigns IDs to the rules according to the rule
priorities. The new order is as follows:
#
acl number 3001 match-order auto
rule 5 deny ip destination 10.1.1.1 0
Compared with the config mode, auto mode is more complex; however, it offers
advantages in some scenarios. For example, to ensure network security, the
administrator has configured an ACL in auto mode to discard all IP packets in
untrusted network segments. When more services are deployed on the network,
some IP packets on these network segments need to be allowed. The
administrator needs to add new rules to the ACL, but does not need to rearrange
the rules to avoid incorrect packet discarding.
Time Range
Format: time-range time-name
All ACLs support packet filtering based on time ranges. For details about time
ranges, see 2.2.6 Time Range.
address to be checked. Among the bits in a mask, the value 0 indicates "check"
and the value 1 indicates "not check." An IP address subnet mask must have
continuous 0s and 1s, whereas a wildcard mask can have discontinuous 0s and 1s.
For example, configure a rule with an IP address wildcard mask specified to permit
all IP packets from network segment 192.168.1.0/24:
rule 5 permit ip source 192.168.1.0 0.0.0.255
In this rule, the wildcard mask is 0.0.0.255, indicating that only the bits in the
binary bytes in the first three groups in the IP address are checked. Packets are
permitted only if the first 24 bits in the source IP address are the same as the first
24 bits in the specified IP address (192.168.1). That is, only the packets sent from
source IP address segment 192.168.1.0/24 are permitted. Table 2-3 illustrates how
the address range is calculated.
Table 2-5 Determining address ranges by MAC addresses and wildcard masks
MAC Address MAC Address Wildcard Determined Address Range
Mask
A Layer 2 ACL can filter packets based on outer and inner VLAN IDs.
When the VLAN IDs are configured as matching conditions, the VLAN mask can be
specified behind the VLAN IDs to determine a VLAN range.
A VLAN mask is in the hexadecimal format, ranging from 0x0 to 0xFFF. If the
VLAN mask is not specified, the default mask 0xFFF is used, indicating that every
bit in the VLAN ID is checked.
Table 2-6 illustrates how a VLAN ID and a mask determine a VLAN range.
When the protocol type of an advanced ACL is specified as TCP or UDP, the device
can filter packets based on TCP or UDP source/destination port numbers.
TCP Flag
Format: tcp-flag { ack | established | fin | psh | rst | syn | urg }*
When the TCP protocol is specified in an advanced ACL, the device filters packets
based on the TCP flag.
IP Fragmentation
Format: fragment
A basic ACL and an advanced ACL can filter packets based on IP fragmentation
information.
The fragments of an IP packet include the initial fragment and non-initial
fragments. Only the initial fragment contains Layer 4 information, such as TCP
and UDP port numbers. A network device checks whether a received fragment is
the last fragment. If the fragment is not the last, the device allocates memory
space for it, and reassembles the fragments after the last fragment is received.
The device does not release memory until the last fragment is received and all
fragments are reassembled. However, an exploit exists whereby an attacker may
send fragments to a device without sending the last fragment. If a large enough
number of fragments are sent in a short period, the device cannot process other
services due to insufficient memory resources. To mitigate such an attack, the
device starts a reassembling timer. If reassembly cannot be finished before the
timer expires, the device returns an ICMP Error packet to the sender. If reassembly
cannot be finished after the timer expires, the device discards the fragments
stored in memory.
To prevent fragment packet attacks, you can specify the fragment keyword in an
ACL rule to block non-initial fragments.
Table 2-9 describes how the ACLs process non-fragment packets, initial fragments,
and non-initial fragments.
Background
An ACL contains various matching conditions to filter most packets. However,
networks continue to evolve and requirements change. For example, an enterprise
allows employees to access only the specified websites during work hours, and to
access other websites in off-hours and weekends. Here is another example. The
P2P and downloading services affect other data services during the peak hours of
20:00-22:00. Therefore, the network administrator is required to lower the
bandwidth for the P2P and downloading services in this period.
● Mode 1 - Periodic time range: defines a time range based on weeks. The
associated ACL rules take effect at an interval of one week. For example, if
the time range of ACL rules is 8:00-12:00 on Monday, the ACL rules take
effect at 8:00-12:00 on every Monday.
Format: time-range time-name start-time to end-time { days } &<1-7>
– time-name: indicates the name of a time range. It is a string starting with
a letter.
– start-time to end-time: indicates the start and end time of the time
range. The format is [hour:minute] to [hour:minute].
– days: includes the following values:
▪ One of Mon, Tue, Wed, Thu, Fri, Sat, and Sun or a combination of
them. The value can also be numeric. For example, 0 indicates
Sunday, 1 indicates Monday..., and 6 indicates Saturday.
For example, ACL 2001 is associated with time range test, which contains three
sub-ranges:
#
time-range test 8:00 to 18:00 working-day
time-range test 14:00 to 18:00 off-day
time-range test from 00:00 2014/01/01 to 23:59 2014/12/31
#
acl number 2001
rule 5 permit time-range test
The time range test is: 8:00-18:00 on Monday to Friday and 14:00-18:00 every
Saturday and Sunday in 2014.
Usually, an ACL is applied to a traffic policy or simplified traffic policy. This enables
the device to deliver ACL rules globally, in a VLAN, or on an interface to filter
packets to be forwarded. In addition, an ACL can be applied to the service
modules such as Telnet, FTP, and routing.
Login control The device controls access Telnet, STelnet, FTP, SFTP,
permission of users. Only HTTP, SNMP
authorized users can log in to
the device, and other users
cannot log in without
permission. This ensures
network security.
For example, only the
administrator is allowed to log
in to the device. You can apply
an ACL to the Telnet service
and specify the hosts that can
log in to the device or the hosts
that cannot log in.
Route filtering ACLs can be applied to various BGP, IS-IS, OSPF, OSPFv3, RIP,
dynamic routing protocols to RIPng, multicast protocol
filter advertised and received
routes and multicast groups.
For example, you can apply an
ACL to a routing policy to
prevent the device from
sending routes of a network
segment to the neighboring
router.
packet is permitted. The default action of the Telnet module is deny and an ACL
containing rules is applied to the Telnet module. If a packet does not match any
ACL rules, the packet is rejected.
The blacklist module processes ACL in a different way. After an ACL is applied to a
blacklist, the packets matching any ACL rule are discarded no matter whether they
match the permit or deny rule.
Table 2-11, Table 2-12, and Table 2-13 provide the default ACL actions and
mechanisms taken by each service module.
Table 2-11 Default ACL actions and mechanisms of different service modules
Default Telnet STelnet HTTP FTP TFTP
ACL
actions
and
mechanis
ms
Packets deny (not deny (not deny (not deny (not deny (not
Match the allowed to allowed to allowed to allowed to allowed to
deny Rule log in) log in) log in) log in) log in)
Packets Do deny (not deny (not deny (not deny (not deny (not
Not Match allowed to allowed to allowed to allowed to allowed to
Any Rule in log in) log in) log in) log in) log in)
an ACL
Table 2-12 Default ACL actions and mechanisms of different service modules
Default SFTP SNMP Traffic Simplified Local
ACL policy traffic attack
actions policy defense
and policy
mechanis (blacklist)
ms
Table 2-13 Default ACL actions and mechanisms of different service modules
Default ACL Route Policy Filter Policy igmp- igmp-
actions and snooping snooping
mechanisms ssm-policy group-policy
NOTE
The following rules are for reference. Adhere to the command line syntax when configuring
ACL rules.
● rule permit xxx/rule permit xxxx: allows the specified packets to pass. xxx/xxxx
indicates packet attributes, such as source IP address, source MAC address, and time
range. The range xxxx involves the range xxx. For example, if xxx is an IP address, xxxx
is the network segment where the IP address resides or any (any IP address); if xxx is a
time range on Saturday, xxxx is all day long on weekends or from Monday to Sunday.
● rule deny xxx/rule deny xxxx: blocks the specified packets.
● rule permit: allows all packets to pass.
● rule deny: blocks all packets.
Example:
– Example 1: Apply an ACL to a traffic policy to filter packets from network
segment 192.168.1.0/24. Reject the packets from hosts 192.168.1.2 and
192.168.1.3, and allow the packets from other hosts on network segment
192.168.1.0/24 to pass.
The default ACL action of the traffic policy module is permit, and a few
packets are denied and most packets are permitted. Therefore, you only
need to configure rule deny xxx.
#
acl number 2000
rule 5 deny source 192.168.1.2 0
rule 10 deny source 192.168.1.3 0
#
– Example 2: Apply an ACL to a traffic policy to filter packets from network
segment 192.168.1.0/24. Allow the packets from hosts 192.168.1.2 and
192.168.1.3 to pass, and reject the packets from other hosts on network
segment 192.168.1.0/24.
The default ACL action of the traffic policy module is permit, and a few
packets are permitted and most packets are denied. Therefore, you need
to configure rule permit xxx first, and then rule deny xxxx.
#
acl number 2000
rule 5 permit source 192.168.1.2 0
rule 10 permit source 192.168.1.3 0
rule 15 deny source 192.168.1.0 0.0.0.255
#
– Example 3: Apply an ACL to Telnet, to allow only the administrator's host
(172.16.105.2) to Telnet to the device and reject other users.
The default ACL action of the Telnet module is deny, and a few packets
are permitted and most packets are denied. Therefore, you only need to
configure rule permit xxx.
#
acl number 2000
rule 5 permit source 172.16.105.2 0
#
– Example 5: Apply an ACL to FTP to prevent users from accessing the FTP
server from 00:00-08:00 every Saturday.
The default ACL action of the FTP module is deny, and a few packets are
denied and most packets are permitted. Therefore, you need to configure
rule deny xxx first, and then rule permit xxxx.
#
time-range t1 00:00 to 08:00 Sat
time-range t2 00:00 to 23:59 daily
#
acl number 2000
rule 5 deny time-range t1
rule 10 permit time-range t2
#
In Figure 2-4, to manage the remote Telnet server conveniently, the administrator
configures AAA authentication on the Telnet server. Only the Telnet users passing
the AAA authentication can log in to the server. In addition, an ACL-based login
control policy is configured on the server so that only the administrator's PC can
log in to the server.
Network
PC Telnet Server
To control which NMSs can access a device, you can apply an ACL to the SNMP
module.
In Figure 2-5, to manage the remote switch conveniently, the administrator
configures the SNMP agent service on the switch so that the agent can report the
switch's status to the NMS in a timely manner and the NMS can remotely control
the switch. In addition, an ACL-based NMS access right control is configured to
allow only the trusted NMS (NMS2) to manage the switch.
NMS1
10.1.1.1/24 IP Network
10.1.2.1/24
Switch
NMS2
10.1.1.2/24
Figure 2-6 Using an ACL to restrict mutual access between network segments
VLAN10
Int
erf
ac
Financial e1
192.168.1.0/24
Internet
2 Switch Router
ce
VLAN20
t e rfa
In
Marketing
192.168.2.0/24
Figure 2-7 Using an ACL to prevent certain users from accessing the Internet in
the specified time range
HostA
MAC: 00e0-f201-0101
Interface 1
Internet
HostB LSW Switch Router
MAC: 00e0-f201-0102
HostC
MAC: 00e0-f201-0103
Phone
VLAN 120
PC
Internet
VLAN 100 LSW Switch Router
TV
Enterprise
internal network Traffic direction
VLAN 110
172.16.16.0/24
Interface 1 Interface 3 172.16.17.0/24
172.16.18.0/24
Interface 2 Interface 4
172.16.19.0/24
SwitchC SwitchB SwitchA 172.16.20.0/24
OSPF
Licensing Requirements
ACL configuration commands are available only after the S1720GW, S1720GWR,
and S1720X have the license (WEB management to full management Electronic
RTU License) loaded and activated and the switches are restarted. ACL
configuration commands on other models are not under license control.
For details about how to apply for a license, see S Series Switch License Use
Guide.
Version Requirements
S2710SI V100R006(C03&C05)
S5710-C-LI V200R001C00
S5730SI V200R011C10
S5730S-EI V200R011C10
NOTE
To know details about software mappings, see Hardware Query Tool.
Feature Limitations
When creating ACL rules:
● If an ACL rule that you want to create already exists, the system does not
create the rule again.
● If the specified rule ID already exists and the new rule conflicts with the
original rule, the new rule replaces the original rule.
l2 0 0 0 0 64K 64K
Configure and apply a A basic ACL defines rules 2.7 Configuring and
basic ACL. to filter IPv4 packets Applying a Basic ACL
based on information
such as source IP
addresses, fragment
information, and time
ranges.
If you only need to filter
packets based on source
IP addresses, you can
configure a basic ACL.
Configure and apply a A user ACL defines rules 2.11 Configuring and
user ACL. to filter IPv4 packets Applying a User ACL
based on the source IP
addresses or source User
Control List (UCL)
groups, destination IP
addresses or destination
UCL groups, IP protocol
types, ICMP types, TCP
source/destination port
numbers, UDP source/
destination port
numbers, and time
ranges.
To filter packets based
on UCL groups, configure
a user ACL.
Step 5
NOTE
The ACL6 does not support the step.
Context
By default, an ACL always takes effect after it is applied to a service module. To
make ACL rules work only in a certain period, you can define a time range and
associate it with the ACL rules. In this way, services can be controlled through a
time-based ACL. For example, with a time-based ACL, an enterprise can forbid
employees to access the Internet during work hours and limit bandwidth for
bandwidth-consuming services such as P2P and downloading services during peak
hours to avoid network congestion.
Time ranges associated with ACL rules are classified into:
● Periodic time range: defines a time range by week. The associated ACL rules
take effect at an interval of one week. For example, if the time range of ACL
rules is 8:00-12:00 on Monday, the ACL rules take effect at 8:00-12:00 on
every Monday.
● Absolute time range: defines a time range from YYYY/MM/DD hh:mm to
YYYY/MM/DD hh:mm. The associated ACL rules take effect only in this period.
NOTE
If the system time of a device is not synchronized with the network time, the ACL rules cannot
take effect in the associated time range. Therefore, configuring the Network Time Protocol
(NTP) is recommended on the device to synchronize the system time. NTP ensures clock
consistency on all devices on a network. For details on how to configure NTP, see Configuring
Basic NTP Functions in "NTP Configuration" in the S1720, S2700, S5700, and S6720
V200R011C10 Configuration Guide - Device Management.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run time-range time-name { start-time to end-time { days } &<1-7> | from time1
date1 [ to time2 date2 ] }
A time range is created.
By default, no time range is configured on a device.
You can specify multiple time ranges for the same time range defined by time-
name. The device obtains the intersection of the configured periodic or absolute
time ranges.
To delete a time range, see Deleting a time range.
----End
Follow-up Procedure
After a time range is created, you need to create an ACL and configure the ACL
rules to be associated with the time range. For the configuration of a basic ACL,
see 2.7.2 Configuring a Basic ACL.
Configuration Tips
Deleting a time range
Before deleting a time range, you must delete the ACL rules associated with the
time range or delete the ACL to which the ACL rules belong.
For example, ACL 2001 contains rule 5 and is associated with time range time1.
#
time-range time1 from 00:00 2014/1/1 to 23:59 2014/12/31
#
acl number 2001
rule 5 permit time-range time1
#
Prerequisites
If you need to configure a time-based ACL, create a time range and associate the
time range with the ACL rules. For details, see 2.7.1 (Optional) Creating a Time
Range in Which an ACL Takes Effect.
Context
A basic ACL defines rules to filter IPv4 packets based on information such as
source IP addresses, fragment information, and time ranges.
If you only need to filter packets based on source IP addresses, you can configure
a basic ACL.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Create a basic ACL. You can create a numbered or named ACL.
● Run the acl [ number ] acl-number [ match-order { auto | config } ]
command to create a numbered basic ACL (2000-2999) and enter the basic
ACL view.
● Run the acl name acl-name { basic | acl-number } [ match-order { auto |
config } ] command to create a named basic ACL and enter the basic ACL
view.
By default, no ACL exists on the device.
For details about the numbered and named ACLs, see 2.2.2 ACL Classification.
If the match-order parameter is not specified when you create an ACL, the
default match order config is used. For details about ACL match order, see 2.2.4
Matching Order.
The default step of a created ACL is 5. If the default step cannot meet your ACL
configuration requirements, you can change the step value. For details about the
step, see 2.2.3 Step; for configuration of the step, see 2.14.1 Adjusting the Step
of ACL Rules.
To delete an ACL that has taken effect, see Deleting an ACL.
Step 3 (Optional) Run description text
A description is configured for the ACL.
By default, an ACL does not have a description.
The ACL description helps you understand and remember the functions or purpose
of an ACL.
Step 4 Run rule [ rule-id ] { deny | permit } [ source { source-address source-wildcard |
any } | fragment | logging | time-range time-name | vpn-instance vpn-instance-
name ] *
Rules are configured in the basic ACL.
In this example, only one permit or deny rule is configured. In actual
configuration, you can configure multiple rules and decide the match order of the
rules according to service requirements.
For details about the time range, source IP address and its wildcard mask, and IP
fragment information, see 2.2.5 Matching Conditions. Configuring rules for a
basic ACL provides a rule configuration example.
Step 5 (Optional) Run rule rule-id description description
A description is configured for the ACL rules.
By default, an ACL rule does not have a description.
The ACL rule description helps you understand and remember the functions or
purpose of an ACL rule.
You can configure descriptions for only the rules existing on the device. That is,
you cannot configure a description for a rule before creating the rule.
----End
Configuration Tips
Deleting an ACL
To delete an ACL, run the undo acl { [ number ] acl-number | all } or undo acl
name acl-name command in the system view. This command can delete an ACL
no matter whether the ACL is applied to a service module; however, if a specified
rule in an ACL is used in a simplified traffic policy, the ACL cannot be deleted
using this command. Before using this command to delete an ACL, you do not
need to delete the service configurations.
Configuring rules for a basic ACL
Context
After an ACL is configured, it must be applied to a service module so that the ACL
rules can be delivered and take effect.
Usually, an ACL is applied to a traffic policy or simplified traffic policy. This enables
the device to deliver ACL rules globally, in a VLAN, or on an interface to filter
packets to be forwarded. In addition, an ACL can be applied to the service
modules such as Telnet, FTP, and routing.
Procedure
Step 1 Apply a basic ACL
Table 2-19 describes the application of a basic ACL.
Login control The device controls access ● Telnet: See Enabling the
permission of users. Only Telnet Server Function in
authorized users can log in to "CLI Login Configuration"
the device, and other users in the S1720, S2700,
cannot log in without S5700, and S6720
permission. This ensures V200R011C10
network security. Configuration Guide -
Basic Configuration.
● FTP: See Managing Files
When the Device
Functions as an FTP
Server in "File
Management" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide -
Basic Configuration.
● SFTP: See Managing Files
When the Device
Functions as an SFTP
Server in "File
Management" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide -
Basic Configuration.
● HTTP: See Configuring
Access Control on Web
Users in "Web System
Login Configuration" in
the S1720, S2700, S5700,
and S6720 V200R011C10
Configuration Guide -
Basic Configuration.
● SNMP: See (Optional)
Restricting Management
Rights of the NMS
(SNMPv1 and SNMPv2c)
and (Optional) Restricting
Management Rights of
the NMS (SNMPv3) in
"SNMP Configuration" in
the S1720, S2700, S5700,
and S6720 V200R011C10
Configuration Guide -
Network Management
and Monitoring.
Route filtering ACLs can be applied to various ● BGP: See Controlling the
dynamic routing protocols to Advertisement of BGP
filter advertised and received Routes and Controlling
routes and multicast groups. the Receiving of BGP
For example, you can apply an Routes in "BGP
ACL to a routing policy to Configuration" in the
prevent the device from S1720, S2700, S5700, and
sending routes of a network S6720 V200R011C10
segment to the neighboring Configuration Guide - IP
router. Unicast routing.
● IS-IS (IPv4): See
Configuring IS-IS to
Advertise Specified
External Routes to an IS-IS
Routing Domain and
Adding Specified IS-IS
Routes to the IP Routing
Table in "IPv4 IS-IS
Configuration" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide - IP
Unicast routing.
● OSPF: See Configuring
OSPF to Filter Received
Routes and Configuring
OSPF to Filter the Routes
to Be Advertised in "OSPF
Configuration" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide - IP
Unicast routing.
● RIP: See Configuring RIP
to Import Routes and
Configuring RIP to Filter
Received Routes in "RIP
Configuration" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide - IP
Unicast routing.
● Multicast: See Filtering
IGMP Messages Based on
Source IP Addresses in
"IGMP Configuration",
Configuring a Multicast
Group Policy and
(Optional) Configuring an
SSM Group Policy in
"IGMP Snooping
Configuration" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide - IP
Multicast.
----End
Procedure
● Run the display acl { acl-number | name acl-name | all } command to check
ACL configuration.
● Run the display time-range { all | time-name } command to view
information about the time range.
----End
Context
For details, see 2.7.1 (Optional) Creating a Time Range in Which an ACL Takes
Effect in Configuring and Applying a Basic ACL.
Prerequisites
If you need to configure a time-based ACL, create a time range and associate the
time range with the ACL rules. For details, see 2.7.1 (Optional) Creating a Time
Range in Which an ACL Takes Effect.
Context
An advanced ACL defines rules to filter IPv4 packets based on source IP addresses,
destination IP addresses, IP protocol types, TCP source/destination port numbers,
UDP source/destination port numbers, fragment information, and time ranges.
Compared with a basic ACL, an advanced ACL is more accurate, flexible, and
provides more functions. For example, if you want to filter packets based on
source and destination IP addresses, configure an advanced ACL.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Create an advanced ACL. You can create a numbered or named ACL.
● Run the acl [ number ] acl-number [ match-order { auto | config } ]
command to create a numbered advanced ACL (3000-3999) and enter the
advanced ACL view.
● Run the acl name acl-name { advance | acl-number } [ match-order { auto |
config } ] command to create a named advanced ACL and enter the
advanced ACL view.
By default, no ACL exists on the device.
For details about the numbered and named ACLs, see 2.2.2 ACL Classification.
If the match-order parameter is not specified when you create an ACL, the
default match order config is used. For details about ACL match order, see 2.2.4
Matching Order.
The default step of a created ACL is 5. If the default step cannot meet your ACL
configuration requirements, you can change the step value. For details about the
step, see 2.2.3 Step; for configuration of the step, see 2.14.1 Adjusting the Step
of ACL Rules.
To delete an ACL that has taken effect, see Deleting an ACL in Configuring a
Basic ACL.
Step 3 (Optional) Run description text
A description is configured for the ACL.
By default, an ACL does not have a description.
The ACL description helps you understand and remember the functions or purpose
of an ACL.
Step 4 Configure rules for the advanced ACL.
You can configure advanced ACL rules according to the protocols carried by IP. The
parameters vary according to the protocol type.
● When the protocol type is ICMP, the command format is:
rule [ rule-id ] { deny | permit } { protocol-number | icmp } [ destination
{ destination-address destination-wildcard | any } | { { precedence precedence
| tos tos } * | dscp dscp } | { fragment | first-fragment } | logging | icmp-type
The ACL rule description helps you understand and remember the functions or
purpose of an ACL rule.
You can configure descriptions for only the rules existing on the device. That is,
you cannot configure a description for a rule before creating the rule.
----End
Configuration Tips
Configuring rules for an advanced ACL
● Configuring a packet filtering rule for ICMP protocol packets based on
the source IP address (host address) and destination IP address segment
To allow the ICMP packets from a host that are destined for a network
segment to pass, configure a rule in an ACL. For example, to allow the ICMP
packets from host 192.168.1.3 that are destined for network segment
192.168.2.0/24 to pass, configure the following rule in ACL 3001.
<HUAWEI> system-view
[HUAWEI] acl 3001
[HUAWEI-acl-adv-3001] rule permit icmp source 192.168.1.3 0 destination 192.168.2.0 0.0.0.255
● Configuring a packet filtering rule for TCP protocol packets based on the
TCP destination port number, source IP address (host address), and
destination IP address segment
To prohibit Telnet connections between the specified host and the hosts on a
network segment, configure a rule in an advanced ACL. For example, to
prohibit Telnet connections between host 192.168.1.3 and hosts on network
segment 192.168.2.0/24, configure the following rule in the advanced ACL
deny-telnet.
<HUAWEI> system-view
[HUAWEI] acl name deny-telnet
[HUAWEI-acl-adv-deny-telnet] rule deny tcp destination-port eq telnet source 192.168.1.3 0
destination 192.168.2.0 0.0.0.255
To prohibit the specified hosts from accessing web pages (HTTP is used to
access web pages, and TCP port number is 80), configure rules in an advanced
ACL. For example, to prohibit hosts 192.168.1.3 and 192.168.1.4 from
accessing web pages, configure the following rules in ACL no-web and set the
description for the ACL to Web access restrictions.
<HUAWEI> system-view
[HUAWEI] acl name no-web
[HUAWEI-acl-adv-no-web] description Web access restrictions
[HUAWEI-acl-adv-no-web] rule deny tcp destination-port eq 80 source 192.168.1.3 0
[HUAWEI-acl-adv-no-web] rule deny tcp destination-port eq 80 source 192.168.1.4 0
● Configuring a packet filtering rule for TCP packets based on the source IP
address segment and TCP flags
To implement unidirectional access control on a network segment, configure
rules in an ACL. For example, to implement unidirectional access control on
network segment 192.168.2.0/24, configure the following rules in ACL 3002.
In the following rules, the hosts on 192.168.2.0/24 can only respond to TCP
handshake packets, but cannot send TCP handshake packets. Set the
descriptions of the ACL rules to Allow the ACK TCP packets through, Allow the
RST TCP packets through, and Do not Allow the other TCP packet through.
To meet the preceding requirement, configure two permit rules to allow the
packets with the ACK or RST field being 1 from 192.168.2.0/24 to pass, and
then configure a deny rule to reject other TCP packets from this network
segment.
<HUAWEI> system-view
[HUAWEI] acl 3002
[HUAWEI-acl-adv-3002] rule permit tcp source 192.168.2.0 0.0.0.255 tcp-flag ack
[HUAWEI-acl-adv-3002] display this // If you do not specify an ID for a created rule, you can view
the rule ID allocated by the system, and configure a description for the rule by specifying the rule ID.
#
acl number 3002
rule 5 permit tcp source 192.168.2.0 0.0.0.255 tcp-flag ack // The rule ID allocated by the
system is 5.
#
return
[HUAWEI-acl-adv-3002] rule 5 description Allow the ACK TCP packets through
[HUAWEI-acl-adv-3002] rule permit tcp source 192.168.2.0 0.0.0.255 tcp-flag rst
[HUAWEI-acl-adv-3002] display this
#
acl number 3002
rule 5 permit tcp source 192.168.2.0 0.0.0.255 tcp-flag ack
rule 5 description Allow the ACK TCP packets through
rule 10 permit tcp source 192.168.2.0 0.0.0.255 tcp-flag rst // The rule ID allocated by the system
is 10.
#
return
[HUAWEI-acl-adv-3002] rule 10 description Allow the RST TCP packets through
[HUAWEI-acl-adv-3002] rule deny tcp source 192.168.2.0 0.0.0.255
[HUAWEI-acl-adv-3002] display this
#
acl number 3002
rule 5 permit tcp source 192.168.2.0 0.0.0.255 tcp-flag ack
rule 5 description Allow the ACK TCP packets through
rule 10 permit tcp source 192.168.2.0 0.0.0.255 tcp-flag rst
rule 10 description Allow the RST TCP packets through
rule 15 deny tcp source 192.168.2.0 0.0.0.255 // The rule ID allocated by the system is 15.
#
return
[HUAWEI-acl-adv-3002] rule 15 description Do not Allow the other TCP packet through
You can specify the established parameter to allow the packets with the ACK
or RST field being 1 from 192.168.2.0/24 to pass and configure a deny rule to
reject other TCP packets from this subnet.
<HUAWEI> system-view
[HUAWEI] acl 3002
[HUAWEI-acl-adv-3002] rule permit tcp source 192.168.2.0 0.0.0.255 tcp-flag established
[HUAWEI-acl-adv-3002] rule 5 description Allow the Established TCP packets through
[HUAWEI-acl-adv-3002] rule deny tcp source 192.168.2.0 0.0.0.255
[HUAWEI-acl-adv-3002] rule 10 description Do not Allow the other TCP packet through
[HUAWEI-acl-adv-3002] display this
#
acl number 3002
rule 5 permit tcp source 192.168.2.0 0.0.0.255 tcp-flag
established
rule 5 description Allow the Established TCP packets
through
rule 10 deny tcp source 192.168.2.0
0.0.0.255
rule 10 description Do not Allow the other TCP packet
through
#
return
Context
After an ACL is configured, it must be applied to a service module so that the ACL
rules can be delivered and take effect.
Usually, an ACL is applied to a traffic policy or simplified traffic policy. This enables
the device to deliver ACL rules globally, in a VLAN, or on an interface to filter
packets to be forwarded. In addition, an ACL can be applied to the service
modules such as FTP and multicast.
Procedure
Step 1 Apply an advanced ACL
Table 2-20 describes the application of an advanced ACL.
Login control The device controls access ● Telnet: See Enabling the
permission of users. Only Telnet Server Function in
authorized users can log in to "CLI Login Configuration"
the device, and other users in the S1720, S2700,
cannot log in without S5700, and S6720
permission. This ensures V200R011C10
network security. Configuration Guide -
Basic Configuration.
● FTP: See Managing Files
When the Device
Functions as an FTP
Server in "File
Management" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide -
Basic Configuration.
● SFTP: See Managing Files
When the Device
Functions as an SFTP
Server in "File
Management" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide -
Basic Configuration.
● HTTP: See Configuring
Access Control on Web
Users in "Web System
Login Configuration" in
the S1720, S2700, S5700,
and S6720 V200R011C10
Configuration Guide -
Basic Configuration.
Route filtering An ACL can be applied to the Multicast: See Configuring a
multicast protocol to filter Multicast Group Policy in
multicast groups. "IGMP Snooping
For example, the ACL and IGMP Configuration" and
snooping functions can be used (Optional) Configuring the
together to prevent hosts in a Range of Multicast Groups
VLAN from joining a multicast That an Interface Can Join in
group. "IGMP Configuration" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide - IP
Multicast.
----End
Procedure
● Run the display acl { acl-number | name acl-name | all } command to check
ACL configuration.
● Run the display time-range { all | time-name } command to view
information about the time range.
----End
Context
For details, see 2.7.1 (Optional) Creating a Time Range in Which an ACL Takes
Effect in Configuring and Applying a Basic ACL.
Prerequisites
If you need to configure a time-based ACL, create a time range and associate the
time range with the ACL rules. For details, see 2.7.1 (Optional) Creating a Time
Range in Which an ACL Takes Effect.
Context
A Layer 2 ACL defines rules to filter IPv4 and IPv6 packets based on Ethernet
frame information, such as source MAC addresses, destination MAC addresses,
VLANs, and Layer 2 protocol types.
If you only need to filter packets based on Layer 2 information, configure a Layer
2 ACL.
Procedure
Step 1 Run system-view
Step 2 Create a Layer 2 ACL. You can create a numbered or named ACL.
● Run the acl [ number ] acl-number [ match-order { auto | config } ]
command to create a numbered Layer 2 ACL (4000-4999) and enter the Layer
2 ACL view.
● Run the acl name acl-name { link | acl-number } [ match-order { auto |
config } ] command to create a named Layer 2 ACL and enter the Layer 2
ACL view.
For details about the numbered and named ACLs, see 2.2.2 ACL Classification.
If the match-order parameter is not specified when you create an ACL, the
default match order config is used. For details about ACL match order, see 2.2.4
Matching Order.
The default step of a created ACL is 5. If the default step cannot meet your ACL
configuration requirements, you can change the step value. For details about the
step, see 2.2.3 Step; for configuration of the step, see 2.14.1 Adjusting the Step
of ACL Rules.
To delete an ACL that has taken effect, see Deleting an ACL in Configuring a
Basic ACL.
The ACL description helps you understand and remember the functions or purpose
of an ACL.
Step 4 Run rule [ rule-id ] { permit | deny } [ [ ether-ii | 802.3 | snap ] | l2-protocol
type-value [ type-mask ] | destination-mac dest-mac-address [ dest-mac-mask ] |
source-mac source-mac-address [ source-mac-mask ] | vlan-id vlan-id [ vlan-id-
mask ] | 8021p 802.1p-value | cvlan-id cvlan-id [ cvlan-id-mask ] | cvlan-8021p
802.1p-value | double-tag | time-range time-name ] *
Rules are configured in the Layer 2 ACL.
For details about the time range, source/destination MAC addresses and their
wildcard masks, VLAN IDs and their masks, see 2.2.5 Matching Conditions.
Configuring rules for a Layer 2 ACL provides a rule configuration example.
The ACL rule description helps you understand and remember the functions or
purpose of an ACL rule.
You can configure descriptions for only the rules existing on the device. That is,
you cannot configure a description for a rule before creating the rule.
----End
Configuration Tips
Configuring rules for a Layer 2 ACL
● Configuring packet filtering rules based on the source MAC address,
destination MAC address, and Layer 2 protocol types
To allow the ARP packets with the specified destination and source MAC
addresses and Layer 2 protocol type to pass, configure a rule in a Layer 2 ACL.
For example, to allow the ARP packets with destination MAC address
0000-0000-0001, source MAC address 0000-0000-0002, and Layer 2 protocol
type 0x0806 to pass, configure the following rule in ACL 4001.
<HUAWEI> system-view
[HUAWEI] acl 4001
[HUAWEI-acl-L2-4001] rule permit destination-mac 0000-0000-0001 source-mac 0000-0000-0002
l2-protocol 0x0806
To reject the PPPoE packets with the specified Layer 2 protocol type, configure
a rule in a Layer 2 ACL. To reject the PPPoE packets with Layer 2 protocol type
0x8863, configure the following rule in ACL 4001.
<HUAWEI> system-view
[HUAWEI] acl 4001
[HUAWEI-acl-L2-4001] rule deny l2-protocol 0x8863
Context
After an ACL is configured, it must be applied to a service module so that the ACL
rules can be delivered and take effect.
Usually, an ACL is applied to a traffic policy or simplified traffic policy so that the
device can deliver ACL rules globally, in a VLAN, or on an interface to filter packets
to be forwarded. In addition, an ACL can be applied to the service modules such as
local attack defense.
Procedure
Step 1 Apply a Layer 2 ACL.
----End
Procedure
● Run the display acl { acl-number | name acl-name | all } command to check
ACL configuration.
● Run the display time-range { all | time-name } command to view
information about the time range.
----End
Context
For details, see 2.7.1 (Optional) Creating a Time Range in Which an ACL Takes
Effect in Configuring and Applying a Basic ACL.
Prerequisites
If you need to configure a time-based ACL, create a time range and associate the
time range with the ACL rules. For details, see 2.7.1 (Optional) Creating a Time
Range in Which an ACL Takes Effect.
Context
A user-defined ACL defines rules based on packet headers, offsets, character string
masks, and user-defined character strings. With such a user-defined ACL
configured, the system performs an AND operation on the packet bytes from a
certain position behind the packet header and the character string mask,
compares the extracted character string against the user-defined character string,
and then filters IPv4 and IPv6 packets.
Compared with basic ACL, advanced ACL, and Layer 2 ACL, user-defined ACL is
more accurate, flexible, and provides more functions. For example, if you want to
filter ARP packets based on source IP addresses and ARP packet types, you can
configure a user-defined ACL.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Configure a user-defined ACL. You can create a numbered or named ACL.
● Run the acl [ number ] acl-number [ match-order { auto | config } ]
command to create a numbered user-defined ACL (5000-5999) and enter the
user-defined ACL view.
● Run the acl name acl-name { user | acl-number } [ match-order { auto |
config } ] command to create a named user-defined ACL and enter the user-
defined ACL view.
By default, no ACL exists on the device.
For details about the numbered and named ACLs, see 2.2.2 ACL Classification.
If the match-order parameter is not specified when you create an ACL, the
default match order config is used. For details about ACL match order, see 2.2.4
Matching Order.
The default step of a created ACL is 5. If the default step cannot meet your ACL
configuration requirements, you can change the step value. For details about the
step, see 2.2.3 Step; for configuration of the step, see 2.14.1 Adjusting the Step
of ACL Rules.
To delete an ACL that has taken effect, see Deleting an ACL in Configuring a
Basic ACL.
The ACL description helps you understand and remember the functions or purpose
of an ACL.
Step 4 Run rule [ rule-id ] { deny | permit } [ [ l2-head | ipv4-head | ipv6-head | l4-
head ] { rule-string rule-mask offset } &<1-8> | time-range time-name ] *
The ACL rule description helps you understand and remember the functions or
purpose of an ACL rule.
You can configure descriptions for only the rules existing on the device. That is,
you cannot configure a description for a rule before creating the rule.
----End
Configuration Tips
Configuring a user-defined ACL rule
● Configuring packet filtering rules based on Layer 2 headers, offsets,
character string masks, and user-defined character strings
To reject the ARP packets from the specified host, configure a rule in a user-
defined ACL. For example, to reject the ARP packets from host 192.168.0.2,
configure the following rule in ACL 5001.
In the following rule:
– 0x00000806 indicates the ARP protocol.
– 0x0000ffff is the character string mask.
– 10 indicates the protocol type field offset in the ARP packets (without
VLAN ID).
– c0a80002 is the hexadecimal format of 192.168.0.2.
– 26 and 30 respectively indicate the offsets of the higher and lower two
bytes in the source IP addresses in ARP packets (without VLAN ID). The
source IP address in an ARP packet begins at the 28th byte in Layer 2
header and occupies 4 bytes. The Layer 2 header offset defined in a user-
defined ACL must be 4n+2 (n is an integer). Therefore, the source IP
address is divided into two segments for matching. The lower two bytes
among the four bytes behind offset 26 (4 x 6 + 2) and the higher two
bytes among the four bytes behind offset 30 (4 x 7 + 2) are matched
separately.
To filter ARP packets with VLAN IDs, add 4 to each of the following offsets.
Figure 2-10 Source IP address field offset in Layer 2 header of an ARP packet
4×0+2=2byte
0 15 23 31 bit
<HUAWEI> system-view
[HUAWEI] acl 5001
[HUAWEI-acl-user-5001] rule deny l2-head 0x00000806 0x0000ffff 10 0x0000c0a8 0x0000ffff 26
0x00020000 0xffff0000 30
Data
NOTE
When specifying an ACL rule to match offset bytes in the Layer 2 header on the
S5730SI, S5730S-EI, S6720-56C-PWH-SI-AC, or S6720-56C-PWH-SI, add a tag first if
the ACL rule will be applied on a GE electrical interface through which packets having
no tag pass.
● Configuring a time-based ACL rule
For details, see Configuring a time-based ACL rule in Configuring a Basic
ACL.
Context
After an ACL is configured, it must be applied to a service module so that the ACL
rules can be delivered and take effect.
Usually, a user-defined ACL is applied to a traffic policy or simplified traffic policy
so that the device can deliver ACL rules globally, in a VLAN, or on an interface to
filter packets to be forwarded.
Procedure
Step 1 Apply a user-defined ACL.
Table 2-22 describes the application of a user-defined ACL.
----End
Procedure
● Run the display acl { acl-number | name acl-name | all } command to check
ACL configuration.
● Run the display time-range { all | time-name } command to view
information about the time range.
----End
Context
For details, see 2.7.1 (Optional) Creating a Time Range in Which an ACL Takes
Effect in Configuring and Applying a Basic ACL.
Prerequisites
● The NAC mode has been set to the unified mode using the authentication
unified-mode command and the device has been restarted to make the NAC
mode take effect.
● A UCL group that identifies user category has been created using the ucl-
group command.
● If you need to configure a time-based ACL, create a time range and associate
the time range with the ACL rules. For details, see 2.7.1 (Optional) Creating
a Time Range in Which an ACL Takes Effect.
Context
A user ACL defines rules to filter IPv4 packets based on the source IP addresses or
source User Control List (UCL) groups, destination IP addresses or destination UCL
groups, IP protocol types, ICMP types, TCP source/destination port numbers, UDP
source/destination port numbers, and time ranges.
To filter packets based on UCL groups, configure a user ACL.
NOTE
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Create a user ACL. You can create a numbered or named ACL.
● Run the acl [ number ] acl-number [ match-order { auto | config } ]
command to create a numbered user ACL (6000-9999) and enter the user
ACL view.
● Run the acl name acl-name { ucl | acl-number } [ match-order { auto |
config } ] command to create a named user ACL and enter the user ACL view.
By default, no ACL exists on the device.
For details about the numbered and named ACLs, see 2.2.2 ACL Classification.
If the match-order parameter is not specified when you create an ACL, the
default match order config is used. For details about ACL match order, see 2.2.4
Matching Order.
The default step of a created ACL is 5. If the default step cannot meet your ACL
configuration requirements, you can change the step value. For details about the
step, see 2.2.3 Step; for configuration of the step, see 2.14.1 Adjusting the Step
of ACL Rules.
To delete an ACL that has taken effect, see Deleting an ACL in Configuring a
Basic ACL.
Step 3 (Optional) Run description text
A description is configured for the ACL.
----End
Configuration Tips
Configuring user ACL rules
● Configuring a packet filtering ACL rule based on the source UCL group
and destination IP address
Configure a rule in ACL 6000 to reject all the IP packets sent from the hosts in
source UCL group group1 to network segment 192.168.1.0/24.
<HUAWEI> system-view
[HUAWEI] ucl-group 1 name group1
[HUAWEI] acl 6000
[HUAWEI-acl-ucl-6000] rule deny ip source ucl-group name group1 destination 192.168.1.0
0.0.0.255
Context
After an ACL is configured, it must be applied to a service module so that the ACL
rules can be delivered and take effect.
Currently, the user ACL can only be applied to the UCL groups of the NAC feature.
To control the network access rights of users based on user groups, you can
perform the following operations: configure a UCL group, associate user ACL rules
with the UCL group so that the ACL rules apply to all users in the user group,
configure packet filtering based on user ACL to make the ACL take effect, and
then apply the UCL group to the AAA service scheme.
Procedure
Step 1 Apply a user ACL.
Table 2-23 describes the application of a user ACL.
----End
Procedure
● Run the display acl { acl-number | name acl-name | all } command to check
ACL configuration.
● Run the display time-range { all | time-name } command to view
information about the time range.
----End
Context
The time range configurations of ACL6 and ACL are the same. For details, see
2.7.1 (Optional) Creating a Time Range in Which an ACL Takes Effect in
Configuring and Applying a Basic ACL.
Prerequisites
If you need to configure a time-based ACL6, create a time range and associate the
time range with the ACL6 rules. For details, see 2.12.1 (Optional) Creating a
Time Range in Which an ACL6 Takes Effect.
Context
A basic ACL6 defines rules to filter IPv6 packets based on information such as
source IPv6 addresses, fragment information, and time ranges.
If you only need to filter packets based on source IPv6 addresses, you can
configure a basic ACL6.
Procedure
Step 1 Run system-view
Step 2 Create a basic ACL6. You can create a numbered or named ACL.
● Run the acl ipv6 [ number ] acl6-number [ match-order { auto | config } ]
command to create a numbered basic ACL6 (2000-2999) and enter the basic
ACL6 view.
● Run the acl ipv6 name acl6-name { basic | acl6-number } [ match-order
{ auto | config } ] command to create a named basic ACL6 and enter the
basic ACL6 view.
The functions of numbered and named ACL6 are the same as the functions of
numbered and named ACL. For details, see 2.2.2 ACL Classification.
If the match-order parameter is not specified when you create an ACL6, the
default match order config is used. The match order of ACL6 is the same as that
of ACL. For details, see 2.2.4 Matching Order.
Step 3 Run rule [ rule-id ] { deny | permit } [ fragment | logging | source { source-ipv6-
address prefix-length | source-ipv6-address/prefix-length | source-ipv6-address
postfix postfix-length | any } | time-range time-name | vpn-instance vpn-
instance-name ] *
Rules are configured in the basic ACL6.
Configuring rules for the basic ACL6 provides a rule configuration example.
The ACL rule description helps you understand and remember the functions or
purpose of an ACL rule.
You can configure descriptions for only the rules existing on the device. That is,
you cannot configure a description for a rule before creating the rule.
----End
Configuration Tips
Deleting ACL6
Run the undo acl ipv6 { all | [ number ] acl6-number } or undo acl ipv6 name
acl6-name command in the system view to delete an ACL6. This command can
delete an ACL6 no matter whether the ACL6 is applied to a service module. That
is, before using this command to delete an ACL6, you do not need to delete the
service configurations. However, if a specified rule in an ACL6 is used in a
simplified traffic policy, the ACL6 cannot be deleted using this command.
Context
After an ACL6 is configured, it must be applied to a service module so that the
ACL6 rules can be delivered and take effect.
Usually, an ACL6 is applied to a traffic policy or simplified traffic policy so that the
device can deliver ACL6 rules globally, in a VLAN, or on an interface to filter
packets to be forwarded. In addition, an ACL6 can be applied to the service
modules such as Telnet, FTP, and routing.
Procedure
Step 1 Apply a basic ACL6.
Table 2-24 describes the application of a basic ACL6.
Login control The device controls access ● Telnet: See Enabling the
permission of users. Only Telnet Server Function in
authorized users can log in to "CLI Login Configuration"
the device, and other users in the S1720, S2700,
cannot log in without S5700, and S6720
permission. This ensures V200R011C10
network security. Configuration Guide -
For example, only the Basic Configuration.
administrator is allowed to log ● FTP: See Managing Files
in to the device. You can apply When the Device
an ACL6 to the Telnet service Functions as an FTP
and specify the hosts that are Server in "File
allowed to log in to the device. Management" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide -
Basic Configuration.
● SFTP: See Managing Files
When the Device
Functions as an SFTP
Server in "File
Management" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide -
Basic Configuration.
● SNMP: See (Optional)
Restricting Management
Rights of the NMS
(SNMPv1 and SNMPv2c)
and (Optional) Restricting
Management Rights of
the NMS (SNMPv3) in
"SNMP Configuration" in
the S1720, S2700, S5700,
and S6720 V200R011C10
Configuration Guide -
Network Management
and Monitoring.
Route filtering ACL6s can be applied to various ● BGP: See Controlling the
dynamic routing protocols to Advertisement of BGP
filter advertised and received Routes and Controlling
routes and multicast groups. the Receiving of BGP
For example, you can apply an Routes in "BGP
ACL6 to a routing policy to Configuration" in the
prevent the device from S1720, S2700, S5700, and
sending routes of a network S6720 V200R011C10
segment to the neighboring Configuration Guide - IP
router. Unicast routing.
● IS-IS (IPv6): See
Configuring IS-IS to
Advertise Specified
External Routes to an IS-IS
Routing Domain and
Adding Specified IS-IS
Routes to an IPv6 Routing
Table in "IPv6 IS-IS
Configuration" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide - IP
Unicast routing.
● OSPFv3: See Configuring
OSPFv3 to Filter the
Received Routes and
Configuring OSPFv3 to
Import External Routes in
"OSPFv3 Configuration" in
the S1720, S2700, S5700,
and S6720 V200R011C10
Configuration Guide - IP
Unicast routing.
● RIPng: See Configuring a
RIPng Process to Import
External Routes and
Controlling the Receiving
of RIPng Routes in "RIPng
Configuration" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide - IP
Unicast routing.
● Multicast: See (Optional)
Configuring the Range of
Multicast Groups That an
Interface Can Join in
"MLD Configuration" and
Configuring an RP in "IPv6
PIM Configuration" in the
S1720, S2700, S5700, and
S6720 V200R011C10
Configuration Guide - IP
Multicast.
----End
Procedure
● Run the display acl ipv6 { acl6-number | name acl6-name | all } command to
check ACL6 configuration.
● Run the display time-range { all | time-name } command to view
information about the time range.
----End
Context
The time range configurations of ACL6 and ACL are the same. For details, see
2.7.1 (Optional) Creating a Time Range in Which an ACL Takes Effect in
Configuring and Applying a Basic ACL.
Prerequisites
If you need to configure a time-based ACL6, create a time range and associate the
time range with the ACL6 rules. For details, see 2.12.1 (Optional) Creating a
Time Range in Which an ACL6 Takes Effect.
Context
An advanced ACL6 defines rules to filter IPv6 packets based on source IPv6
addresses, destination IPv6 addresses, IPv6 protocol types, TCP source/destination
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Create an advanced ACL6. You can create a numbered or named ACL.
● Run the acl ipv6 [ number ] acl6-number [ match-order { auto | config } ]
command to create a numbered advanced ACL6 (3000-3999) and enter the
advanced ACL6 view.
● Run the acl ipv6 name acl6-name { advance | acl6-number } [ match-order
{ auto | config } ] command to create a named advanced ACL6 and enter the
advanced ACL6 view.
By default, no ACL exists on the device.
The functions of numbered and named ACL6 are the same as the functions of
numbered and named ACL. For details, see 2.2.2 ACL Classification.
If the match-order parameter is not specified when you create an ACL6, the
default match order config is used. The match order of ACL6 is the same as that
of ACL. For details, see 2.2.4 Matching Order.
To delete an ACL that has taken effect, see Deleting an ACL6 in Configuring a
Basic ACL6.
Step 3 Configure rules for the advanced ACL6.
You can configure advanced ACL6 rules according to the protocols carried by IP.
The parameters vary according to the protocol types.
● When the protocol type is TCP, the command format is:
rule [ rule-id ] { deny | permit } { tcp | protocol-number } [ destination
{ destination-ipv6-address prefix-length | destination-ipv6-address/prefix-
length | destination-ipv6-address postfix postfix-length | any } | destination-
port { eq port | gt port | lt port | range port-start port-end } | { { precedence
precedence | tos tos } * | dscp dscp } | routing [ routing-type routing-type ] |
{ fragment | first-fragment } | logging | source { source-ipv6-address prefix-
length | source-ipv6-address/prefix-length | source-ipv6-address postfix
postfix-length | any } | source-port { eq port | gt port | lt port | range port-
start port-end } | tcp-flag { ack | established | fin | psh | rst | syn | urg } * |
time-range time-name | vpn-instance vpn-instance-name ] *
● When the protocol type is UDP, the command format is:
rule [ rule-id ] { deny | permit } { udp | protocol-number } [ destination
{ destination-ipv6-address prefix-length | destination-ipv6-address/prefix-
length | destination-ipv6-address postfix postfix-length | any } | destination-
port { eq port | gt port | lt port | range port-start port-end } | { { precedence
precedence | tos tos } * | dscp dscp } | routing [ routing-type routing-type ] |
----End
Configuration Tips
Configuring rules for the advanced ACL6
● Configuring a packet filtering rule for ICMPv6 protocol packets based on
source IPv6 address (host address) and destination IPv6 address segment
Configure a rule in ACL6 3001 to allow the ICMPv6 packets from fc00:1::1 and
destined for network segment fc00:2::/64 to pass.
<HUAWEI> system-view
[HUAWEI] acl ipv6 3001
[HUAWEI-acl6-adv-3001] rule permit icmpv6 source fc00:1::1 128 destination fc00:2:: 64
● Configuring a packet filtering rule for TCP protocol packets based on the
TCP destination port number, source IPv6 address (host address), and
destination IPv6 address segment
Configure a rule in the advanced ACL6 deny-telnet to forbid Telnet
connections between the host fc00:1::3 and hosts on network segment
fc00:2::/64.
<HUAWEI> system-view
[HUAWEI] acl ipv6 name deny-telnet
[HUAWEI-acl6-adv-deny-telnet] rule deny tcp destination-port eq telnet source fc00:1::3 128
destination fc00:2:: 64
Configure a rule in the advanced ACL6 no-web to forbid hosts fc00:1::3 and
fc00:1::4 from accessing web pages (HTTP is used to access web pages, and
TCP port number is 80).
<HUAWEI> system-view
[HUAWEI] acl ipv6 name no-web
[HUAWEI-acl6-adv-no-web] rule deny tcp destination-port eq 80 source fc00:1::3 128
[HUAWEI-acl6-adv-no-web] rule deny tcp destination-port eq 80 source fc00:1::4 128
Context
After an ACL6 is configured, it must be applied to a service module so that the
ACL6 rules can be delivered and take effect.
Usually, an ACL6 is applied to a traffic policy or simplified traffic policy so that the
device can deliver ACL6 rules globally, in a VLAN, or on an interface to filter
packets to be forwarded. In addition, an ACL6 can be applied to the service
modules such as FTP and multicast.
Procedure
Step 1 Apply an advanced ACL6.
Table 2-25 describes the application of an advanced ACL6.
----End
Procedure
● Run the display acl ipv6 { acl6-number | name acl6-name | all } command to
check ACL6 configuration.
● Run the display time-range { all | time-name } command to view
information about the time range.
----End
Context
During routine maintenance, you may need to add rules to an ACL to meet new
service requirements. If the default step 5 is used (the system allocates 5, 10, 15...
as rule IDs), you can insert only four rules (rules 6, 7, 8, and 9) between
neighboring rules. If you need to insert more than 4 rules between neighboring
rules, increase the step to a value greater than 6. Then the system reallocates IDs
(6, 12, 18...) to the rules, and you can insert more than four rules (rules 7, 8, 9, 10,
and 11) between neighboring rules.
For details about the step, see 2.2.3 Step.
NOTE
Basic ACL6 and advanced ACL6 do not support step configuration, and use a step of 1.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 You can create a numbered or named ACL.
● Run the acl [ number ] acl-number [ match-order { auto | config } ]
command to create a numbered ACL and enter the ACL view.
● Run the acl name acl-name [ advance | basic | link | ucl | user | acl-number ]
[ match-order { auto | config } ] command to create a named ACL and enter
the ACL view.
By default, no ACL exists on the device.
For details about the numbered and named ACLs, see 2.2.2 ACL Classification.
Step 3 Run step step
The step is set.
The default step is 5.
----End
Procedure
● Run the display acl resource [ slot slot-id ] command in any view to check
information about ACL resources.
If the value of Rule Free or Free is not 0, idle ACL resources exist on the
device.
----End
Number of occupied ACL resources = Number of ACL rules x ACL application scope
(Number of interfaces or Number of VLANs or 1 if the ACL is applied globally) x
ACL application direction (1 for inbound and 1 for outbound, and 2 for inbound
and outbound)
For example, if 1K ACL rules are configured in an ACL using the if-match acl { acl-
number | acl-name } command and the traffic policy that references the ACL is
applied to the outbound direction of 8 interfaces, then totally 8K (1K rules x 8
interfaces x 1 direction) ACL resources are occupied.
Actually, the number of ACL rules configured on the device is different from the
actual number of ACL resources occupied. The calculation method varies
depending on factors such as the hardware chip and the type of service to which
an ACL is applied.
Procedure
Procedure
Step 1 Run system-view
The system view is displayed.
----End
Context
A core device processes a large number of services and therefore maintains many
ACL entries. However, the number of entries supported by the device is limited. If
these entries cannot meet service requirements, the service processing efficiency
degrades. The device provides a register for expanding entry spaces. You can
configure the resource allocation mode for the extended entry space to expand
space for ACL entries.
NOTE
Procedure
Step 1 (Optional) Run display system resource-template [ slot slot-id ]
NOTE
After configuring the ACL resource allocation mode, save the configuration, and restart the
device for the configuration to take effect.
l2 0 0 0 0 64K 64K
----End
Context
NOTICE
The deleted ACL statistics cannot be restored. Exercise caution when you run the
command.
Procedure
● Run the reset acl counter { name acl-name | acl-number | all } command in
the user view to clear ACL statistics.
● Run the reset acl ipv6 counter { name acl6-name | acl6-number | all }
command in the user view to clear ACL6 statistics.
----End
Networking Requirements
As shown in Figure 2-12, the Switch functions as an FTP server. The requirements
are as follows:
● All the users on subnet 1 (172.16.105.0/24) are allowed to access the FTP
server anytime.
● All the users on subnet 2 (172.16.107.0/24) are allowed to access the FTP
server only at the specified period of time.
FTP Server
PC2
Network
172.16.107.111/24
Switch
172.16.104.110/24
PC3
10.10.10.1/24
Configuration Roadmap
The following configurations are performed on the Switch. The configuration
roadmap is as follows:
1. Configure time ranges and ACLs so that the device can filter user packets to
control FTP access rights of different users.
2. Configure basic FTP functions.
3. Apply the ACL to the FTP module to make the ACL take effect.
Procedure
Step 1 Configure time ranges.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] time-range ftp-access from 0:0 2014/1/1 to 23:59 2014/12/31
[Switch] time-range ftp-access 14:00 to 18:00 off-day
Configuration Files
Switch configuration file
#
sysname Switch
#
FTP server enable
FTP acl 2001
#
time-range ftp-access 14:00 to 18:00 off-day
time-range ftp-access from 00:00 2014/1/1 to 23:59 2014/12/31
#
acl number 2001
rule 5 permit source 172.16.105.0 0.0.0.255
rule 10 permit source 172.16.107.0 0.0.0.255 time-range ftp-access
rule 15 deny
#
aaa
local-user huawei password irreversible-cipher $1a$a/sUWg/.p1*))=~SWzIRS0N",`&aS%'7X).m=o[PkQcv"!!
TTQOI~Z)C'1<9$
local-user huawei privilege level 15
local-user huawei ftp-directory flash:
local-user huawei service-type ftp
#
return
Networking Requirements
As shown in Figure 2-13, the PC and device are reachable to each other. Users
require that the device be remotely configured and managed in an easy way. To
meet the requirement, configure AAA authentication for Telnet users on the server
and configure a security policy to allow only users meeting the policy to log in to
the device.
Network
PC Telnet_Server
Configuration Roadmap
The configuration roadmap is as follows:
1. Log in to the device using Telnet to remotely maintain the device.
2. Configure the administrator user name and password, and configure an AAA
authentication policy to ensure that only users passing the authentication can
log in to the device.
3. Configure a security policy to ensure that only users meeting the policy can
log in to the device.
Procedure
Step 1 Enable the server function.
<HUAWEI> system-view
[HUAWEI] sysname Telnet_Server
[Telnet_Server] telnet server enable
Press Enter, and enter the configured user name and password in the login
window. If authentication succeeds, the CLI is displayed, indicating that you have
successfully logged in to the device. (The following information is only for
reference.)
Login authentication
Username:admin1234
Password:
Info: The max number of VTY users is 8, and the number
of current VTY users on line is 2.
The current login time is 2012-08-06 18:33:18+00:00.
<Telnet_Server>
----End
Configuration File
Telnet_Server configuration file
#
sysname Telnet_Server
#
telnet server enable
#
acl number 2001
rule 5 permit source 10.1.1.1 0
#
aaa
local-user admin1234 password irreversible-cipher $1a$aVW8S=aP=B<OWi1Bu'^R[=_!~oR*85r_nNY+kA(I}
[TiLiVGR-i/'DFGAI-O$
local-user admin1234 privilege level 3
local-user admin1234 service-type telnet
#
user-interface maximum-vty 15
user-interface vty 0 14
acl 2001 inbound
authentication-mode aaa
history-command max-size 20
idle-timeout 20 0
screen-length 0
protocol inbound telnet
#
return
Networking Requirements
As shown in Figure 2-14, two NMSs are available on the network to monitor
network devices. The network size is small and the network has a high security
level. Therefore, the administrator requires that only the trusted NMS (NMS2)
manage network devices and the Switch use SNMPv1 to communicate with the
NMS. Invalid NMSs cannot manage the Switch. According to service requirements,
the administrator allows the NMS to manage only the objects except RMON, and
the administrator should be able to locate and rectify faults quickly through the
NMS.
NMS1 GE0/0/1
10.1.1.1/24 VLANIF100
10.1.2.1/24
IP network
Switch
NMS2
10.1.1.2/24
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure an IP address for the interface of Switch to provide a reachable route
between the NMS and the Switch.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan 100
[Switch-vlan100] quit
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type hybrid
[Switch-GigabitEthernet0/0/1] port hybrid pvid vlan 100
[Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface vlanif 100
[Switch-Vlanif100] ip address 10.1.2.1 24
[Switch-Vlanif100] quit
# Configure an ACL that allows NMS2 to manage the Switch and prevents NMS1
from managing the Switch.
# Configure the MIB view to allow NMS2 to manage all MIB objects on the Switch
except RMON objects.
[Switch] snmp-agent mib-view excluded allextrmon 1.3.6.1.2.1.16
# Configure a community name and reference the ACL and MIB view for the
community.
[Switch] snmp-agent community write adminnms2 mib-view allextrmon acl 2001
NOTE
The authentication parameter configuration on the NMS must be the same as that on the
Switch. Otherwise, the NMS cannot manage the Switch. If only the write community name
is configured on the device, the read and write community names on the NMS must be the
same as the write community name configured on the device.
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 100
#
acl number 2001
rule 5 permit source 10.1.1.2 0
rule 6 deny source 10.1.1.1 0
#
interface Vlanif100
ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type hybrid
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
snmp-agent
snmp-agent local-engineid 800007DB03360102101100
snmp-agent community write cipher %^%#.T|&Whvyf$<Gd"I,wXi5SP_6~Nakk6<<+3H:N-h@aJ6d,l0md
%HCeAY8~>X=>xV\JKNAL=124r839v<*%^%# mib-view allextrmon acl 2001
snmp-agent sys-info version v1 v3
snmp-agent target-host trap address udp-domain 10.1.1.2 params securityname cipher %^%#uq/!
YZfvW4*vf[~C|.:Cl}UqS(vXd#wwqR~5M(rU%%^%#
snmp-agent mib-view excluded allextrmon rmon
#
return
Networking Requirements
Figure 2-15 shows how on an OSPF network, SwitchA receives routes from the
Internet and provides these routes for the OSPF network. A user wants devices on
the OSPF network to access only the network segments 172.16.17.0/24,
172.16.18.0/24, and 172.16.19.0/24, and SwitchC to access only the network
segment 172.16.18.0/24.
Figure 2-15 Networking diagram for filtering the received and advertised routes
172.16.16.0/24
GE0/0/1 GE0/0/1 172.16.17.0/24
GE0/0/2 GE0/0/1 172.16.18.0/24
172.16.19.0/24
SwitchC SwitchB SwitchA 172.16.20.0/24
OSPF
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure an ACL on SwitchA so that SwitchA advertises only the
172.16.17.0/24, 172.16.18.0/24, and 172.16.19.0/24 routes to SwitchB. In this
situation, the OSPF network can access only 172.16.17.0/24, 172.16.18.0/24,
and 172.16.19.0/24.
2. Configure an ACL on SwitchC so that SwitchC receives only the 172.16.18.0/24
routes. In this situation, the network connected to SwitchC can access only the
network segments 172.16.18.0/24.
Procedure
Step 1 Add interfaces to VLANs.
# Configure SwitchA. Ensure that the configurations of SwitchB and SwitchC are
the same as the configuration of SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 10
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet0/0/1] quit
# Configure SwitchB.
[SwitchB] ospf
[SwitchB-ospf-1] area 0
[SwitchB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] quit
# Configure SwitchC.
[SwitchC] ospf
[SwitchC-ospf-1] area 0
[SwitchC-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.0] quit
[SwitchC-ospf-1] quit
Step 4 Configure five static routes on SwitchA and import these routes into OSPF.
[SwitchA] ip route-static 172.16.16.0 24 NULL 0
[SwitchA] ip route-static 172.16.17.0 24 NULL 0
[SwitchA] ip route-static 172.16.18.0 24 NULL 0
[SwitchA] ip route-static 172.16.19.0 24 NULL 0
[SwitchA] ip route-static 172.16.20.0 24 NULL 0
[SwitchA] ospf
[SwitchA-ospf-1] import-route static
[SwitchA-ospf-1] quit
# Check the IP routing table on SwitchB. You can see that the five static routes are
imported into OSPF.
[SwitchB] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
# Configure a route advertisement policy on SwitchA and associate ACL 2002 with
the policy to filter routes.
[SwitchA] ospf
[SwitchA-ospf-1] filter-policy 2002 export static
[SwitchA-ospf-1] quit
# View the IP routing table on SwitchB. SwitchB has received only the three routes
defined in ACL 2002.
[SwitchB] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
# Configure a route receiving policy on SwitchC and associate ACL 2003 with the
policy to filter routes.
[SwitchC] ospf
[SwitchC-ospf-1] filter-policy 2003 import
[SwitchC-ospf-1] quit
# View the IP routing table on SwitchC. SwitchC has received only the route
defined in ACL 2003.
[SwitchC] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 5 Routes : 5
----End
Configuration Files
● Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 10
#
acl number 2002
rule 5 permit source 172.16.17.0 0.0.0.255
rule 10 permit source 172.16.18.0 0.0.0.255
rule 15 permit source 172.16.19.0 0.0.0.255
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
ospf 1
filter-policy 2002 export static
import-route static
area 0.0.0.0
Networking Requirements
As shown in Figure 2-16, the departments of an enterprise are connected through
the Switch. To facilitate network management, the administrator allocates the IP
addresses on two network segments to the R&D and marketing departments
respectively. In addition, the administrator adds the two departments to different
VLANs for broadcast domain isolation. The Switch needs to restrict mutual access
between two network segments to ensure information security.
Figure 2-16 Using advanced ACLs to restrict mutual access between network
segments
LAN SwitchA
VLAN10
GE0/0/1
VLANIF 10
10.1.1.1/24
R&D
10.1.1.0/24 GE0/0/3
Internet
Switch Router
VLAN20 GE0/0/2
VLANIF 20
10.1.2.1/24
LAN SwitchB
Marketing
10.1.2.0/24
Configuration Roadmap
The following configurations are performed on the Switch. The configuration
roadmap is as follows:
1. Configure an advanced ACL and ACL-based traffic classifier to filter the
packets exchanged between R&D and marketing departments.
2. Configure a traffic behavior to discard the packets matching the ACL.
3. Configure and apply a traffic policy to make the ACL and traffic behavior take
effect.
Procedure
Step 1 Configure VLANs and IP addresses for interfaces to ensure network connections.
# Create VLAN 10 and VLAN 20.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20
# Configure GE0/0/1 and GE0/0/2 on the Switch as trunk interfaces and add the
interfaces to VLAN 10 and VLAN 20 respectively.
# Create advanced ACL 3001 and configure rules for the ACL to block the packets
from the R&D department to the marketing department.
[Switch] acl 3001
[Switch-acl-adv-3001] rule deny ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255
[Switch-acl-adv-3001] quit
# Create advanced ACL 3002 and configure rules for the ACL to block the packets
from the marketing department to the R&D department.
[Switch] acl 3002
[Switch-acl-adv-3002] rule deny ip source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255
[Switch-acl-adv-3002] quit
# Configure the traffic classifier tc1 to classify packets that match ACL 3001 and
ACL 3002.
[Switch] traffic classifier tc1
[Switch-classifier-tc1] if-match acl 3001
[Switch-classifier-tc1] if-match acl 3002
[Switch-classifier-tc1] quit
# Define the traffic policy and associate the traffic classifier and traffic behavior
with the traffic policy.
[Switch] traffic policy tp1
[Switch-trafficpolicy-tp1] classifier tc1 behavior tb1
[Switch-trafficpolicy-tp1] quit
# Packets from the R&D department are received by GE0/0/1 and packets from
the marketing department are received by GE0/0/2; therefore, apply the traffic
policy to the inbound direction of GE0/0/1 and GE0/0/2.
# The two network segments where the R&D and marketing departments reside
cannot access each other.
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 10 20
#
acl number 3001
rule 5 deny ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255
acl number 3002
rule 5 deny ip source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255
#
traffic classifier tc1 operator or
if-match acl 3001
if-match acl 3002
#
traffic behavior tb1
deny
#
traffic policy tp1 match-order config
Related Content
Videos
Configure ACL
Networking Requirements
As shown in Figure 2-17, different offices of an enterprise are connected through
SwitchC. To facilitate network management, the administrator allocates the IP
addresses on two network segments to the president's office and employee's
office, respectively. In addition, the administrator adds the two offices to different
VLANs for broadcast domain isolation. The president's office must be able to
access the employee's office, but the employee's office is not allowed to access the
president's office to protect the enterprise's confidential information.
SwitchC
Router
VLAN 20 GE0/0/2
VLANIF 20
10.1.2.1/24
LAN SwitchB
Employee's office
10.1.2.0/24
Configuration Roadmap
1. Configure an advanced ACL and ACL-based traffic classifier to restrict ICMP
and TCP services so that unidirectional access from the president's office to
the employee's office can be implemented.
– TCP service: permits SYN and ACK packets from the employee's office to
the president's office, that is, responds to TCP connections initiated by the
president's office; denies SYN request packets from the employee's office
to the president's office to prevent the employee's office from initiating
TCP connections.
– ICMP service: denies echo request packets from the employee's office to
the president's office to prevent the employee's office from initiating ping
connectivity tests.
NOTE
Procedure
Step 1 Configure IP addresses for interfaces and add the interfaces to VLANs.
# Create VLAN 10 and VLAN 20.
<HUAWEI> system-view
[HUAWEI] sysname SwitchC
[SwitchC] vlan batch 10 20
# Configure GE0/0/1 and GE0/0/2 on the SwitchC as trunk interfaces and add
them to VLAN 10 and VLAN 20, respectively.
[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] port link-type trunk
[SwitchC-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[SwitchC-GigabitEthernet0/0/1] quit
[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] port link-type trunk
[SwitchC-GigabitEthernet0/0/2] port trunk allow-pass vlan 20
[SwitchC-GigabitEthernet0/0/2] quit
syn ack
[SwitchC-acl-adv-3001] rule deny tcp source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 tcp-flag syn
[SwitchC-acl-adv-3001] rule deny icmp source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 icmp-
type echo
[SwitchC-acl-adv-3001] quit
# Configure the traffic classifier tc1 to classify packets that match ACL 3001.
[SwitchC] traffic classifier tc1
[SwitchC-classifier-tc1] if-match acl 3001
[SwitchC-classifier-tc1] quit
# Define a traffic policy, and associate the traffic classifier and traffic behavior
with the traffic policy.
[SwitchC] traffic policy tp1
[SwitchC-trafficpolicy-tp1] classifier tc1 behavior tb1
[SwitchC-trafficpolicy-tp1] quit
# The president's office can access the employee's office, but the employee's office
cannot access the president's office.
----End
Configuration Files
SwitchC configuration file
#
sysname SwitchC
#
vlan batch 10 20
#
acl number 3001
rule 5 permit tcp source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 tcp-flag ack syn
rule 10 deny tcp source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 tcp-flag syn
rule 15 deny icmp source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 icmp-type echo
#
traffic classifier tc1 operator or
if-match acl 3001
#
traffic behavior tb1
permit
#
traffic policy tp1 match-order config
classifier tc1 behavior tb1
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface Vlanif20
ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
traffic-policy tp1 inbound
#
return
Related Content
Videos
Configure ACL
Networking Requirements
As shown in Figure 2-18, the departments of an enterprise are connected through
the Switch. The R&D and marketing departments cannot access the salary query
server at 10.164.9.9 in work hours (08:00 to 17:30), whereas the president office
can access the server at anytime.
Figure 2-18 Using advanced ACLs to control access to the specified server in the
specified time range
VLAN10
LAN SwitchA
Salary query server
GE0/0/1 10.164.9.9/24
VLANIF 10
10.164.1.1/24
President office GE0/0/4
10.164.1.0/24 VLANIF 100
10.164.9.1/24
LAN SwitchB
VLAN20 GE0/0/2
Internet
VLANIF 20
10.164.2.1/24 Switch Router
Marketing
10.164.2.0/24 GE0/0/3
VLANIF 30
VLAN30 10.164.3.1/24
LAN SwitchC
R&D
10.164.3.0/24
Configuration Roadmap
The following configurations are performed on the Switch. The configuration
roadmap is as follows:
1. Configure the time range, advanced ACL, and ACL-based traffic classifier to
filter packets from users to the server in the specified time range. In this way,
you can restrict the access of different users to the server in the specified time
range.
2. Configure a traffic behavior to discard the packets matching the ACL.
3. Configure and apply a traffic policy to make the ACL and traffic behavior take
effect.
Procedure
Step 1 Add interfaces to VLANs and assign IP addresses to the VLANIF interfaces.
# Add GE0/0/1 - GE0/0/3 to VLANs 10, 20, and 30 respectively, add GE0/0/4 to
VLAN 100, and assign IP addresses to the VLANIF interfaces. The configurations on
GE0/0/1 and VLANIF 10 are used as an example here. The configurations on
GE0/0/2, GE0/0/3, and GE0/0/4 are similar to those on GE0/0/1, and the
configurations on VLANIF 20, VLANIF 30, and VLANIF 100 are similar to the
configurations on VLANIF 10.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20 30 100
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface vlanif 10
[Switch-Vlanif10] ip address 10.164.1.1 255.255.255.0
[Switch-Vlanif10] quit
# Configure an ACL for the R&D department to access the salary query server.
[Switch] acl 3003
[Switch-acl-adv-3003] rule deny ip source 10.164.3.0 0.0.0.255 destination 10.164.9.9 0.0.0.0 time-range
satime
[Switch-acl-adv-3003] quit
# Configure the traffic classifier c_rd to classify the packets that match ACL 3003.
[Switch] traffic classifier c_rd
[Switch-classifier-c_rd] if-match acl 3003
[Switch-classifier-c_rd] quit
# Configure the traffic policy p_rd and associate the traffic classifier c_rd and the
traffic behavior b_rd with the traffic policy.
# Packets from the marketing department are received by GE0/0/2, so apply the
traffic policy p_market to the inbound direction of GE0/0/2.
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] traffic-policy p_market inbound
[Switch-GigabitEthernet0/0/2] quit
# Packets from the R&D department are received by GE0/0/3, so apply the traffic
policy p_rd to the inbound direction of GE0/0/3.
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] traffic-policy p_rd inbound
[Switch-GigabitEthernet0/0/3] quit
Classifier: c_rd
Operator: OR
Rule(s) : if-match acl 3003
Policy: p_rd
Classifier: c_rd
Operator: OR
Behavior: b_rd
Deny
# The R&D and marketing departments cannot access the salary query server in
work hours (08:00 to 17:30).
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 10 20 30 100
#
time-range satime 08:00 to 17:30 working-day
#
acl number 3002
rule 5 deny ip source 10.164.2.0 0.0.0.255 destination 10.164.9.9 0 time-range satime
acl number 3003
rule 5 deny ip source 10.164.3.0 0.0.0.255 destination 10.164.9.9 0 time-range satime
#
traffic classifier c_market operator or
if-match acl 3002
traffic classifier c_rd operator or
if-match acl 3003
#
traffic behavior b_market
deny
traffic behavior b_rd
deny
#
traffic policy p_market match-order config
classifier c_market behavior b_market
traffic policy p_rd match-order config
classifier c_rd behavior b_rd
#
interface Vlanif10
ip address 10.164.1.1 255.255.255.0
#
interface Vlanif20
ip address 10.164.2.1 255.255.255.0
#
interface Vlanif30
Networking Requirements
As shown in Figure 2-19, the Switch that functions as the gateway is connected to
the users' PCs. The administrator wants to block network access of PC1 after
detecting that PC1 (00e0-f201-0101) is an unauthorized user.
Figure 2-19 Using Layer 2 ACLs to block network access of the specified users
GE0/0/2 GE0/0/1
PC1 Internet
00e0-f201-0101
PC2
00e0-f201-0102
Configuration Roadmap
The following configurations are performed on the Switch. The configuration
roadmap is as follows:
1. Configure a Layer 2 ACL and ACL-based traffic classifier to discard packets
from MAC address 00e0-f201-0101 (preventing the user with this MAC
address from accessing the network).
Procedure
Step 1 Configure an ACL.
# Configure a Layer 2 ACL to meet the preceding requirement.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] acl 4000
[Switch-acl-L2-4000] rule deny source-mac 00e0-f201-0101 ffff-ffff-ffff
[Switch-acl-L2-4000] quit
# The user with MAC address 00e0-f201-0101 cannot access the Internet.
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
acl number 4000
rule 5 deny source-mac 00e0-f201-0101
#
traffic classifier tc1 operator or
if-match acl 4000
#
traffic behavior tb1
deny
#
traffic policy tp1 match-order config
classifier tc1 behavior tb1
#
interface GigabitEthernet0/0/2
traffic-policy tp1 inbound
#
return
Networking Requirements
Voice, video, and data services are transmitted in VLAN 120, VLAN 110, and VLAN
100 respectively.
Phone
VLAN 120
PC GE0/0/1 GE0/0/2
Network
TV
Enterprise Traffic
campus network direction
VLAN110
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and configure interfaces so that the enterprise can access the
Network through the Switch.
2. Configure ACLs on the Switch to match services from different VLANs.
3. Configure ACL-based traffic policing on the Switch to limit different packets
from the enterprise.
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 100, VLAN 110, and VLAN 120 on the Switch.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 100 110 120
# Configure GE0/0/1 and GE0/0/2 as trunk interfaces, and add GE0/0/1 and
GE0/0/2 to VLAN 100, VLAN 110, and VLAN 120.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 110 120
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 110 120
[Switch-GigabitEthernet0/0/2] quit
ACL 4001
rule 1 permit vlan-id 120
ACTIONS:
limit cir 2000 ,cbs 250000
pir 10000 ,pbs 1250000
green : pass
yellow : pass
red : drop
-----------------------------------------------------------
ACL 4002
rule 1 permit vlan-id 110
ACTIONS:
limit cir 4000 ,cbs 500000
pir 10000 ,pbs 1250000
green : pass
yellow : pass
red : drop
-----------------------------------------------------------
ACL 4003
rule 1 permit vlan-id 100
ACTIONS:
limit cir 4000 ,cbs 500000
pir 10000 ,pbs 1250000
green : pass
yellow : pass
red : drop
-----------------------------------------------------------
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 100 110 120
#
acl number 4001
rule 1 permit vlan-id 120
acl number 4002
rule 1 permit vlan-id 110
acl number 4003
rule 1 permit vlan-id 100
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100 110 120
traffic-limit inbound acl 4001 cir 2000 pir 10000 cbs 250000 pbs 1250000
traffic-limit inbound acl 4002 cir 4000 pir 10000 cbs 500000 pbs 1250000
traffic-limit inbound acl 4003 cir 4000 pir 10000 cbs 500000 pbs 1250000
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100 110 120
#
return
Networking Requirements
As shown in Figure 2-21, users are connected to the Switch through GE0/0/1. The
Switch needs to discard certain packets sent by users (four bytes behind the 14th
byte in the packet match 0x0180C200).
PC1
GE0/0/1 GE0/0/2
Internet
PC2
Configuration Roadmap
The following configurations are performed on the Switch. The configuration
roadmap is as follows:
Procedure
Step 1 Configure an ACL.
# Configure the traffic classifier tc1 to classify packets that match ACL 5000.
[Switch] traffic classifier tc1
[Switch-classifier-tc1] if-match acl 5000
[Switch-classifier-tc1] quit
# Define the traffic policy and associate the traffic classifier and traffic behavior
with the traffic policy.
[Switch] traffic policy tp1
[Switch-trafficpolicy-tp1] classifier tc1 behavior tb1
[Switch-trafficpolicy-tp1] quit
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
acl number 5000
rule 5 deny 0x0180c200 0xffffffff 14
#
traffic classifier tc1 operator or
if-match acl 5000
#
traffic behavior tb1
deny
#
traffic policy tp1 match-order config
classifier tc1 behavior tb1
#
interface GigabitEthernet0/0/1
traffic-policy tp1 inbound
#
return
Networking Requirements
As shown in Figure 2-22, a large number of terminals in an office area of an
enterprise connect to the enterprise internal network through the switch. Some
departments have multiple branches in different locations, so the terminals of the
same department cannot use the IP addresses of the same network segment.
The administrator requires that the switch authenticate the terminals (including
computers and printers) of every department, to prevent unauthorized users. In
addition, due to the differentiated responsibilities, the administrator wants to
grant different network access rights to the users of different department,
avoiding secret information leak caused by mutual access between users.
Figure 2-22 Using user ACLs to control network access rights of enterprise's
internal users based on groups
LAN SwitchA
Marketing 1
& R&D 1
IT
LAN SwitchC
192.168.3.0/24
VLAN 30
Configuration Roadmap
The configuration roadmap is as follows:
NOTE
This example only provides the configurations on the Switch. The configurations on LAN
switch and RADIUS server are not provided here.
Procedure
Step 1 Configure VLANs and IP addresses for interfaces to ensure network connections.
# Create VLAN 10, VLAN 20, VLAN 30, and VLAN 40.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20 30 40
# Create VLANIF 10, VLANIF 20, VLANIF 30, and VLANIF 40, and assign IP
addresses to these VLANIF interfaces so that reachable routes can be set up
between the terminals, Switch, and enterprise internal servers.
[Switch] interface vlanif 10
[Switch-Vlanif10] ip address 192.168.1.1 24
[Switch-Vlanif10] quit
[Switch] interface vlanif 20
[Switch-Vlanif20] ip address 192.168.2.1 24
[Switch-Vlanif20] quit
[Switch] interface vlanif 30
[Switch-Vlanif30] ip address 192.168.3.1 24
[Switch-Vlanif30] quit
Step 2 Create and configure a RADIUS server template, an AAA scheme, and an
authentication domain.
# Create and configure the RADIUS server template rd1.
[Switch] radius-server template rd1
[Switch-radius-rd1] radius-server authentication 192.168.4.30 1812
[Switch-radius-rd1] radius-server shared-key cipher huawei@2017
[Switch-radius-rd1] radius-server retransmit 2
[Switch-radius-rd1] quit
# Create AAA scheme abc and set the authentication mode to RADIUS.
[Switch] aaa
[Switch-aaa] authentication-scheme abc
[Switch-aaa-authen-abc] authentication-mode radius
[Switch-aaa-authen-abc] quit
# Create authentication domain abc11, and bind the AAA scheme abc and
RADIUS server template rd1 to the authentication domain.
[Switch-aaa] domain abc11
[Switch-aaa-domain-abc11] authentication-scheme abc
[Switch-aaa-domain-abc11] radius-server rd1
[Switch-aaa-domain-abc11] quit
[Switch-aaa] quit
NOTE
By default, the NAC mode is unified mode, so this step can be skipped.
After the common mode and unified mode are switched, you must restart the device to make
each function take effect in the new mode.
[Switch] authentication unified-mode
By default, an 802.1X access profile uses the EAP authentication mode. Ensure that the RADIUS
server supports EAP; otherwise, the server cannot process 802.1X authentication request packets.
[Switch] dot1x-access-profile name d1
[Switch-dot1x-access-profile-d1] quit
Step 4 Create an UCL group, associate the user ACL with the UCL group, and apply the
user ACL to filter packets.
# Create UCL groups group_m and group_r. Add the marketing department to
group_m and R&D department to group_r.
[Switch] ucl-group 1 name group_m
[Switch] ucl-group 2 name group_r
NOTE
The user group information of marketing and R&D departments must have been configured on
the RADIUS server.
# Create user ACL 6001 and configure ACL rules. Configure rule 5 to prevent the
marketing department from accessing the IT department; configure rule 10 to
prevent the R&D department from accessing the IT department.
[Switch] acl 6001
[Switch-acl-ucl-6001] rule 5 deny ip source ucl-group name group_m destination 192.168.3.0 0.0.0.255
[Switch-acl-ucl-6001] rule 10 deny ip source ucl-group name group_r destination 192.168.3.0 0.0.0.255
[Switch-acl-ucl-6001] quit
# Configure user ACL-based packet filtering to make the user ACL take effect.
[Switch] traffic-filter inbound acl 6001
Step 5 Configure service schemes service-scheme1 and service-scheme2, and apply the
service schemes to UCL groups group_m and group_r to control the network
access right of each department based on groups.
[Switch] aaa
[Switch-aaa] service-scheme service-scheme1
[Switch-aaa-service-service-scheme1] ucl-group name group_m
[Switch-aaa-service-service-scheme1] quit
[Switch-aaa] service-scheme service-scheme2
[Switch-aaa-service-service-scheme2] ucl-group name group_r
[Switch-aaa-service-service-scheme2] quit
[Switch-aaa] quit
[Switch] quit
NOTE
After the preceding steps are complete, configure the RADIUS server to associate the service
schemes with users.
# Run the display acl all command to view information about the user ACL.
<Switch> display acl all
Total nonempty ACL number is 1
# Run the display ucl-group all command to view information about all UCL
groups.
<Switch> display ucl-group all
ID UCL group name
--------------------------------------------------------------------------------
1 group_m
2 group_r
--------------------------------------------------------------------------------
Total : 2
# The marketing department cannot access the IT department and the R&D
department cannot access the IT department.
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
vlan batch 10 20 30 40
#
authentication-profile name p1
dot1x-access-profile d1
mac-access-profile m1
authentication dot1x-mac-bypass
ucl-group 1 name group_m
ucl-group 2 name group_r
#
radius-server template rd1
radius-server shared-key cipher %^%#zH_B2{mN=177WZ2z+G|5)c'OKD[VaPNYP4>&6uC~%^%#
radius-server authentication 192.168.4.30 1812 weight 80
radius-server retransmit 2
#
acl number 6001
rule 5 deny ip source ucl-group name group_m destination 192.168.3.0 0.0.0.255
rule 10 deny ip source ucl-group name group_r destination 192.168.3.0 0.0.0.255
#
aaa
authentication-scheme abc
authentication-mode radius
service-scheme service-scheme1
ucl-group name group_m
service-scheme service-scheme2
ucl-group name group_r
domain abc11
authentication-scheme abc
radius-server rd1
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
#
interface Vlanif30
ip address 192.168.3.1 255.255.255.0
#
interface Vlanif40
ip address 192.168.4.29 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
authentication-profile p1
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
authentication-profile p1
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 30
authentication-profile p1
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 40
#
traffic-filter inbound acl 6001
#
dot1x-access-profile name d1
#
mac-access-profile name m1
mac-authen username fixed A-123 password cipher %^%#(!XnF'#X^Sc=[&,fH38!
OKNNEjez>NO`Z*NJK*s4%^%#
#
return
Networking Requirements
As shown in Figure 2-23, users are connected to the Switch through GE0/0/1. The
Switch needs to block the certain types of IPv6 packets from users in which the
source IPv6 address is host address fc01::2/64 and destination IPv6 address is
fc01::1/64.
Figure 2-23 Using advanced ACL6s to filter certain types of IPv6 packets
VLAN 10
VLANIF 10
VLAN10 fc01::1/64
GE0/0/1 GE0/0/2
Internet
Configuration Roadmap
The following configurations are performed on the Switch. The configuration
roadmap is as follows:
1. Configure an advanced ACL6 and ACL6-based traffic classifier to filter the
IPv6 packets in which the source IPv6 address is host address fc01::2/64 and
destination IPv6 address is fc01::1/64.
2. Configure a traffic behavior to discard the packets matching the ACL6.
3. Configure and apply a traffic policy to make the ACL6 and traffic behavior
take effect.
Procedure
Step 1 Enable the IPv6 forwarding capability, add an interface to a VLAN, and assign an
IPv6 address to the VLANIF interface.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] ipv6
[Switch] vlan batch 10
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface vlanif 10
[Switch-Vlanif10] ipv6 enable
[Switch-Vlanif10] ipv6 address fc01::1 64
[Switch-Vlanif10] quit
Step 2 Configure an advanced ACL6 and ACL6-based traffic classifier. Configure a traffic
behavior and traffic policy, and apply the traffic policy to the inbound direction of
GE0/0/1 to reject the IPv6 packets with source IPv6 address fc01::2/64 and
destination IPv6 address fc01::1/64.
[Switch] acl ipv6 number 3001
[Switch-acl6-adv-3001] rule deny ipv6 source fc01::2/64 destination fc01::1/64
[Switch-acl6-adv-3001] quit
[Switch] traffic classifier class1
[Switch-classifier-class1] if-match ipv6 acl 3001
[Switch-classifier-class1] quit
[Switch] traffic behavior behav1
[Switch-behavior-behav1] deny
[Switch-behavior-behav1] statistic enable
[Switch-behavior-behav1] quit
[Switch] traffic policy policy1
[Switch-trafficpolicy-policy1] classifier class1 behavior behav1
[Switch-trafficpolicy-policy1] quit
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] traffic-policy policy1 inbound
[Switch-GigabitEthernet0/0/1] quit
# If PC1 cannot access the network, run the display traffic policy statistics
interface gigabitethernet 0/0/1 inbound command on the Switch. The command
output shows that the number of matched packets is the same as the number of
discarded packets. This indicates that packets matching ACL 3001 are all
discarded.
----End
Configuration Files
Switch configuration file
#
sysname Switch
#
ipv6
#
vlan batch 10
#
acl ipv6 number 3001
rule 0 deny ipv6 source FC01::/64 destination FC01::/64
#
traffic classifier class1 operator or
if-match ipv6 acl 3001
#
traffic behavior behav1
deny
statistic enable
#
traffic policy policy1 match-order config
classifier class1 behavior behav1
#
interface Vlanif10
ipv6 enable
ipv6 address FC01::1/64
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
traffic-policy policy1 inbound
#
return
Fault Description
A traffic policy has been configured on a device to redirect packets. To redirect the
packets from a certain IP address, the administrator adds a rule to the ACL used
by the traffic policy following the ACL configuration guidelines. The new rule uses
this source IP address as the matching condition. However, the IP address wildcard
mask in the rule is incorrectly configured. As a result, BGP packets cannot be sent
to the CPU and most services are interrupted.
Procedure
Step 1 Run the display this command in the ACL view to check the new rule.
The new rule is as follows:
rule 100 permit ip source 10.1.1.3 255.255.255.255
Services are recovered, and packets from source IP address 10.1.1.3 are redirected
correctly.
----End
Fault Description
An ACL is configured on the device to restrict the destination addresses that can
be accessed by users; however, the DNS server address is blocked in the ACL. As a
result, the query packets sent from users to the DNS server are discarded. The
domain names cannot be resolved, so users cannot access the Internet.
Procedure
Step 1 Run the display acl command in the system view to check ACL rules.
The following rule is included:
rule 100 deny ip destination 10.102.192.0 0.0.0.255 //Reject the packets from network segment
10.102.192.0/24.
The DNS server address configured on user PCs is 10.102.192.68, which belongs to
network segment 10.102.192.0/24. Therefore, packets sent from users to the DNS
server are discarded. The domain names cannot be resolved, so users cannot
access the Internet.
Step 2 Run the rule (advanced ACL view) command in the ACL view to add a rule to
permit the DNS server address.
rule 99 permit ip destination 10.102.192.68 0.0.0.0 //Permit the packets destined for the DNS server.
rule 100 deny ip destination 10.102.192.0 0.0.0.255 //Reject the packets destined for network segment
10.102.192.0/24.
After rule 99 is added, the packets sent from users to the DNS server match rule
99 and pass. The domain names can be resolved, and users can access the
Internet.
----End
Fault Description
The system time on the device is incorrect, so the time range-based ACL does not
take effect.
Procedure
Step 1 Run the display acl command in the system view to check ACL rules.
A rule based on time range is included:
rule 10 deny ip source 10.1.1.1 0 time-range time1 //Reject the packets from 10.1.1.1 in the time range
time1.
Step 2 Run the display time-range { all | time-name } command in the system view to
check the configuration of time range time1.
The following information is displayed:
Current time is 14:53:17 8-16-2013 Friday
The time range time1 starts at 00:00 on January 1, 2014 and ends at 23:59 on
December 31, 2014, while the system time is 14:53:17 on August 16, 2013. The
actual date is August 16, 2014. The system time on the device is not within the
time range time1. Therefore, the ACL associating with time1 does not take effect,
and packets from 10.1.1.1 are not discarded.
Step 3 Change the system date and time.
● Correct the system date and time.
Run the clock datetime command in the user view.
clock datetime 14:53:17 2014-08-16 //Set the date to 2014-08-16.
b. On the device that needs to synchronize clock with the trusted device, set
the NTP working mode. For details, see Configuring NTP Operating
Modes in "NTP Configuration" in the S1720, S2700, S5700, and S6720
V200R011C10 Configuration Guide - Device Management.
----End
Fault Description
As shown in Figure 2-24, the departments of an enterprise are connected through
the Switch. GE0/0/4 of the Switch is connected to the salary query server. The
enterprise allows only the president office to access the salary query server, but
prevents other departments, such as R&D and marketing departments, from
accessing the salary query server. Therefore, the administrator configures an ACL
and a traffic policy that uses the ACL on the Switch, and applies the traffic policy
to the inbound direction of GE0/0/4. The traffic policy is applied to a wrong
direction, so access control does not take effect.
VLAN10
LAN SwitchA
Salary query server
GE0/0/1 10.164.9.9/24
VLANIF 10
10.164.1.1/24
President office GE0/0/4
10.164.1.0/24 VLANIF 100
10.164.9.1/24
LAN SwitchB
VLAN20 GE0/0/2
Internet
VLANIF 20
10.164.2.1/24 Switch Router
Marketing
10.164.2.0/24 GE0/0/3
VLANIF 30
VLAN30 10.164.3.1/24
LAN SwitchC
R&D
10.164.3.0/24
Procedure
Step 1 Run the display traffic policy interface [ interface-type interface-number ]
command in any view to check traffic policy configuration on the interface.
The traffic policy p1 has been applied to the inbound direction of GE0/0/4.
Interface: GigabitEthernet0/0/4
Direction: Inbound
Policy: p1
......
Interface: GigabitEthernet0/0/4
Direction: Inbound
Policy: p1
Classifier: c1
Operator: OR
Rule(s) :
if-match acl 3001
Behavior: b1
Deny
-----------------------------------------------------------
Step 3 Run the display this command in the view of advanced ACL 3001 to check ACL
rule configuration.
ACL 3001 contains the following rules:
acl number 3001
rule 5 permit ip source 10.164.1.0 0.0.0.255 destination 10.164.9.9 0 //Allow the president office to
access the server.
rule 10 deny ip destination 10.164.9.9 0 //Prevent other departments from accessing the server.
The source IP address is the network segment where the president office resides
and the destination IP address is the salary query server's address. The ACL rules
meet the packet filtering requirement, so the ACL configuration is correct.
Step 4 Check the direction to which the traffic policy is applied.
As shown in Step 2, the traffic policy is applied to the inbound direction of the
interface. However, packets from each department do not enter the Switch
through GE0/0/4, but enter the Switch through other interfaces and are sent out
through GE0/0/4. (The Switch searches for a route after receiving the packets, and
sends packets out through GE0/0/4.)
Therefore, when the traffic policy using the ACL is applied to the inbound direction
of GE0/0/4, access control does not take effect. To make access control effective,
apply the traffic policy to the outbound direction or apply the traffic policy
globally, to the VLANs of the departments, or to the inbound direction of each
interface connecting to each department.
Step 5 Change the direction to which the traffic policy is applied.
Run the traffic-policy policy-name outbound command in the view of GE0/0/4 to
apply the traffic policy to the outbound direction.
----End
Login control The device controls access ● Telnet: See "Enabling the
permission of users. Only Telnet Server Function" in
authorized users can log in to the Configuration Guide -
the device, and other users Basic Configuration of the
cannot log in without corresponding product
permission. This ensures version.
network security. ● FTP: See "Managing Files
When the Device
Functions as an FTP
Server" in the
Configuration Guide -
Basic Configuration of the
corresponding product
version.
● SFTP: See "Managing Files
When the Device
Functions as an SFTP
Server" in the
Configuration Guide -
Basic Configuration of the
corresponding product
version.
● HTTP: See "Configuring
Access Control on Web
Users" in the
Configuration Guide -
Basic Configuration of the
corresponding product
version.
● SNMP: See "(Optional)
Restricting Management
Rights of the NMS"
(SNMPv1 and SNMPv2c)
and "(Optional)
Restricting Management
Rights of the NMS"
(SNMPv3) in the
Configuration Guide -
Network Management
and Monitoring of the
corresponding product
version.
Route filtering ACLs can be applied to various ● BGP: See "Controlling the
dynamic routing protocols to Advertisement of BGP
filter advertised and received Routes" and "Controlling
routes and multicast groups. the Receiving of BGP
For example, you can apply an Routes" in the
ACL to a routing policy to Configuration Guide - IP
prevent the device from Unicast routing of the
sending routes of a network corresponding product
segment to the neighboring version.
router. ● IS-IS (IPv4): See
"Configuring IS-IS to
Advertise Specified
External Routes to an IS-IS
Routing Domain" and
"Adding Specified IS-IS
Routes to the IP Routing
Table" in the
Configuration Guide - IP
Unicast routing of the
corresponding product
version.
● OSPF: See "Configuring
OSPF to Filter Received
Routes" and "Configuring
OSPF to Filter the Routes
to Be Advertised" in the
Configuration Guide - IP
Unicast routing of the
corresponding product
version.
● RIP: See "Configuring RIP
to Import Routes" and
"Configuring RIP to Filter
Received Routes" in the
Configuration Guide - IP
Unicast routing of the
corresponding product
version.
● Multicast: See "Filtering
IGMP Messages Based on
Source IP Addresses",
"Configuring a Multicast
Group Policy" and
"(Optional) Configuring
an SSM Group Policy" in
the Configuration Guide -
IP Multicast of the
corresponding product
version.
NOTE
The traffic policy module permits packets by default. If you just want to block mutual
access between network segments, you only need to define the characteristics of the
packets to be denied in the ACL. If you add rule permit at the bottom of the ACL, the
packets that do not match previous rules will match the last rule. In addition, if the traffic
behavior is set to deny, the device discards all packets matching rule permit. As a result, all
services are interrupted.
NOTE
The following commands are only for you reference. You should comply with the command line
syntax of the version running on your device.
● Method 1: Apply a traffic policy to a VLAN.
a. Configure a traffic classifier.
NOTE
The following commands are only for you reference. You should comply with the command line
syntax of the version running on your device.
Since V200R009, only the S5720EI, S5720HI, S6720EI, and S6720S-EI support applying a traffic
policy to a VLANIF interface.
● Method 1: Apply a traffic policy to an interface.
a. Configure a traffic classifier.
i. Run the traffic classifier classifier-name [ operator { and | or } ]
[ precedence precedence-value ] command in the system view to
enter the traffic classifier view.
ii. Run the if-match acl { acl-number | acl-name } command to apply
an ACL to the traffic classifier.
b. Configure a traffic behavior.
Run the traffic behavior behavior-name command in the system view to
create a traffic behavior and enter the traffic behavior view.
c. Configure a traffic action.
There are two actions for packet filtering: deny and permit. For other
traffic actions, see Configuration Guide - QoS of the corresponding
product version.
d. Configure a traffic policy.
i. Run the traffic policy policy-name [ match-order { auto | config } ]
command in the system view to create a traffic policy and enter the
traffic policy view.
ii. Run the classifier classifier-name behavior behavior-name
command to configure a traffic behavior for the specified traffic
classifier in the traffic policy. That is, bind the traffic behavior to the
classifier.
e. Apply the traffic policy.
Run the traffic-policy policy-name { inbound | outbound } command in
the interface view to apply the traffic policy.
● Method 2: Apply a simplified traffic policy to an interface.
Run the following commands in the interface view:
– Packet filtering based on ACL
2.17.5 How Can I Check the Order in Which ACL Rules Take
Effect?
Run the display acl { acl-number | name acl-name | all } or display acl ipv6
{ acl6-number | name acl6-name | all } command in any view or the display this
command in the ACL view to check the order in which ACL rules take effect, as
shown in Table 2-30.
ACL in config mode The rules with smaller IDs take effect
earlier than the rules with larger IDs.
ACL in auto mode The rules with smaller IDs take effect
earlier than the rules with larger IDs.
ACL6 in config mode The rules with smaller IDs take effect
earlier than the rules with larger IDs.
NOTE
When multiple traffic policies using ACLs are applied to a device, if a packet matches the ACL
rules in different traffic policies, the matching order of the ACL rules depends on the processing
mechanism of the traffic policy module. For details, see Configuration Guide - QoS of the
corresponding product version.
NOTE
The following commands are only for you reference. You should comply with the command line
syntax of the version running on your device.
● Method 1: Traffic policy
a. Configure an advanced ACL.
Run the acl [ number ] acl-number [ match-order { auto | config } ]
command in the system view to create an advanced ACL (3000-3999)
and enter the advanced ACL view or run the acl name acl-name
{ advance | acl-number } [ match-order { auto | config } ] command to
create a named advanced ACL and enter the advanced ACL view.
b. Configure rules for the advanced ACL.
Run the rule command to configure a rule with the tcp-flag parameter
specified.
For example, it is required that users on network segment 192.168.1.0/24
can access network segment 192.168.2.0/24, but users on network
segment 192.168.2.0/24 cannot access network segment 192.168.1.0/24.
From TCP connection setup to teardown only the packets used for TCP
connection establishment can have the ACK value of 1 and RST value of
1. According to the packet characteristics, configure the following rules to
permit the packets used for establishing TCP connections and reject other
TCP packets. In this way, you can block the TCP connection requests from
network segment 192.168.2.0/24.
▪ Rule 1: Configure an ACL rule with the ack and rst keywords
specified.
rule 5 permit tcp source 192.168.2.0 0.0.0.255 tcp-flag ack //Permit the TCP packets with
the ACK value of 1.
rule 10 permit tcp source 192.168.2.0 0.0.0.255 tcp-flag rst //Permit the TCP packets with
the RST value of 1.
rule 15 deny tcp source 192.168.2.0 0.0.0.255 //Reject other TCP packets.
The deny and permit parameters in ACL rules have different functions in different
services.
● Traffic policy
a. When permit is used in the ACL rule, the system executes the specified
traffic behavior only when traffic matches the ACL rule. When the traffic
behavior is deny, the system discards traffic matching the rule. When the
traffic behavior is permit, the system forwards traffic matching the rule.
b. When deny is used in the ACL rule, the system discards traffic matching
the ACL rule regardless of the traffic behavior.
c. If an ACL does not contain rules, the traffic policy referencing the ACL
does not take effect.
● Telnet
a. When permit is used in the ACL rule:
▪ If the ACL is applied in the inbound direction, the device with the
specified source IP address can access the local device.
▪ If the ACL is applied in the outbound direction, the local device can
access the device with the specified source IP address.
b. When deny is used in the ACL rule:
▪ If the ACL is applied in the inbound direction, any other devices can
access the local device.
▪ If the ACL is applied in the outbound direction, the local device can
access any other devices.
● HTTP
a. The device with the specified source IP address can establish an HTTP
connection with the local device only when permit is used in the ACL
rule.
b. When deny is used in the ACL rule, other devices cannot establish HTTP
connections with the local device.
c. When the ACL contains no rule, any other devices can establish HTTP
connections with the local device.
● FTP
a. The device with the specified source IP address can establish an FTP
connection with the local device only when permit is used in the ACL
rule.
b. When deny is used in the ACL rule, other devices cannot establish FTP
connections with the local device.
c. When the ACL contains no rule, any other devices can establish FTP
connections with the local device.
● TFTP
a. The device with the specified source IP address can establish a TFTP
connection with the local device only when permit is used in the ACL
rule.
b. When deny is used in the ACL rule, the local device cannot establish TFTP
connections with other devices.
c. When the ACL contains no rule, the local device can establish TFTP
connections with any other devices.
● SNMP
a. When permit is used in the ACL rule, an NMS with a specified source IP
address can access the local device.
b. When deny is used in the ACL rule, the local device rejects access from
other NMS.
c. When the ACL does not contain rules, the local device access from any
other NMS.
● NTP
a. When permit is used in the ACL rule, the ntp-service access command
takes effect.
b. When deny is used in the ACL rule, the ntp-service access command
does not take effect.
c. When the ACL does not contain rules, the ntp-service access command
does not take effect.