問題
使用基本編號的ACL沒有實際意義,只有通過閱讀具體的條目才能得知該ACL的作用。而且ACL的編號有限制,如傳統(tǒng)的標(biāo)準(zhǔn)ACL用1~99表示,擴(kuò)展ACL用100~199表示。
配置擴(kuò)展命名ACL允許PC1訪問192.168.4.1的www服務(wù)但拒絕訪問192.168.4.1的其他服務(wù),PC2、PC3無限制。
方案
命名訪問控制列表可以為ACL起一個有意義的名字,通過名稱就可以得知該ACL要實現(xiàn)什么功能。同時,因為使用的是名稱而不是數(shù)字,也就沒有了ACL數(shù)量上的限制。

步驟
1.將配置擴(kuò)展ACL中的擴(kuò)展訪問控制列表移除,其他配置保留
tarena-R1(config)#no access-list 100 permit tcp host 192.168.1.1 host 192.168.4.1 eq www
tarena-R1(config)#interface fastEthernet 0/0
tarena-R1(config-if)#no ip access-group 100 in
2.在R1上配置擴(kuò)展命名訪問控制列表
命名訪問控制列表的配置總體上和用數(shù)字表示的ACL一樣,但是更加靈活。
tarena-R1(config)# ip access-list extended text
tarena-R1(config-ext-nacl)#permit tcp host 192.168.1.1 host 192.168.4.1 eq 80
tarena-R1(config-ext-nacl)#deny ip host 192.168.1.1 host 192.168.4.1
tarena-R1(config-ext-nacl)#permit ip 192.168.1.0 0.0.0.255 host 192.168.4.1
tarena-R1(config)#interface fastEthernet 0/0
tarena-R2(config-if)# ip?access-group text in
3.在R1上查看相關(guān)的ACL信息
·tarena-R1#show ip access-lists
Extended IP access list tarena
10 permit tcp host 192.168.1.1 host 192.168.4.1 eq www
20 deny ip host 192.168.1.1 host 192.168.4.1
30 permit ip 192.168.1.0 0.0.0.255 host 192.168.4.1
4.在PC1上驗證
PC>ipconfig
FastEthernet0 Connection:(default port)
Link-local IPv6 Address.........: FE80::2E0:F7FF:FED6:54CC
IP Address......................: 192.168.1.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.254
PC>ping 192.168.4.1
Pinging 192.168.4.1 with 32 bytes of data:
Reply from 192.168.1.254: Destination host unreachable.
Reply from 192.168.1.254: Destination host unreachable.
Reply from 192.168.1.254: Destination host unreachable.
Reply from 192.168.1.254: Destination host unreachable.
Ping statistics for 192.168.4.1:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
從輸入結(jié)果可以驗證,PC1到Web Server的http訪問沒有受到影響,但不能ping通192.168.4.1
5.在PC2上進(jìn)行驗證
PC>ipconfig
FastEthernet0 Connection:(default port)
Link-local IPv6 Address.........: FE80::2E0:F7FF:FED6:54CC
IP Address......................: 192.168.1.2
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.0.1
PC>ping 192.168.4.1
Pinging 192.168.4.1 with 32 bytes of data:
Reply from 192.168.4.1: bytes=32 time=0ms TTL=126
Reply from 192.168.4.1: bytes=32 time=0ms TTL=126
Reply from 192.168.4.1: bytes=32 time=0ms TTL=126
Reply from 192.168.4.1: bytes=32 time=0ms TTL=126
Ping statistics for 192.168.4.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms