经典案例系列分享之一:ciscoC3750简单mls qos限速,ciscoasa5510实现url过滤 | 网络之路博客(公众号同名)(其他平台网络之路Blog)
登录
  • 欢迎网络之路博客网站,分享有用的知识点,公众号:网络之路博客,B站:网络之路Blog
  • 如果您觉得本站对您有帮助,那么赶紧使用Ctrl+D 收藏吧,支持我们下
  • 远程技术支持的淘宝店铺已经开张了哦,传送门:需要的朋友可以点击查看

经典案例系列分享之一:ciscoC3750简单mls qos限速,ciscoasa5510实现url过滤

【汇总】经典案例系列

文档帖子汇总学习视频Book与实验手册学习必备软件
    博主也只是业余时间写写技术文档,请大家见谅,大家觉得不错的话,可以推荐给朋友哦,博主会努力推出更好的系列文档的。如果大家有任何疑问或者文中有错误跟疏忽的地方,欢迎大家留言指出,博主看到后会第一时间修改,谢谢大家的支持,更多技术文章尽在网络之路博客,http://ccieh3c.com

简介

现分公司的一个车间要出租给外加工单位,是我们boss的朋友,所以网络设备什么的都是由我们提供,大概车间办公室10+电脑左右,我们自己电脑总数在60台,其中能上外网的30+,领导让我去做这个项目,要求如下:
1、外租网络不能访问我们内网,可以访问外网
2、带宽的问题,我们总带宽是10M,我们分部实施了ad管理,像一些P2P下载软件用户是没有权限安装的,平时不搞迅雷下载和在线看视频的话,带宽还是足够的,而外加工那个单位电脑我们是无法控制的,所以领导要求把他们带宽限制在4M左右。
3、领导要求过滤一些在线视频、淘宝、QQ空间等网站
对于限速和URL过滤由于分部没有流控或者上网行为管理设备,只能在ASA5510和ciscoC3750上做了,我考虑了下,本来想全部在ASA inside接口上做,但因为接口只能调用一个policy-map,所以决定在ciscoC3750连接ASA防火墙的端口上做端口限速,在ASA上做URL过 滤,配置如下:

拓扑

 image001.png

一、ciscoC3750设置vlan,DHCP并用acl控制访问及QOS端口限速等:

1、新建vlan
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测速 /迅雷下载

 image002.jpg
 image003.jpg

限速后:360/迅雷测速

 image004.jpg
 image005.jpg

二、防火墙ciscoasa5510配置:

1、首先配置vlan39的返程路由, 不然无法访问外网
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视频测试如下:

 image006.png

下载文档

百度盘下载博客资源汇总与学习思路
如果下载地址失效,请联系博主或者在下面留言,谢谢。下面也有其他您需要的资源推荐哦

关于博客资源下载说明

首先,感谢大家对网络之路博客的支持,本站所有资源都是开放下载,不做任何限制,资源都是上传在百度盘,分为两种类型:
(1)第一种是书籍PDF与视频类,全部放在博客分享,觉得对大家学习有帮助的博主会收集好、然后以博主的经验整理分类后排序好分享出来。
(2)第二种是技术性文章与视频,全部放在公众号(网络之路博客)/B站(网络之路Blog)发布,以博主原创为主,主要分享系列为主,由浅入深的带大家了解工作中常用到的一些网络技术,当然也会分享一些比较经典的案例。
(3)分享资源有涉及到您的利益以及版权问题,请联系博主,24小时候内删除。
想第一时间收到最新更新内容吗,点击获取~~~

点击查看详情

(广告)博主自主原创最新实战课程

点击查看详情


(广告)远程技术支持(设备调试),有搞不定的找我,价格实惠,为您解决实际工作上的问题

远程技术调试与技术支持,点击查看详情


原创与收集的内容,允许转载,转载时请务必以超链接形式标明文章原始出处,博客地址http://ccieh3c.com。

喜欢 (6)
[]
分享 (0)
公众号:网络之路博客(其他平台网络之路Blog)
分享一些自己懂的技术知识点,希望对大家有帮助。
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址