Using Access Control Lists (ACLs)

NOTE: For convenience, the software allows you to configure numbered ACLs using the syntax for named ACLs. The software also still supports the older syntax for numbered ACLs. Although the software allows both methods for configuring numbered ACLs, numbered ACLs are always formatted in the startup-config and running-config files in using the older syntax, as follows.

access-list 1 deny host 209.157.22.26 log access-list 1 deny 209.157.22.0 0.0.0.255 log access-list 1 permit any

access-list 101 deny tcp any any eq http log

The options at the ACL configuration level and the syntax for the ip access-groupnumbered and named ACLs and are described in “Configuring Standard ACLs” on

command are the same for page 3-5.

Configuration Example for Extended ACL

To configure a named extended ACL entry, enter commands such as the following.

HP9300(config)# ip access-list extended “block Telnet” HP9300(config-ext-nac1)# deny tcp host 209.157.22.26 any eq telnet log HP9300(config-ext-nac1)# permit ip any any HP9300(config-ext-nac1)# exit

HP9300(config)# int eth 1/1

HP9300(config-if-1/1)# ip access-group “block Telnet” in

The options at the ACL configuration level and the syntax for the ip access-groupcommand are the same for numbered and named ACLs and are described in “Configuring Extended ACLs” on page 3-9.

USING THE WEB MANAGEMENT INTERFACE

You cannot configure IP ACLs using the Web management interface.

Modifying ACLs

NOTE: This section applies to standard ACLs and to extended ACLs.

When you use the HP device’s CLI or Web management interface to configure an ACL, the software places the ACL entries in the ACL in the order you enter them. For example, if you enter the following entries in the order shown below, the software always applies the entries to traffic in the same order.

HP9300(config)# access-list 1 deny 209.157.22.0/24

HP9300(config)# access-list 1 permit 209.157.22.26

Thus, if a packet matches the first ACL entry in this ACL and is therefore denied, the software does not compare the packet to the remaining ACL entries. In this example, packets from host 209.157.22.26 will always be dropped, even though packets from this host match the second entry.

You can use the CLI to reorder entries within an ACL by individually removing the ACL entries and then re-adding them. To use this method, enter “no” followed by the command for an ACL entry, and repeat this for each ACL entry in the ACL you want to edit. After removing all the ACL entries from the ACL, re-add them.

This method works well for small ACLs such as the example above, but can be impractical for ACLs containing many entries. Therefore, HP devices provide an alternative method. The alternative method lets you upload an ACL list from a TFTP server and replace the ACLs in the device’s running-config file with the uploaded list. Thus, to change an ACL, you can edit the ACL on the file server, then upload the edited ACL to the device. You then can save the changed ACL to the device’s startup-config file.

ACL lists contain only the ACL entries themselves, not the assignments of ACLs to interfaces. You must assign the ACLs on the device itself.

3 - 19