大网数据广告活动
服务器运维问答

How to make sure clients use only the IP assigned via DHCP

· 52CE 我爱测

We want to limit the users' Internet usage on a daily traffic basis but not the local network bandwidth. Our users are on different platforms (Windows, Android, IOS), therefore it is not possible to force any policies by e.g. Act…

问题原文

原帖链接 · MiM · CC BY-SA 4.0

We want to limit the users' Internet usage on a daily traffic basis but not the local network bandwidth. Our users are on different platforms (Windows, Android, IOS), therefore it is not possible to force any policies by e.g. Active Directory, and if it would be possible, it would limit the whole bandwidth.

The only way that remains is to do the limitation on an IP basis at the edge of the network. This is possible using Mikrotik or other firewalls. But the problem is, that users can change their IPs when the limit is reached, and they can continue using the internet bandwidth.

So the idea was to make sure that users can only pass when their mac address and the IP assigned through our DHCP server match. This should be possible in cisco switches and could be done on the core switch. I think I have read something about the connection between Cisco Switches and the DHCP Server.

The question is how is this possible, or is there any other solution that might be easier and more efficient?

We use APs, Cisco 2960 switches, and a Cisco 4500 as a core switch. Our DHCP is FreeBSD but we are willing to change it if it is needed. The authentication method for our APs is 802.1x.

EDIT:

We tried a solution using RADIUS server which gave us the possibility to know how much traffic was used by each user (through port 1812/1813), but the problem was the only way to limit the user is to not allow him to connect when his limit was reached. That means, until the user doesn't reconnect, he is able to download without any restriction.

We also thought of a Proxy server as a solution, but we had two problems:

  1. We had performance issues with squid and installing squid as a transparent proxy is too much work.
  2. Other proxies also had performance issues, and those who performed well, didn't have the feature to be used as a transparent proxy.

社区高分解答

原帖链接 · Evan Anderson · CC BY-SA 3.0

You're better off doing this at layer 7 versus layer 2 or 3.

Devices can have their MAC changed as well as their IP address. (It's harder for a user to change their MAC but it's still possible.) If you've got people changing IP addresses to get around restrictions it's only a matter of time before they'll be changing MAC addresses, too.

There are a couple of solutions I can think of off the top of my head.

  • A captive portal that requires the user to authenticate using a per-user credential (RADIUS back to your Active Directory, for example) would give you per-user accountability. There a variety of products out there, both commercial and free/open source that can do this.

  • Force users to connect to a VPN using a per-user credential to get access beyond the wireless subnet.

Both of these methods don't require a tedious IP to MAC cross reference and would scale easily when you add new users / devices.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-10-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。