【汇总】经典案例系列
简介
现分公司的一个车间要出租给外加工单位,是我们boss的朋友,所以网络设备什么的都是由我们提供,大概车间办公室10+电脑左右,我们自己电脑总数在60台,其中能上外网的30+,领导让我去做这个项目,要求如下:
1、外租网络不能访问我们内网,可以访问外网
2、带宽的问题,我们总带宽是10M,我们分部实施了ad管理,像一些P2P下载软件用户是没有权限安装的,平时不搞迅雷下载和在线看视频的话,带宽还是足够的,而外加工那个单位电脑我们是无法控制的,所以领导要求把他们带宽限制在4M左右。
3、领导要求过滤一些在线视频、淘宝、QQ空间等网站
对于限速和URL过滤由于分部没有流控或者上网行为管理设备,只能在ASA5510和ciscoC3750上做了,我考虑了下,本来想全部在ASA inside接口上做,但因为接口只能调用一个policy-map,所以决定在ciscoC3750连接ASA防火墙的端口上做端口限速,在ASA上做URL过 滤,配置如下:
拓扑
一、ciscoC3750设置vlan,DHCP并用acl控制访问及QOS端口限速等:
interface Vlan 39
description Waizu
ipaddress 192.168.39.254 255.255.255.0
ipaccess-group VLAN39 in
2、配置dhcp,租期8小时
ip dhcp pool vlan39
network 192.168.39.0 255.255.255.0
default-router 192.168.39.254
dns-server 221.228.255.1
lease 0 8
3、acl进行控制,只允许访问外网,无法访问内网其他vlan
ip access-list extended VLAN39
deny ip 192.168.39.0 0.0.0.255 192.168.33.00.0.0.255
deny ip 192.168.39.0 0.0.0.255 192.168.34.0 0.0.0.255
deny ip 192.168.39.0 0.0.0.255 192.168.35.0 0.0.0.255
deny ip 192.168.39.0 0.0.0.255 192.168.36.0 0.0.0.255
deny ip 192.168.39.0 0.0.0.255 192.168.37.0 0.0.0.255
deny ip 192.168.39.0 0.0.0.255 192.168.38.0 0.0.0.255
permit ip any any
4、QOS限速配置
ciscoC3750(config)#mls qos //启用qos
ciscoC3750(config)#ip access-list extended XIANSU //定义acl,name为XIANSU
ciscoC3750(config-ext-nacl)#permit ip any 192.168.39.0 0.0.0.255 //匹配任何源到vlan39的流量
ciscoC3750(config)#class-map Rate-limit //定义分类映射
ciscoC3750(config-cmap)#match access-group name XIANSU //匹配acl
ciscoC3750(config)#policy-map Rate-limit //定义策略映射
ciscoC3750(config-pmap)#class Rate-limit //将分类列表与之关联
ciscoC3750(config-pmap-c)#police 3276500 614400 //限速400KB/s 突发600KB
ciscoC3750(config)#int gi1/0/24 //在连接防火墙的接口上应用策略
ciscoC3750(config-if)#service-policy input Rate-limit
show下:
ciscoC3750#show policy-map
PolicyMap Rate-limit
Class Rate-limit
police 3276500 614400 exceed-action drop
trust dscp
5、测试,用360和迅雷进行测试
限速前:360测速 /迅雷下载
限速后:360/迅雷测速
二、防火墙ciscoasa5510配置:
ciscoasa5510(config)# route inside 192.168.39.0255.255.255.0 192.168.32.254
2、配置URL过滤
//定义object-group
ciscoasa5510(config)# object-group network Url
ciscoasa5510(config-network)# network-object 192.168.33.0 255.255.255.0
ciscoasa5510(config-network)# network-object 192.168.34.0 255.255.255.0
……..
ciscoasa5510(config-network)# network-object 192.168.39.0 255.255.255.0
//定义源到任何网站的流量
ciscoasa5510(config)# access-list Url_filterpermit tcp object-group Url any eq www
//定义分类映射,匹配acl流量
ciscoasa5510(config)# class-map Url_filter_class
ciscoasa5510(config-cmap)# match access-listUrl_filter
//定义正则表达式匹配URL中携带的地址
ciscoasa5510(config)# regex URL1 “\.taobao\.com”
ciscoasa5510(config)# regex URL2 “\.youku\.com”
ciscoasa5510(config)# regex URL3 “\.tudou\.com”
ciscoasa5510(config)# regex URL4 “\.56\.com”
ciscoasa5510(config)# regex URL5 “\.qzone\.qq\.com”
ciscoasa5510(config)# regex URL6 “\.renren\.com”
ciscoasa5510(config)# regex URL7 “\.mop\.com”
ciscoasa5510(config)# regex URL8 “\.tianya\.cn”
ciscoasa5510(config)# regex URL9 “\.ku6\.com”
ciscoasa5510(config)# regex URL10 “\weibo\.com”
ciscoasa5510(config)# regex URL11 “\.hualongxiang\.com”
//定义类来匹配正则表达式
ciscoasa5510(config)# class-map type regexmatch-any Url_class
ciscoasa5510(config-cmap)# match regex URL1
ciscoasa5510(config-cmap)# match regex URL2
ciscoasa5510(config-cmap)# match regex URL3
ciscoasa5510(config-cmap)# match regex URL4
ciscoasa5510(config-cmap)# match regex URL5
ciscoasa5510(config-cmap)# match regex URL6
ciscoasa5510(config-cmap)# match regex URL7
ciscoasa5510(config-cmap)# match regex URL8
ciscoasa5510(config-cmap)# match regex URL9
ciscoasa5510(config-cmap)# match regex URL10
ciscoasa5510(config-cmap)# match regex URL11
//定义检测类映射来匹配http头中包含Url_class类中正则表达式matchURL的http流量
ciscoasa5510(config)# class-map type inspect http Http_url_class
ciscoasa5510(config-cmap)# match request header host regex class Url_class
//创建policy-map,定义Http检测策略如果http头中包含URL中的地址,动作为drop
ciscoasa5510(config)# policy-map type inspect http Http_url_policy
ciscoasa5510(config-pmap)# class Http_url_class
ciscoasa5510(config-pmap-c)# drop-connection log
//定义policy-map,匹配流量及匹配检测策略
ciscoasa5510(config)# policy-map Inside_http_url_policy
ciscoasa5510(config-pmap)# class Url_filter_class
ciscoasa5510(config-pmap-c)# inspect http Http_url_policy
//inside接口调用policy-map
ciscoasa5510(config)# service-policy Inside_http_url_policy interface inside
用youku视频测试如下:
下载文档
关于博客资源下载说明
(1)第一种是书籍PDF与视频类,全部放在博客分享,觉得对大家学习有帮助的博主会收集好、然后以博主的经验整理分类后排序好分享出来。
(2)第二种是技术性文章与视频,全部放在公众号(网络之路博客)/B站(网络之路Blog)发布,以博主原创为主,主要分享系列为主,由浅入深的带大家了解工作中常用到的一些网络技术,当然也会分享一些比较经典的案例。
(3)分享资源有涉及到您的利益以及版权问题,请联系博主,24小时候内删除。

学习视频系列(总有您想要的)
Book与实验手册(从初级到高级)
数通系列(路由交换 无线、防火墙VPN等)
实战系列(最贴近企业需求的案例)
想第一时间收到最新更新内容吗,点击获取~~~