Skip to main content

tplogin.cn首页 > 新闻资讯 >

[实战]分公司c3750简单mls qos限速,Asa5510实现url过滤

2014-05-08 00:43 浏览:

现分公司的一个车间要出租给外加工单位,是我们boss的朋友,所以网络设备什么的都是由我们提供,大概车间办公室10+电脑左右,我们自己电脑总数在60台,其中能上外网的30+,领导让我去做这个项目,要求如下:
 

1、外租网络不能访问我们内网,可以访问外网
 

2、带宽的问题,我们总带宽是10M,我们分部实施了ad管理,像一些P2P下载软件用户是没有权限安装的,平时不搞迅雷下载和在线看视频的话,带宽还是足够的,而外加工那个单位电脑我们是无法控制的,所以领导要求把他们带宽限制在4M左右。
 

3、领导要求过滤一些在线视频、淘宝、QQ空间等网站

对于限速和URL过滤由于分部没有流控或者上网行为管理设备,只能在ASA5510和C3750上做了,我考虑了下,本来想全部在ASA inside接口上做,但因为接口只能调用一个policy-map,所以决定在C3750连接ASA防火墙的端口上做端口限速,在ASA上做URL过滤,配置如下:

先上拓扑,拓扑很简单:
wKioL1Npo0zh6r5IAAEIb_mtWmE391.jpg


一、C3750设置vlanDHCP并用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


3acl进行控制,只允许访问外网,无法访问内网其他vlan
ip access-list extended VLAN39
deny  ip 192.168.39.0 0.0.0.255 192.168.33.0 0.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


4QOS限速配置
C3750(config)#mls qos                                //启用qos
C3750(config)#ip access-list extended XIANSU              //定义aclnameXIANSU
C3750(config-ext-nacl)#permit ip any 192.168.39.0 0.0.0.255  //匹配任何源到vlan39的流量
C3750(config)#class-map Rate-limit                      //定义分类映射
C3750(config-cmap)#match access-group name XIANSU      //匹配acl
C3750(config)#policy-map Rate-limit                     //定义策略映射
C3750(config-pmap)#class Rate-limit                     //将分类列表与之关联
C3750(config-pmap-c)#police 3276500 614400             //限速400KB/s 突发600KB
C3750(config)#int gi1/0/24                           //在连接防火墙的接口上应用策略
C3750(config-if)#service-policy input Rate-limit
show下:
C3750#show policy-map 
 PolicyMap Rate-limit
  Class Rate-limit
    police 3276500 614400 exceed-action drop
    trust dscp


5、测试,用360和迅雷进行测试


二、防火墙asa5510配置:
1、首先配置vlan39的返程路由, 不然无法访问外网
asa5510(config)# route inside 192.168.39.0 255.255.255.0 192.168.32.254


2、配置URL过滤
//定义object-group
asa5510(config)# object-group network Url
asa5510(config-network)# network-object 192.168.33.0 255.255.255.0
asa5510(config-network)# network-object 192.168.34.0 255.255.255.0
........
asa5510(config-network)# network-object 192.168.39.0 255.255.255.0


//定义源到任何网站的流量
asa5510(config)# access-list Url_filterpermit tcp object-group Url any eq www


//定义分类映射,匹配acl流量
asa5510(config)# class-map Url_filter_class
asa5510(config-cmap)# match access-list Url_filter


//定义正则表达式匹配URL中携带的地址
asa5510(config)# regex URL1"\.taobao\.com"
asa5510(config)# regex URL2"\.youku\.com"
asa5510(config)# regex URL3"\.tudou\.com"
asa5510(config)# regex URL4"\.56\.com"
asa5510(config)# regex URL5"\.qzone\.qq\.com"
asa5510(config)# regex URL6"\.renren\.com"
asa5510(config)# regex URL7"\.mop\.com"
asa5510(config)# regex URL8"\.tianya\.cn"
asa5510(config)# regex URL9"\.ku6\.com"
asa5510(config)# regex URL10 "\weibo\.com"
asa5510(config)# regex URL11"\.hualongxiang\.com"


//定义类来匹配正则表达式
asa5510(config)# class-map type regex match-any Url_class
asa5510(config-cmap)# match regex URL1
asa5510(config-cmap)# match regex URL2
asa5510(config-cmap)# match regex URL3
asa5510(config-cmap)# match regex URL4
asa5510(config-cmap)# match regex URL5
asa5510(config-cmap)# match regex URL6
asa5510(config-cmap)# match regex URL7
asa5510(config-cmap)# match regex URL8
asa5510(config-cmap)# match regex URL9
asa5510(config-cmap)# match regex URL10
asa5510(config-cmap)# match regex URL11


//定义检测类映射来匹配http头中包含Url_class类中正则表达式matchURLhttp流量
asa5510(config)# class-map type inspect http Http_url_class
asa5510(config-cmap)# match request header host regex class Url_class


//创建policy-map,定义Http检测策略如果http头中包含URL中的地址,动作为drop
asa5510(config)# policy-map type inspect http Http_url_policy
asa5510(config-pmap)# class Http_url_class
asa5510(config-pmap-c)# drop-connection log


//定义policy-map,匹配流量及匹配检测策略
asa5510(config)# policy-map Inside_http_url_policy
asa5510(config-pmap)# class Url_filter_class
asa5510(config-pmap-c)# inspect http Http_url_policy


//inside接口调用policy-map

asa5510(config)# service-policy Inside_http_url_policy interface inside



没有上网行为管理也只能这样了,基本能满足需求了。

相关文章

snkrsflow什么意思详细介绍

2022-04-15 08:35:39    浏览: 109

snkrsstash是什么意思详细介绍

2022-04-15 08:35:59    浏览: 85

snkrs养号技巧(附详细教程)

2022-04-15 08:36:20    浏览: 88

手把手教你qq表情怎么删除厘米秀

2022-04-15 08:38:42    浏览: 162

怎么用snkrs抢鞋才能更流畅

2022-04-15 08:38:01    浏览: 67