在CCNA和NP中我們了解到了ACL——思科為網(wǎng)絡(luò)訪問(wèn)提供的一種安全手段,它是運(yùn)行在CISCO的IOS上的一種程序。傳統(tǒng)的ACL分三大類(lèi):標(biāo)準(zhǔn)ACL/擴(kuò)展ACL/命名ACL.這里對(duì)其做簡(jiǎn)單的回顧:
Cisco routers can identify access-list using two methods:
access-list number——the number of the access list determines what protocol it is filtering:
——(1-99)and(1300-1399)—— standard IP access list
——(100-199)and(2000-2699)—— extended IP access list
access list name (IOS versions gt 11.2)
Names contain alphanumeric characters
Names connot contain spaces or punctuation and must begin with alphabetic character
名稱(chēng)訪問(wèn)列表可以包含數(shù)字和字母,但其不可以包含空格及標(biāo)點(diǎn)符號(hào),而且第一個(gè)字符要是字母。
Cisco router support two basic types of IP access lists:
——standard——Filter IP packets based on the source address only.
標(biāo)準(zhǔn)訪問(wèn)列表針對(duì)源IP地址進(jìn)行過(guò)濾
——Extended——Fiter IP packets based on several attributes.including:
——Protocol type.
——Source and desination IP address
——Source and destination TCP/UDP ports
——ICMP and IGMP message types.
擴(kuò)展訪問(wèn)列表針對(duì)幾種屬性對(duì)數(shù)據(jù)包進(jìn)行過(guò)濾:
協(xié)議類(lèi)型,源及目標(biāo)的IP地址,源及目標(biāo)的四層端口號(hào),ICMP或者IGMP的報(bào)文類(lèi)型。
一、標(biāo)準(zhǔn)ACL格式:access-list 列表號(hào) deny或者permit 源IP地址 源IP掩碼
Access-list 2 permit 1.1.1.0 0.0.0.255
如果是標(biāo)準(zhǔn)的命名ACL,則寫(xiě)法為:
(config)#ip access-list standard 名稱(chēng)
(config-std-nacl)#deny 1.1.1.0 0.0.0.255
二、擴(kuò)展ACL格式:access-list 列表號(hào) deny或permit 協(xié)議 {源IP 源反掩碼|any|host} 源端口號(hào) {目標(biāo)IP 目標(biāo)反掩碼|any|host} 目標(biāo)端口號(hào) [established] [log| log-input]
Access-list 101 permit tcp 1.1.1.0 0.0.0.255 53 2.2.2.0 0.0.0.255 gt 1023
如果是擴(kuò)展的命名ACL,則寫(xiě)法和標(biāo)準(zhǔn)類(lèi)似,只是在定義訪問(wèn)策略時(shí)稍有不同
為訪問(wèn)列表打上標(biāo)記,當(dāng)你看到該ACL時(shí),一目了然。
Remark message
例:Router(config)#access-list 100 remark traffic to http-server
Router(config)#access-list 100 permit ip any 1.1.1.1 0.0.0.255 eq 80
上面所說(shuō)的僅僅是ACL的寫(xiě)法,都在全局配置模式下進(jìn)行,但訪問(wèn)列表只是規(guī)則,需要有“人”來(lái)執(zhí)行,那么執(zhí)行者是誰(shuí)?就是流量要通過(guò)的接口,訪問(wèn)列表編輯的再?lài)?yán)密,邏輯性再?gòu)?qiáng),安全性再高,如果不將其應(yīng)用到接口上去,一切都是枉然!
在接口上的應(yīng)用:
R(config)#int fa0/0
R(config-if)#ip access-group 100 in/out 或者 ip access-group cisco in/out
上面分別是標(biāo)準(zhǔn)和命名訪問(wèn)表在接口上的應(yīng)用方式。方向是非常重要的,in和out完全是兩碼事!
1、 標(biāo)準(zhǔn)的訪問(wèn)列表通常放置在離目標(biāo)最近的地方;
2、擴(kuò)展的訪問(wèn)列表通常放置在離源最近的地方。
Cisco routers can identify access-list using two methods:
access-list number——the number of the access list determines what protocol it is filtering:
——(1-99)and(1300-1399)—— standard IP access list
——(100-199)and(2000-2699)—— extended IP access list
access list name (IOS versions gt 11.2)
Names contain alphanumeric characters
Names connot contain spaces or punctuation and must begin with alphabetic character
名稱(chēng)訪問(wèn)列表可以包含數(shù)字和字母,但其不可以包含空格及標(biāo)點(diǎn)符號(hào),而且第一個(gè)字符要是字母。
Cisco router support two basic types of IP access lists:
——standard——Filter IP packets based on the source address only.
標(biāo)準(zhǔn)訪問(wèn)列表針對(duì)源IP地址進(jìn)行過(guò)濾
——Extended——Fiter IP packets based on several attributes.including:
——Protocol type.
——Source and desination IP address
——Source and destination TCP/UDP ports
——ICMP and IGMP message types.
擴(kuò)展訪問(wèn)列表針對(duì)幾種屬性對(duì)數(shù)據(jù)包進(jìn)行過(guò)濾:
協(xié)議類(lèi)型,源及目標(biāo)的IP地址,源及目標(biāo)的四層端口號(hào),ICMP或者IGMP的報(bào)文類(lèi)型。
一、標(biāo)準(zhǔn)ACL格式:access-list 列表號(hào) deny或者permit 源IP地址 源IP掩碼
Access-list 2 permit 1.1.1.0 0.0.0.255
如果是標(biāo)準(zhǔn)的命名ACL,則寫(xiě)法為:
(config)#ip access-list standard 名稱(chēng)
(config-std-nacl)#deny 1.1.1.0 0.0.0.255
二、擴(kuò)展ACL格式:access-list 列表號(hào) deny或permit 協(xié)議 {源IP 源反掩碼|any|host} 源端口號(hào) {目標(biāo)IP 目標(biāo)反掩碼|any|host} 目標(biāo)端口號(hào) [established] [log| log-input]
Access-list 101 permit tcp 1.1.1.0 0.0.0.255 53 2.2.2.0 0.0.0.255 gt 1023
如果是擴(kuò)展的命名ACL,則寫(xiě)法和標(biāo)準(zhǔn)類(lèi)似,只是在定義訪問(wèn)策略時(shí)稍有不同
為訪問(wèn)列表打上標(biāo)記,當(dāng)你看到該ACL時(shí),一目了然。
Remark message
例:Router(config)#access-list 100 remark traffic to http-server
Router(config)#access-list 100 permit ip any 1.1.1.1 0.0.0.255 eq 80
上面所說(shuō)的僅僅是ACL的寫(xiě)法,都在全局配置模式下進(jìn)行,但訪問(wèn)列表只是規(guī)則,需要有“人”來(lái)執(zhí)行,那么執(zhí)行者是誰(shuí)?就是流量要通過(guò)的接口,訪問(wèn)列表編輯的再?lài)?yán)密,邏輯性再?gòu)?qiáng),安全性再高,如果不將其應(yīng)用到接口上去,一切都是枉然!
在接口上的應(yīng)用:
R(config)#int fa0/0
R(config-if)#ip access-group 100 in/out 或者 ip access-group cisco in/out
上面分別是標(biāo)準(zhǔn)和命名訪問(wèn)表在接口上的應(yīng)用方式。方向是非常重要的,in和out完全是兩碼事!
1、 標(biāo)準(zhǔn)的訪問(wèn)列表通常放置在離目標(biāo)最近的地方;
2、擴(kuò)展的訪問(wèn)列表通常放置在離源最近的地方。

