在CCNA和NP中我们了解到了ACL——思科为网络访问提供的一种安全手段,它是运行在CISCO的IOS上的一种程序。传统的ACL分三大类:标准ACL/扩展ACL/命名ACL.这里对其做简单的回顾: 在CCNA和NP中我们了解到了ACL——思科为网络访问提供的一种安全手段,它是运行在CISCO的IOS上的一种程序。传统的ACL分三大类:标准ACL/扩展ACL/命名ACL.这里对其做简单的回顾:
# Z! T3 {& h" f) j* l# S: o Cisco routers can identify access-list using two methods:
7 y$ Z6 K1 w. J* N, q access-list number——the number of the access list determines what protocol it is filtering:: E# G, P/ Q; t5 n# O5 L) Y
——(1-99)and(1300-1399)—— standard IP access list
) V1 N4 g- I4 c/ Y/ G3 F5 M6 g ——(100-199)and(2000-2699)—— extended IP access list. A8 ]! ~5 X! A" h
access list name (IOS versions gt 11.2)
* P/ H& y# f3 z% `; I" U Names contain alphanumeric characters
4 k+ N b' T8 B9 G* F3 Y1 w Names connot contain spaces or punctuation and must begin with alphabetic character$ c4 h6 R1 X& x9 K; u* n' j5 U7 y
名称访问列表可以包含数字和字母,但其不可以包含空格及标点符号,而且第一个字符要是字母。& J9 U* |* [0 [% t, S: T& E
Cisco router support two basic types of IP access lists:1 U p& m: W6 R* }" v3 A3 p
——standard——Filter IP packets based on the source address only.2 B4 W2 |( Z2 L; T5 X. N8 x
标准访问列表针对源IP地址进行过滤0 M* p: f; D5 \; s2 {$ O3 b
——Extended——Fiter IP packets based on several attributes.including:8 D0 u1 b2 p7 ~# ~5 u3 Z4 x# o
——Protocol type.7 B- R. P1 N) O Z
——Source and desination IP address
1 R* z3 }3 Y& C6 r ——Source and destination TCP/UDP ports. Z& |! K. C& k' q* R* k
——ICMP and IGMP message types.
" K, P8 R( n/ D* ~ 扩展访问列表针对几种属性对数据包进行过滤:; a6 j6 U$ g. o7 W' j
协议类型,源及目标的IP地址,源及目标的四层端口号,ICMP或者IGMP的报文类型。7 R6 j* W* ]+ ?; `! {
一、标准ACL格式:access-list 列表号 deny或者permit 源IP地址 源IP掩码+ d# J5 ]% ~* O
Access-list 2 permit 1.1.1.0 0.0.0.255' H- F( l1 C5 P1 f5 A" N
如果是标准的命名ACL,则写法为:
& P/ b; R) }; O; B' f (config)#ip access-list standard 名称
4 H6 n/ j8 i# V1 g (config-std-nacl)#deny 1.1.1.0 0.0.0.255- i# X5 y/ T( i
二、扩展ACL格式:access-list 列表号 deny或permit 协议 {源IP 源反掩码|any|host} 源端口号 {目标IP 目标反掩码|any|host} 目标端口号 [established] [log| log-input]3 v9 a: _" }$ p1 k- [, a4 Y) Z
Access-list 101 permit tcp 1.1.1.0 0.0.0.255 53 2.2.2.0 0.0.0.255 gt 1023) k9 t0 T2 e/ L4 q: n# r: d; h
如果是扩展的命名ACL,则写法和标准类似,只是在定义访问策略时稍有不同) W1 }. e' A# ~& ?
为访问列表打上标记,当你看到该ACL时,一目了然。
2 U% l* N; i( ^- a1 W2 ]0 @5 a Remark message
/ u5 r+ v' T- p+ D t! ?. y3 | 例:Router(config)#access-list 100 remark traffic to http-server1 G* m# t) ], i: d
Router(config)#access-list 100 permit ip any 1.1.1.1 0.0.0.255 eq 80
9 }, }* C2 ?# P d- F q! L6 D 上面所说的仅仅是ACL的写法,都在全局配置模式下进行,但访问列表只是规则,需要有“人”来执行,那么执行者是谁?就是流量要通过的接口,访问列表编辑的再严密,逻辑性再强,安全性再高,如果不将其应用到接口上去,一切都是枉然!
8 x4 K$ V- b: f% Q3 g 在接口上的应用:
4 K2 [, r6 M$ X. T R(config)#int fa0/0
& j/ s4 t! P i4 B# O" I R(config-if)#ip access-group 100 in/out 或者 ip access-group cisco in/out# l4 t9 u- J! `2 X2 E
上面分别是标准和命名访问表在接口上的应用方式。方向是非常重要的,in和out完全是两码事!
9 t. d' E( d9 i 1、 标准的访问列表通常放置在离目标最近的地方;
- ]$ X7 b- B; R) u K5 f$ ^ 2、扩展的访问列表通常放置在离源最近的地方。 |