Network administrators sometimes want to edit standard ACLs. As you know, each new entry you add to the Access Control List (ACL) appears at the bottom of the list, and the router assigns a sequence number to that entry automatically. Standard ACL statements are added to running-config files, but there is no built-in way to edit standard ACL 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, writing the ACLs statements using a text editor such as Notepad is not difficult. 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 entering the access list statement. 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 must 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 editing steps, which are named standard ACL.
FAQs
How can I edit a standard ACL using a text editor
Display the ACL with show running-config, copy it to a text editor like Notepad, make changes such as correcting an IP address, remove the old ACL with no access-list (unlink from interface first to avoid issues), paste the edited version into global config mode, and verify with show running-config. This method prevents appending to existing lists.
What steps are involved in editing standard ACLs with sequence numbers?
Use show access-lists to view sequences, enter ip access-list standard mode, delete incorrect statements with no , add new ones like deny/permit, ensuring no overwrites without deletion. Finally, verify changes with show access-lists to confirm accurate updates, such as blocking specific hosts while allowing others.
How do I edit named standard ACLs?
Run show access-lists to view the named ACL like No_ACCESS, enter ip access-list standard mode, remove statements with no , insert new deny/permit entries with desired sequences, and verify with show access-lists. This method mirrors numbered ACL editing for precise control over access rules, such as updating host IPv4 addresses.
What precautions should I take when removing an ACL?
Before using no access-list, unlink it from interfaces to prevent unintended behavior like denying all traffic or no protection in some IOS versions. Always verify after edits with show running-config or show access-lists, and test in a safe environment to avoid network disruptions during modifications.
Why use sequence numbers over text editor for ACL editing?
Sequence numbers allow targeted deletions and insertions without removing the entire ACL, reducing risk and downtime. Enter config mode with ip access-list standard , modify specific lines, and verify immediately. Ideal for quick fixes like changing permit statements, unlike text editors which require full reconfiguration.