How to Edit Standard ACLs
Network administrators sometimes want to edit standard ACLs. As you know that each new entry you add to the Access Control List (ACL) appears at the bottom of the list and router assign a sequence number to that entry automatically. The standard ACL statements are added to running-config files, but there is no built-in way to edit standard ACLs entries. We can edit standard ACLs using the following two methods.
How to Edit standard ACLs containing Numbers
Method 1: Using a Text Editor
If you are familiar with creating and editing ACLs, it is not difficult for you to write the ACLs statements using a text editor such as Notepad. When constructing an ACL using a text editor, you can easily edit it and then paste it into the router. For an existing ACL editing, you can use the show running-config command to display the ACL, copy and paste it into the text editor, make the necessary changes, and paste it back in. For example, if the host IPv4 address was incorrectly entered. Instead of the 192.168.3.2 host, you entered 192.168.2.2. The steps for editing the IP address in ACL are as follows:
- Display the ACL entries using the show running-config
- Select the ACL, copy it into Microsoft Notepad, and edit the list as required. After editing the ACL in Microsoft Notepad, select and copy it.
- Remove the access list using access-list 1 Because without removing it, the new statements would be appended to the existing ACL. Then, paste the newly edited ACL into global configuration mode.
- Again, verify the ACL Using the show running-config
The no access-list command behaves differently in different IOS releases. If the deleted ACL is still applied to an interface, some IOS versions act as if no ACL protects your network, while others deny all traffic. So, it is good to unlink the access list from the interface before deleting it.
Method 2: Using the Sequence Number
We can also edit the ACL using sequence numbers. As shown in the figure below, ACL 1 included a permit statement for network 192.168.3.0. This was in error. The permit statement only allows the network 192.168.3.0, but we want to block only the host 192.168.3.2 and allow all other traffic. So, to edit the ACL using sequence numbers using the three steps:
- Show the current ACL using the show access-lists <access-list-number> command as shown in the above figure step 1. The sequence number is displayed at the beginning of each statement. The IOS automatically assigns a sequence number when the access list statement is entered. You can see the wrong configured statement with sequence number 20.
- Enter the ip access-lists standard <access-list-number> command used to configure named ACLs. The access list- number 1, is used as the name. So, the first misconfigured statement needs to be deleted using the no 20. 20 is the sequence number of the ACE. After deleting, a new sequence number 20 statement is added using the command 20 deny permit any. The statements cannot be overwritten using the same sequence number as an existing statement. It is important to delete the current statement before entering the new statement with the current sequence number.
- Again, verify the changes using the show access-lists
How to Edit Standard ACLs with Name
As we edit the numbered standard ACL using the sequence number in the previous example, we can also edit the standard-named ACLs using this method. The steps for editing the named standard ACL is the following:
- First, enter the show access-list command; you can see that the ACL named {No_ACCESS} has two numbered lines indicating access rules for a host with the IPv4 addresses 192.168.2.4.
- Use the ip access-list standard <access-list-name> command to enter an ACL configuration mode. From named access-list configuration mode statements can be inserted or removed just like the previous example. The no <sequence-number> command is used to delete individual statements.
- To add a statement with sequence number <sequence-number> deny or permit statement
- Finally, use the show access-list command to verify the configuration. The figure illustrates the steps of the editing named standard ACL.