在IOS的新版本(12.2(14)S,12.2(15)T,12.3(2)T以上)中引入了ACL编号(ACL Sequence Numbering)功能,使得访问控制列表的编辑变得非常的方便和快捷,请看以下操作:
1.建立一个测试用访问控制列表 R1(config)#ip aclearcase/" target="_blank" >ccess-list extended 199 R1(config-ext-nacl)#deny tcp any any eq 80 R1(config-ext-nacl)#deny udp any any eq 8000 R1(config-ext-nacl)#permit ip any any R1#show run | include 199 access-list 199 deny tcp any any eq www access-list 199 deny udp any any eq 8000 access-list 199 permit ip any any 2.显示访问控制列表语句的当前序号 R1#show ip access-lists 199 Extended IP access list 199 10 deny tcp any any eq www 20 deny udp any any eq 8000 30 permit ip any any 3.在访问控制列表中指定的位置上增加一个语句 R1(config)#ip access-list extended 199 R1(config-ext-nacl)#12 permit udp any host 192.168.1.1 eq 8000 R1#show ip access-lists 199 Extended IP access list 199 10 deny tcp any any eq www 12 permit udp any host 192.168.1.1 eq 8000 20 deny udp any any eq 8000 30 permit ip any any 4.删除访问控制列表中的某个特定语句 R1(config)#ip access-list extended 199 R1(config-ext-nacl)#no 20 R1#show ip access-lists 199 Extended IP access list 199 10 deny tcp any any eq www 12 permit udp any host 192.168.1.1 eq 8000 30 permit ip any any 5.重新编排一个访问控制列表的序号 R1(config)#ip access-list resequence 199 10 10 R1(config)#do show ip access-lists 199 Extended IP access list 199 10 deny tcp any any eq www 20 permit udp any host 192.168.1.1 eq 8000 30 permit ip any any (在这里do 命令运行您在配置模式下执行一个EXEC命令,该命令要求IOS版本12.2(8)T 以上)