The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Limiting IP Based Accounts for Resellers.

Discussion in 'General Discussion' started by dwinans, Jun 15, 2009.

  1. dwinans

    dwinans Member
    PartnerNOC

    Joined:
    Jan 23, 2009
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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?
     
  3. dwinans

    dwinans Member
    PartnerNOC

    Joined:
    Jan 23, 2009
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    cPanel/WHM does not support the creation of IP-based accounts. All accounts need to have either a domain or subdomain assigned to them.

    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.

    /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.
     
Loading...

Share This Page