简体   繁体   English

通过 IP 地址在 IIS 6 中进行带宽限制

[英]Bandwith throttling in IIS 6 by IP Address

I am writing an application that downloads large files in the background.我正在编写一个在后台下载大文件的应用程序。 All clients are logged in locally, or through a VPN.所有客户端都在本地或通过 VPN 登录。 When they are logged in locally, I do not want to throttle downloads.当他们在本地登录时,我不想限制下载。 However, I would like to limit downloads to 10 KBps when the user is connected via VPN.但是,当用户通过 VPN 连接时,我想将下载限制为 10 KBps。 I can differentiate between these users by IP Address range.我可以通过 IP 地址范围区分这些用户。

Since this is an AIR Application, I figure I will throttle via server-side since I can do it from either the server itself (IIS 6) or the web service (asp.net / C#).由于这是一个 AIR 应用程序,我认为我将通过服务器端进行节流,因为我可以从服务器本身 (IIS 6) 或 Web 服务 (asp.net / C#) 执行此操作。

Throttling through IIS 6 seems to work fine, but it seems like it has to be done across the entire web site.通过 IIS 6 进行节流似乎工作正常,但似乎必须在整个网站上进行。 Is there anyway to do this via IP?有没有办法通过IP来做到这一点? Or will I have to rig this up in .NET?或者我必须在 .NET 中安装它?

My first thought is this.我的第一个想法是这个。 I don't know if it would work but it would only take a few minutes to try.我不知道它是否会起作用,但只需几分钟即可尝试。

Create two IIS web sites on the same server.在同一台服务器上创建两个IIS 网站。 The first site is bound to the public IP, but the second site is bound to the private IP.第一个站点绑定公网IP,第二个站点绑定私网IP。 Both point to the same folder on the file system.两者都指向文件系统上的同一个文件夹。

Your VPN users will be accessing via the private IP, so you can setup a "site-wide" rule on that site that will only affect VPN users.您的 VPN 用户将通过私有 IP 访问,因此您可以在该站点上设置“站点范围”规则,该规则只会影响 VPN 用户。 This should work for almost any IIS6 setting, including bandwidth throttling.这应该适用于几乎所有 IIS6 设置,包括带宽限制。

Worth a try, at least.至少值得一试。

-- Edit: Tried this and it worked flawlessly. - 编辑:试过这个,它工作得很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM