1.建立一个测试用访问控制列表 R1(config)#ipaccess-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 以上)