Limiting IP Based Accounts for Resellers.

dwinans

Member
PartnerNOC
Jan 23, 2009
16
1
51
We would like to pose limits on resellers based on whether an account is IP based or Name-based.

Example.

A reseller can created 20 accounts total.
5 IP based accounts and 15 name based (Shared IP).

1. Is this possible with WHM/CPanel? If yes then how is it done.
2. If yes then what back-end files are involved? If we want to limit a reseller to X number of Dedicated IP's which backend file contains that setting.

Any help would be appreciated.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
15
313
Houston, TX
cPanel Access Level
Root Administrator
We would like to pose limits on resellers based on whether an account is IP based or Name-based.

Example.

A reseller can created 20 accounts total.
5 IP based accounts and 15 name based (Shared IP).

1. Is this possible with WHM/CPanel? If yes then how is it done.
2. If yes then what back-end files are involved? If we want to limit a reseller to X number of Dedicated IP's which backend file contains that setting.

Any help would be appreciated.
In reseller center, you can limit the reseller to how many total accounts they can have. You can then use "Manage IP Delegation" to assign the reseller specific IPs they can use. The reseller can only create accounts with dedicated IPs as long as they have IPs assigned to their account that are not yet assigned as dedicated IPs.

Any particular reason you wanted to know which back-end files were involved? Were you looking to automate this?
 

dwinans

Member
PartnerNOC
Jan 23, 2009
16
1
51
Thank you very much for the reply. So for example if we want the reseller to have the ability to create 20 accounts over all. 10 IP based and 10 Name-Based, we would allow them to create 20 accounts and assign them 10 dedicated IP's through IP delegation. correct?

I'm not fond of this approach and would like to avoid it, if possible. If it is the best option we will probably run with it. The draw back of this method I see is below.

We set a reseller up with the ability to create 20 accounts.
We allow them to create 10 IP based accounts and we specificly assign them 10 IP's.
If we specificly delgate those 10 IP's to this reseller, and they never end up using all of them then we've just wasted IP space.

For the above reason I'd like to see an IP pool based solution. But, I don't believe there is one with WHM.

The only way I see to do it differently is to Specify the number of accounts the reseller can create, then also specify the packages a reseller can use to create accounts and then limit the number of accounts on those packages.

The above is not a great solution either considering we want to give the reseller the ability to create their own packages, so out of the two if we have to use one we would go with the solution that you've proposed.

To answer your second question, we are definatley looking to automate things and that is why I would like to know which back end files are involved.

What I'm looking for here are the backend files dealing with IP delegation. IE if I setup ResellerA to be able to use 10 specific IP's, what backend files are involved in keeping those IP's reserved for that reseller.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
15
313
Houston, TX
cPanel Access Level
Root Administrator
Thank you very much for the reply. So for example if we want the reseller to have the ability to create 20 accounts over all. 10 IP based and 10 Name-Based, we would allow them to create 20 accounts and assign them 10 dedicated IP's through IP delegation. correct?
cPanel/WHM does not support the creation of IP-based accounts. All accounts need to have either a domain or subdomain assigned to them.

I'm not fond of this approach and would like to avoid it, if possible. If it is the best option we will probably run with it. The draw back of this method I see is below.

We set a reseller up with the ability to create 20 accounts.
We allow them to create 10 IP based accounts and we specificly assign them 10 IP's.
If we specificly delgate those 10 IP's to this reseller, and they never end up using all of them then we've just wasted IP space.

For the above reason I'd like to see an IP pool based solution. But, I don't believe there is one with WHM.

The only way I see to do it differently is to Specify the number of accounts the reseller can create, then also specify the packages a reseller can use to create accounts and then limit the number of accounts on those packages.

The above is not a great solution either considering we want to give the reseller the ability to create their own packages, so out of the two if we have to use one we would go with the solution that you've proposed.
Perhaps you could implement your own IP-pool solution. One possibility is assigning them 1 IP they can use for a dedicated account. Then create /scripts/postwwwacct (a hook for new account creations on the server) to add an additional IP to their account (if you want to let them eventually create another account with a dedicated IP) when they create an account with a dedicated IP. You can create /scripts/postkillacct (a hook for account terminations on the server) to keep track of the IPs no longer being used that can be removed from that reseller's block of IPs. Documentation for creating /scripts/postwwwacct and /scripts/postkillacct is available at:

ScriptHooks < AllDocumentation < TWiki

The above algorithm doesn't make the most efficient use of IP addresses, so you may wish to adjust the algorithm as you see fit for your needs.

To answer your second question, we are definatley looking to automate things and that is why I would like to know which back end files are involved.

What I'm looking for here are the backend files dealing with IP delegation. IE if I setup ResellerA to be able to use 10 specific IP's, what backend files are involved in keeping those IP's reserved for that reseller.
/var/cpanel/dips/RESELLER

Where RESELLER represents the cPanel username of a reseller. This file will contain 1 IP per line, where the IP has been delegated to that reseller. Resellers with no delegated IPs will not have a file in this directory.