This command creates an IP Access Control List (ACL) that is identified by the access list number, which is 1-99 for standard ACLs or 100-199 for extended ACLs. Table 3 describes the parameters for the access-list command.
| Format | access-list 1-99 {remark comment} | {[sequence-number]} ] {deny | permit} {every | srcip srcmask | host srcip} [time-range time-range-name] [log] [assign-queue queue-id] [rate-limit rate burst-size] |
| Mode | Global Config |
| Format | access-list 100-199 {remark comment} | {[sequence-number]} [rule 1-1023] {deny | permit} {every | {{eigrp | gre | icmp | igmp | ip | ipinip | ospf | pim | tcp | udp 0-255} {srcip srcmask|any|host srcip}[range {portkey|startport} {portkey|endport} {eq|neq|lt|gt} {portkey|0-65535}{dstip dstmask|any|host dstip}[{range {portkey|startport} {portkey|endport} | {eq | neq | lt | gt} {portkey | 0-65535} ] [flag [+fin | -fin] [+syn | -syn] [+rst | -rst] [+psh | -psh] [+ack | -ack] [+urg | -urg] [established]] [icmp-type icmp-type [icmp-code icmp-code] | icmp-message icmp-message] [igmp-type igmp-type] [fragments] [precedence precedence | tos tos |[tosmask] | dscp dscp]}} [time-range time-range-name] [log] [assign-queue queue-id] [rate-limit rate burst-size] [sflow-remote-agent] |
| Mode | Global Config |
Note:
IPv4 extended ACLs have the following limitations for egress ACLs:
- Match on port ranges is not supported.
- The rate-limit command is not supported.
| Parameter | Description |
|---|---|
| remark comment | Use the remark keyword to add a comment (remark) to an IP standard or IP extended ACL. The remarks make the ACL easier to understand and scan. Each remark is limited to 100 characters. A remark can consist of characters in the range A-Z, a-z, 0-9, and special characters: space, hyphen, underscore. Remarks are displayed only in show running configuration. One remark per rule can be added for IP standard or IP extended ACL. User can remove only remarks that are not associated with a rule. Remarks associated with a rule are removed when the rule is removed |
| sequence-number | Specifies a sequence number for the ACL rule. Every rule receives a sequence number. A sequence number is specified by the user or is generated by the device. If a sequence number is not specified for the rule, a sequence number that is 10 greater than the last sequence number in the ACL is used and this rule is located in the end of the list. If this is the first ACL rule in the given ACL, a sequence number of 10 is assigned. If the calculated sequence number exceeds the maximum sequence number value, the ACL rule creation fails. It is not allowed to create a rule that duplicates an already existing one and a rule cannot be configured with a sequence number that is already used for another rule. For example, if user adds new ACL rule to ACL without specifying a sequence number, it is placed at the bottom of the list. By changing the sequence number, user can move the ACL rule to a different position in the ACL. |
| 1-99 or 100-199 | Range 1 to 99 is the access list number for an IP standard ACL. Range 100 to 199 is the access list number for an IP extended ACL. |
| [rule 1-1023] | Specifies the IP access list rule. |
| {deny | permit} | Specifies whether the IP ACL rule permits or denies an action. |
| every | Match every packet. |
| {eigrp | gre | icmp | igmp | ip | ipinip | ospf | pim | tcp | udp | 0 -255} | Specifies the protocol to filter for an extended IP ACL rule. |
| srcip srcmask|any|host scrip | Specifies a source IP address and source netmask for match condition of the IP ACL rule. Specifying any specifies srcip as 0.0.0.0 and srcmask as 255.255.255.255. Specifying host A.B.C.D specifies srcip as A.B.C.D and srcmask as 0.0.0.0. |
| {{range{portkey|startport} {portkey|endport} | {eq|neq|lt|gt} {portkey | 0-65535}] |
Note:
Specifies the source layer 4 port match condition for the IP ACL rule. You can use the port number, which ranges from
0-65535, or you specify the portkey, which can be one of the following keywords:
This option is available only if the protocol is TCP or UDP.
Note:
Port number matches only apply to unfragmented or first fragments. |
| dstip dstmask|any|host dstip | Specifies a destination IP address and netmask for match condition of the IP ACL rule. Specifying any implies specifying dstip as 0.0.0.0 and dstmask as 255.255.255.255. Specifying host A.B.C.D implies dstip as A.B.C.D and dstmask as 0.0.0.0. |
| [precedence precedence | tos tos [tosmask] | dscp dscp] |
Specifies the TOS for an IP ACL rule depending on a match of precedence or DSCP values using the parameters
dscp, precedence, tos/tosmask.
Note: tosmask is an optional parameter.
|
| flag [+fin | -fin] [+syn | -syn] [+rst | -rst] [+psh | -psh] [+ack | -ack] [+urg | -urg] [established] |
Note: This option is available only if the protocol is tcp.
Specifies that the IP ACL rule matches on the TCP flags.
When +<tcpflagname> is specified, a match occurs if the specified <tcpflagname> flag is set in the TCP
header.
When -<tcpflagname> is specified, a match occurs if the specified <tcpflagname> flag is *NOT* set in the TCP
header.
When established is specified, a match occurs if the specified RST or ACK bits are set in the TCP header. Two rules are
installed in the hardware when the established option is specified.
|
| [icmp-type icmp-type [icmp-code icmp-code] | icmp-message icmp-message] | Note: This option is available only if the protocol is icmp.
Specifies a match condition for ICMP packets.
When icmp-type is specified, the IP ACL rule matches on the specified ICMP message type, a number from 0 to 255.
When icmp-code is specified, the IP ACL rule matches on the specified ICMP message code, a number from 0 to 255.
Specifying icmp-message implies that both icmp-type and icmp-code are specified. The following
icmp-messages are supported: echo, echo-reply, host-redirect, mobile-redirect, net-
redirect, net-unreachable, redirect, packet-too-big, port-unreachable,
source-quench, router-solicitation, router-advertisement, time-exceeded, ttl-exceeded
and unreachable.
|
| igmp-type igmp-type | This option is available only if the protocol is igmp. When igmp-type is specified, the IP ACL rule matches on the specified IGMP message type, a number from 0 to 255. |
| fragments | Specifies that the IP ACL rule matches on fragmented IP packets. |
| [log] | Specifies that this rule is to be logged. |
| [time-range time-range-name] | Allows imposing time limitation on the ACL rule as defined by the parameter time-range-name. If a time range with the specified name does not exist and the ACL containing this ACL rule is applied to an interface or bound to a VLAN, then the ACL rule is applied immediately. If a time range with specified name exists and the ACL containing this ACL rule is applied to an interface or bound to a VLAN, the ACL rule is applied when the time-range with specified name becomes active. The ACL rule is removed when the time-range with specified name becomes inactive. For information about configuring time ranges, see Time Range Commands for Time-Based ACLs. |
| [assign-queue queue-id] | Specifies the assign-queue, which is the queue identifier to which packets matching this rule are assigned. |
| [rate-limit rate burst-size] | Specifies the allowed rate of traffic as per the configured rate in Kb/s, and burst-size in kbytes. |
| [sflow-remote-agent] | Configures the sFlow sampling action. This action, if configured, copies the packet matching the rule to the remote sFlow agent. |