(I'm not a network guy, so please humor me.)

I want to configure a typical consumer router as an open hotspot. However, the router's internet connection has limited bandwidth. Therefore, I'd like to limit how many people can connect to it simultaneously.

I could set DHCP to hand out a small number of addresses, but additional users could still connect if they specified their own IP address. So I'd rather set a hard limit.

I'm wondering if a subnet mask will do the trick. I (sort of) understand that subnet masks are a way of telling the network section of an IP address from the host part, and I think that means I can limit the number of possible addresses, and therefore users, on the router. So:

  • Can I do this?
  • Might it screw something else up?
  • Is anyone patient enough to list the possible subnet masks and how many users would be able to connect for each one?


The list I was looking (sorry, I wasn't very clear) was this: if the first three octets are 255.255.255, what are the possible netmasks and how many hosts they support? I found this from the link Eddy provided. Answer:

  •    254 hosts
  • 126 hosts
  • 62 hosts
  • 30 hosts
  • 14 hosts
  • 6 hosts
  • 2 hosts
  • 0 hosts
  • 0 hosts

Several of you have pointed out that limiting users is not the same as limiting bandwidth. It's a good point, but in this case, I'm just concerned with limiting the number of concurrent users.

So, my question again: if I simply assign one of the netmasks above to the router, will it restrict the number of possible users effectively, as listed above? Might it screw something else up?

6 Answers 6


Is anyone patient enough to list the possible subnet masks and how many users would be able to connect for each one?

Google found this, nifty subnet calculator

A small subnet will limit the number of concurrent users - people trying to hijack addresses may cause problems with duplicate IP addresses. It comes down to how hard you want to limit usage, and how hard people will work to overcome the measures you implement.

Quality of service will go a long ways to helping share the available bandwidth. Google found this link that will give you an idea on whats available.

With wireless it's easy enough to spoof/change mac addresses but you could come up with some scripts to monitor active mac addresses and limit them with iptables and some restrictive qos classes.

Edit To answer the updated question: "if I simply assign one of the netmasks above to the router, will it restrict the number of possible users effectively, as listed above? Might it screw something else up?"

Two things to watch when you do this:

  • Account for the IP addresses of the Access Point and Internet Gateway (if the gateway is a different box) when deciding how many hosts to allow.
  • Make sure that the DHCP service will assign addresses with the correct starting address (eg, if your network starts at zero and only has room for 12 hosts, then have the dhcp service start assigning addresses within the range). I would expect the access point to do this automagically but it's something to check.
  • Thanks for the link - I can derive the list I was looking for from there. Updating my question. Nov 23, 2009 at 15:49

Limiting the number of users that can connect is not the most effective way of limiting bandwidth. What if you have only 2 users connected but one of them is downloading a 500MB file? Limiting the number of connected users does nothing to limit the bandwidth utilization of each connected user. My suggestion would be to find a way to limit the bandwidth utilization of each user. You could try something like NetLimiter running on a gateway machine.


  • This is a very good point, but not applicable to my situation for two reasons: I can't use a gateway machine, and the actual requirement I've been handed is "limit the number of concurrent users." So even if it's not the best strategy (which I can try to point out), those are the orders I have to follow. Nov 23, 2009 at 16:02
  • @Nathan: Understood. Thanks for the clarification. Any of the first 6 subnets will work for you, dependent on how many users you want to be simultaneuosly connected.
    – joeqwerty
    Nov 23, 2009 at 16:52
  • @joequerty - so doing this will not have unintended side effects for the connected users? Nov 23, 2009 at 16:59

If you aren't willing to implement a business class system that can allow (free) access with a small registration, then I'd suggest your best bet is to use the DHCP plan AND narrow down the subnet. Set a short lease time of 10-20 minutes. Once all DHCP addresses are used, no others will be given out. people would have to guess the IP range and even then, run the risk of creating an IP conflict.

  • What would the short lease time mean? That after that time period, the user would have to ask for a new IP address? If so, wouldn't that imply that they might lose access unexpectedly? Nov 23, 2009 at 15:59
  • Leases are renewed transparent to the user. There is no interruption
    – MDMarra
    Nov 23, 2009 at 16:14
  • Right, but if the number of users is limited, maybe while the user was reading a web page, somebody else got their IP address. Right? Nov 23, 2009 at 16:23
  • possible, but generally unlikely unless you have a very active site. Nov 23, 2009 at 16:28

The big problems you have are

  1. The clients over the limit will fail to get IPs but will have no idea why they are failing to get IPs.
  2. Most client devices will remain connected even after their users stop actively using the connection.

So the result won't be "users have to take turns" it will be a few users getting online at the start of the day and after that most users being unable to connect most of the time for no obvious reason.


1) Yes


  • Firstly, you must subtract one ip from maximum available hosts, because it will be the IP of your router.

  • AP can hold only limited number of hosts, otherwise it will start to malfunction.

  • Limiting by subnetting will work only, if all IP's will be given by DHCP. And you will have to minimize lease time.

  • You would better limit users by speed(shaping) and by number of concurrent connections(10-20)

  • Check these links about building wi-fi hot spot and special software: first and second


Can I use a subnet mask to limit the number of users on a router?

with the help, of a subnet mask, you can limit the number of users in the network let's suppose if you want only 14 hosts in the network then you give the CIDR value /28, subnet mask =, 2^4=16 (subnet), and 2^4-2 = 14 (hosts). In this subnet mask, only 14 hosts can connect to the network. So yes, By using the subnet mask we can limit the number of users on a router.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.