在CCNA和NP中我们了解到了ACL——思科为网络访问提供的一种安全手段,它是运行在CISCO的IOS上的一种程序。传统的ACL分三大类:标准ACL/扩展ACL/命名ACL.这里对其做简单的回顾: 在CCNA和NP中我们了解到了ACL——思科为网络访问提供的一种安全手段,它是运行在CISCO的IOS上的一种程序。传统的ACL分三大类:标准ACL/扩展ACL/命名ACL.这里对其做简单的回顾:
) X8 {5 k* N/ O1 N Cisco routers can identify access-list using two methods:9 E# @5 \* ~2 q1 r
access-list number——the number of the access list determines what protocol it is filtering:
2 B( _" x- W0 b ——(1-99)and(1300-1399)—— standard IP access list: p7 M* V' Q# k3 X, p6 R4 g
——(100-199)and(2000-2699)—— extended IP access list5 |! T: Q8 H, E! \' d
access list name (IOS versions gt 11.2)
( d, d+ _- N; ^; |: T Names contain alphanumeric characters
9 }' `9 V& H Y8 X: d% P Names connot contain spaces or punctuation and must begin with alphabetic character% l7 m7 R3 p8 ?, ~; F# ^1 C8 x
名称访问列表可以包含数字和字母,但其不可以包含空格及标点符号,而且第一个字符要是字母。
0 M& s/ [3 @, N Cisco router support two basic types of IP access lists:
) O. j8 _8 Z1 _5 }' c ——standard——Filter IP packets based on the source address only.
- n$ n; V- W5 ]/ |8 n. I8 k f 标准访问列表针对源IP地址进行过滤 V- _! T' M) f3 c" q; n
——Extended——Fiter IP packets based on several attributes.including:/ j1 f4 F# y" ?
——Protocol type.
" X7 x3 J1 R) J ——Source and desination IP address* d( R2 `& A2 @$ G$ j# }% E
——Source and destination TCP/UDP ports# O& O+ }- ~3 {: _
——ICMP and IGMP message types.
) t; S9 ~+ t* a0 r9 J 扩展访问列表针对几种属性对数据包进行过滤:1 j5 n# J2 ^# ~" Z% B
协议类型,源及目标的IP地址,源及目标的四层端口号,ICMP或者IGMP的报文类型。
B d8 {* X8 j6 g1 M" Y 一、标准ACL格式:access-list 列表号 deny或者permit 源IP地址 源IP掩码
6 [4 K8 J, ~, B Access-list 2 permit 1.1.1.0 0.0.0.255
. Z! C6 h4 L. P5 M# }# a 如果是标准的命名ACL,则写法为:
* ?$ y- z. T8 |, R8 Z# p/ j0 } (config)#ip access-list standard 名称3 w( a. e* _6 S! d: S/ }" L
(config-std-nacl)#deny 1.1.1.0 0.0.0.255
- y& l2 y* Y6 M! A9 y9 t) D 二、扩展ACL格式:access-list 列表号 deny或permit 协议 {源IP 源反掩码|any|host} 源端口号 {目标IP 目标反掩码|any|host} 目标端口号 [established] [log| log-input]+ X5 e$ l* F# g+ B
Access-list 101 permit tcp 1.1.1.0 0.0.0.255 53 2.2.2.0 0.0.0.255 gt 1023
8 U- |6 _3 M4 V 如果是扩展的命名ACL,则写法和标准类似,只是在定义访问策略时稍有不同- n3 i/ r9 I" ~7 `) }3 W
为访问列表打上标记,当你看到该ACL时,一目了然。/ y+ U. H" k: m4 B: o/ Q j1 j3 m
Remark message. W& j* v" K' J0 l v& O
例:Router(config)#access-list 100 remark traffic to http-server
2 M9 i& p3 h- G9 `: l Router(config)#access-list 100 permit ip any 1.1.1.1 0.0.0.255 eq 80
1 l6 o' K3 d7 g6 {7 M; C r 上面所说的仅仅是ACL的写法,都在全局配置模式下进行,但访问列表只是规则,需要有“人”来执行,那么执行者是谁?就是流量要通过的接口,访问列表编辑的再严密,逻辑性再强,安全性再高,如果不将其应用到接口上去,一切都是枉然!$ \! L# x$ o; z
在接口上的应用:
, s5 ^& `) s0 R1 f$ \ R(config)#int fa0/0& x, R# L3 R4 ^5 |
R(config-if)#ip access-group 100 in/out 或者 ip access-group cisco in/out: \! Y* j; L% z: ~/ c, |( H" E
上面分别是标准和命名访问表在接口上的应用方式。方向是非常重要的,in和out完全是两码事!
/ S' ^/ b. o4 J( u$ N 1、 标准的访问列表通常放置在离目标最近的地方;. }, B) L. o2 M. H, ?: Q' ]& d) N
2、扩展的访问列表通常放置在离源最近的地方。 |