cisco Routing-配置標(biāo)準(zhǔn)命名ACL

問題

使用基本編號的ACL沒有實際意義,只有通過閱讀具體的條目才能得知該ACL的作用。而且ACL的編號有限制,如傳統(tǒng)的標(biāo)準(zhǔn)ACL用1~99表示,擴展ACL用100~199表示。

配置標(biāo)準(zhǔn)命名ACL實現(xiàn)192.168.1.0網(wǎng)段拒絕PC1訪問外部網(wǎng)絡(luò),其他主機無限制。

方案

命名訪問控制列表可以為ACL起一個有意義的名字,通過名稱就可以得知該ACL要實現(xiàn)什么功能。同時,因為使用的是名稱而不是數(shù)字,也就沒有了ACL數(shù)量上的限制。


拓撲圖

步驟

1.將配置標(biāo)準(zhǔn)ACL中的擴展訪問控制列表移除,其他配置保留

tarena-R1(config)#interface f0/0

tarena-R1(config-if)#no ip access-group 1 in

tarena-R1(config-if)#exit

tarena-R1(config)#no access-list 1

2.在R2上配置標(biāo)準(zhǔn)的命名訪問控制列表

命名訪問控制列表的配置總體上和用數(shù)字表示的ACL一樣,但是更加靈活。

tarena-R2(config)#ipaccess-list standard text

tarena-R2(config-std-nacl)#deny host 192.168.1.1

tarena-R2(config-std-nacl)#permit 192.168.1.0 0.0.0.255

tarena-R2(config-std-nacl)#exit

tarena-R2(config)#interface f0/0

tarena-R2(config-if)#ipaccess-group text in

3.分別在PC1和PC2上做連通性測試

PC2測試如下所示: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

PC1 測試如下所示:PC>ipconfig

FastEthernet0 Connection:(default port)

Link-local IPv6 Address.........: FE80::2D0:BAFF:FE98:9E29

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的訪問是正常的,而PC2到Web Server的訪問被R2(IP地址為192.168.1.2)拒絕。

4.在R1上查看相關(guān)的ACL信息

tarena-R2#show ip access-lists

Standard IP access list tedu

10 deny host 192.168.1.1 (4 match(es))

20 permit 192.168.1.0 0.0.0.255(4 match(es))

輸出結(jié)果也表明,來自于PC1的數(shù)據(jù)包被攔截。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容