




已阅读5页,还剩50页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
网络实用技术 路由技术(三) 1 本堂课任务 1、不允许外部网络访问行政网络 2、不允许pc0所在子网内pc访问行政网络ftp服务器 2 本堂课任务 如何配置路由器,只允许部分ip地址的 数据包能通过本路由器? 如何配置路由器,使内部网络的用户只 能访问外部web服务器? 解决方法 w 配置访问控制列表(acl) 学习并掌握标准acl、扩展acl以及命 名acl的配置方法 3 访问控制列表acl概要 访问控制列表(acl)是一种包过滤技 术,是应用在路由器接口的指令列表。 w acl告诉路由器哪些数据报可以允许、哪些 需要拒绝。至于是允许还是拒绝,可以由类 似源地址、目的地址、端口号等条件来作过 滤决定。 acl可以用来:限制网络流量、提高网 络性能,同时acl也是网络访问控制的 基本安全手段。 4 访问控制列表的应用 允许或拒绝数据包通过路由器 允许或拒绝vty访问进入或离开路由器 如果没有访问控制列表,所有数据包都可以传输到你的网 络 virtual terminal line access (ip) transmission of packets on an interface 5 访问控制列表 w 标准访问控制列表 检查源地址 通常允许或拒绝整个协议簇 outgoing packet e0 s0 incoming packet access list processes permit? source 6 访问控制列表 w 标准访问控制列表 检查源地址 通常允许或拒绝整个协议簇 w 扩展访问控制列表 检查源和目的地址 允许或拒绝特定的协议 outgoing packet e0 s0 incoming packet access list processes permit? source and destination protocol 7 访问控制列表 w 标准访问控制列表 检查源地址 通常允许或拒绝整个协议簇 w 扩展访问控制列表 检查源和目的地址 允许或拒绝特定的协议 入站或出站均可进行控制 outgoing packet e0 s0 incoming packet access list processes permit? source and destination protocol 8 出站访问控制列表 inbound interface packets n y packet discard bucket choose interface n access list ? routing table entry ? y outbound interfaces packet s0 9 出站访问控制列表 outbound interfaces packet n y packet discard bucket choose interface routing table entry ? n packet test access list statements permit ? y access list ? y s0 e0 inbound interface packets 10 出站访问控制列表 notify sender 如果没有访问控制列表相匹配则丢弃报文 n y packet discard bucket choose interface routing table entry ? n y test access list statements permit ? y access list ? discard packet n outbound interfaces packet packet s0 e0 inbound interface packets 11 列表测试: 拒绝或允许 packets to interfaces in the access group packet discard bucket y interface(s) destination deny deny y match first test ? permit 12 列表测试: 拒绝或允许 packets to interface(s) in the access group packet discard bucket y interface(s) destination deny deny y match first test ? permit n denypermit match next test(s) ? yy 13 列表测试: 拒绝或允许 packets to interface(s) in the access group packet discard bucket y interface(s) destination deny deny y match first test ? permit n denypermit match next test(s) ? deny match last test ? yy n yy permit 14 列表测试: 拒绝或允许 packets to interface(s) in the access group packet discard bucket y interface(s) destination deny y match first test ? permit n denypermit match next test(s) ? deny match last test ? yy n yy permit implicit deny if no match deny all deny n 15 访问控制列表命令概要 步骤1: 使用下列命令定义访问控制列表acl: access-list access-list-number permit | deny test conditions router(config)# 16 访问控制列表命令概要 步骤1: 使用下列命令定义访问控制列表acl: router(config)# 步骤2: 使用access-group命令把该访问控制列表应用到 某一接口上。 protocol access-group access-list-number in | out router(config-if)# ip 访问控制列表的标号范围为 1-99 或 100-199 access-list access-list-number permit | deny test conditions 17 为acl分配表号 number range/identifieraccess list type ip 1-99 或 1300-1999standard w 标准ip列表 (1 to 99) 测试ip报文中的源地址 18 为acl分配表号 number range/identifieraccess list type ip 1-99 或 1300-1999 100-199 或 2000-2699 standard extended w 标准ip列表 (1 to 99) 测试ip报文中的源地址 w 扩展ip列表 (100 to 199) 能测试源和目的地址、特定的tcp/ip协议、以及目的 端口 19 为acl分配表号 number range/identifier ip 1-99 或 1300-1999 100-199 或 2000-2699 name (cisco ios 11.2 and later) 800-899 900-999 standard extended standard extended named access list type ipx 标准ip列表 (1 to 99) 测试ip报文中的源地址 扩展ip列表 (100 to 199) 能测试源和目的地址、特定的tcp/ip协议、以及目的端 口 其它访问控制列表表号范围测试其它网络协议 20 标准访问控制列表报文测试 source address segment (for example, tcp header) data packet (ip header) frame header (for example, hdlc) denypermit use access list statements 1-99 21 扩展访问控制列表报文测试 destination address source address protocol port number segment (for example, tcp header) data packet (ip header) frame header (for example, hdlc) use access list statements 100-199 to test the packet denypermit tcp/ip报文举例 22 如何使用通配符掩码位 0 表示检查相应地址位的值 1 表示忽略相应地址位的值 不检查地址 (忽略所有) = 00111111 1286432168421 =00000000 = 00001111 = 11111100 =11111111 忽略后6位地址位 检查所有地址位 (匹配所有) 忽略后4位地址位 检查后2位地址位 23 通配符掩码位匹配特定的ip主 机地址 9 检查所有地址位 可以使用在地址前加缩写词host来表达上面的测试条件 (host 9) 测试条件:检查所有的地址位 (全部匹配) 9 (检查所有位) 例如:一个ip主机地址: 通配符掩码: 24 通配符掩码位匹配任意ip地址 接受任意地址: 55 可以使用缩写字 any 表达上面的测试条件 测试条件:忽略所有的地址位 55 (全部忽略) any ip address 通配符掩码: 25 通配符掩码位匹配ip子网 检查ip子网 /24 to /24 network network .host 172.30.16 0 0 0 0 0 0 1 1 0000 通配符掩码: 0 0 0 0 1 1 1 1 | 0 0 0 1 0 0 0 0 = 16 0 0 0 1 0 0 0 1 =17 0 0 0 1 0 0 1 0 =18 : : 0 0 0 1 1 1 1 1 =31 地址和通配符掩码: 55 26 标准acl配置 access-list access-list-number permit|deny source mask router(config)# 为此列表条目设置参数sets parameters for this list entry ip标准访问列表使用 1 到 99 缺省通配符掩码 = “no access-list access-list-number” 删除整个访问列表 27 标准acl配置 access-list access-list-number permit|deny source mask router(config)# 在一个接口上激活此列表 设置入站或出站测试 缺省 = 出站 “no ip access-group access-list-number” 删除此接口的访问列表 router(config-if)# ip access-group access-list-number in | out 为此列表条目设置参数sets parameters for this list entry ip标准访问列表使用 1 到 99 缺省通配符掩码 = “no access-list access-list-number” 删除整个访问列表 28 标准acl例一 3 e0 s0 e1 non- access-list 1 permit 55 (implicit deny all - not visible in the list) (access-list 1 deny 55) 29 标准acl例一 只允许我的网络 access-list 1 permit 55 (implicit deny all - not visible in the list) (access-list 1 deny 55) interface ethernet 0 ip access-group 1 out interface ethernet 1 ip access-group 1 out 3 e0 s0 e1 non- 30 标准acl例二 拒绝一台特定主机 3 e0 s0 e1 non- access-list 1 deny 3 31 标准acl例二 3 e0 s0 e1 non- 拒绝一台特定主机 access-list 1 deny 3 access-list 1 permit 55 (implicit deny all) (access-list 1 deny 55) 32 标准acl例二 access-list 1 deny 3 access-list 1 permit 55 (implicit deny all) (access-list 1 deny 55) interface ethernet 0 ip access-group 1 out 3 e0 s0 e1 non- 拒绝一台特定主机 33 标准acl例三 拒绝一个特定子网 3 e0 s0 e1 non- access-list 1 deny 55 access-list 1 permit any (implicit deny all) (access-list 1 deny 55) 34 标准acl例三 access-list 1 deny 55 access-list 1 permit any (implicit deny all) (access-list 1 deny 55) interface ethernet 0 ip access-group 1 out 3 e0 s0 e1 non- 拒绝一个特定子网 35 过滤虚拟终端 (vty) 访问路由器 w 五条虚拟终端线 (0 到 4) w 过滤能访问到路由器vty端口的地址 w 过滤离开路由器的vty访问 0 1 2 3 4 虚拟端口 (vty 0 到 4) 物理端口 e0 (telnet) 控制台端口 (直连) consolee0 36 如何控制 vty 访问 0 1 2 3 4 虚拟端口 (vty 0 到 4) 物理端口 (e0) (telnet) w 用标准访问控制列表设置ip地址过滤 w 使用line配置模式过滤访问,命令为 access-class w 对所有vty设置相同的限制 router# e0 37 虚拟终端 line 命令 w 进入虚拟终端配置模式 w 限制在访问控制列表地址中的vty连接流入或流出 access-class access-list-number in|out line vty#vty# | vty-range router(config)# router(config-line)# 38 虚拟终端访问举例 仅允许网络中的主机连接到路由器的 vty access-list 12 permit 55 ! line vty 0 4 access-class 12 in 控制入站访问 39 标准与扩展访问控制列表比较 标准扩展 基于源地址过滤基于源和目的地址过滤 允许或拒绝整个tcp/ip协议 族 指定特定的协议和端口号 范围从100到199 或 2000到 2699 范围从1到99 或 1300到1999 40 扩展acl配置 router(config)# 为此列表列表条目设置参数 access-list access-list-number permit | deny protocol source source-wildcard operator port destination destination-wildcard operator port established log 41 扩展acl配置 router(config-if)# ip access-group access-list-number in | out 在一个接口上激活扩展列表 为此列表列表条目设置参数 router(config)# access-list access-list-number permit | deny protocol source source-wildcard operator port destination destination-wildcard operator port established log 42 扩展acl例一 拒绝ftp从子网到子网,从e0输出 允许所有其它流量 3 e0 s0 e1 non- access-list 101 deny tcp 55 55 eq 21 access-list 101 deny tcp 55 55 eq 20 43 扩展acl例一 3 e0 s0 e1 non- access-list 101 deny tcp 55 55 eq 21 access-list 101 deny tcp 55 55 eq 20 access-list 101 permit ip any any (implicit deny all) (access-list 101 deny ip 55 55) 拒绝ftp从子网到子网,从e0输出 允许所有其它流量 44 扩展acl例一 access-list 101 deny tcp 55 55 eq 21 access-list 101 deny tcp 55 55 eq 20 access-list 101 permit ip any any (implicit deny all) (access-list 101 deny ip 55 55) interface ethernet 0 ip access-group 101 out 3 e0 s0 e1 non- 拒绝ftp从子网到子网,从e0输出 允许所有其它流量 45 扩展acl例二 只拒绝来自子网的telnet,从e0输出 允许所有其它流量 3 e0 s0 e1 non- access-list 101 deny tcp 55 any eq 23 46 扩展acl例二 3 e0 s0 e1 non- access-list 101 deny tcp 55 any eq 23 access-list 101 permit ip any any (implicit deny all) 只拒绝来自子网的telnet,从e0输出 允许所有其它流量 47 扩展acl例二 access-list 101 deny tcp 55 any eq 23 access-list 101 permit ip any any (implicit deny all) interface ethernet 0 ip access-group 101 out 3 e0 s0 e1 non- 只拒绝来自子网的telnet,从e0输出 允许所有其它流量 48 使用命名访问控制列表 router(config)# ip access-list standard | extended name cisco ios 11.2 或更新版本 字母数字名字字符串必须是唯一的 49 使用命名访问控制列表 router(config)# ip access-list standard | extended name permit | deny ip access list test conditions permit | deny ip access list test conditions no permit | deny ip access list test conditions router(config std- | ext-nacl)# cisco ios 11.2 或更新版本 字母数字名字字符串必须是唯一的 允许或拒绝语句没有前缀号 “no” 从命名访问列表去掉特定的测试语句 50 使用命名访问控制列表 router(config)# ip access-list standard | extended name router(config std- | ext-nacl)# permit | deny ip access list test conditions permit | deny ip access list test conditions no permit | deny ip access list test conditions router(config-if)# ip access-group name in | out cisco ios 11.2 或更新版本 字母数字名字字符串必须是唯一的 允许或拒绝语句没有前缀号 “no” 从命名访问列表去掉特定的测试语句 在接口上激活ip命名访问列表 51 访问控制列表配置原则 w 访问控制列表语句的顺序至关重要 推荐: 使用文本编辑器进行剪切和粘贴 w 至顶向下处理 优先放置更重要的测试语句 w 不能重排或取消语句 使用 no access-list number 命令取消整个访问控制列表 例外: 命名访问控制列表允许取消单条语句 w 隐含拒绝所有 除非访问控制列表末尾明确地允许所有 52 正确放置acl 在
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- Unit 5 Topic 2 Section C 教学设计-2024-2025学年仁爱科普版八年级英语下册
- 二年级下册数学教案-6.1菜园卫士-连续进位、退位的三位数加减三位数 青岛版
- 六年级下册数学教案-四 比例 面积的变化|苏教版
- 一年级上册数学教案- 老鹰捉小鸡 青岛版
- 中建三局房屋建筑实测实量培训
- (常考易错题)2022-2023学年三年级上册期末高频考点数学试卷(苏教版)
- 2024年科创大数据项目投资申请报告代可行性研究报告
- 2025年甘孜职业学院单招职业技能测试题库及答案一套
- 2025年黑龙江冰雪体育职业学院单招职业技能测试题库必考题
- 2024年人工种植牙项目资金需求报告代可行性研究报告
- 教科版三年级科学下册分组实验与演示实验目录
- 急性肾小球肾炎讲稿
- 05G359-3 悬挂运输设备轨道(适用于一般混凝土梁)
- (完整版)《城市轨道交通应急处理》课程标准
- 股骨颈骨折ppt精品
- 2023年江苏农牧科技职业学院单招职业适应性测试题库及答案解析
- 毛泽东诗词鉴赏分析
- 量具检具清单
- 江苏市政工程计价表定额计算规则
- YY/T 1833.2-2022人工智能医疗器械质量要求和评价第2部分:数据集通用要求
- 自然辩证法概论之马克思主义自然观
评论
0/150
提交评论