HOWTO: Captive Portal; more than 100 Free Authorized Clients

Home Page Forums Network Management ZeroShell HOWTO: Captive Portal; more than 100 Free Authorized Clients

This topic contains 2 replies, has 0 voices, and was last updated by  miketheknife 7 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #42601

    miketheknife
    Member

    Hello all,

    I came accross some Limitation. The number of Free Authorized Clients is a maximum of 100. For my installation i needed more than that. In the scripts directory (/root/kerbynet.cgi/scripts) there is a script called cpAddClient. That is the script that we have to change. Here is how to do it:

    first of all create a directory in the /database. im my example I did the following:

    – Login via SSH and open a Shell as admin
    – create a directory for the adapted script
    mkdir /Database/scripts
    cd /Database/scripts
    use vi to create a file called cpAddClient

    ==== COPY below – UPDATED SCRIPT====

    #!/bin/sh
    . /etc/kerbynet.conf
    DESC=”$1″
    IP=”$2″
    [ “$IP” == Any ] && IP=””
    MAC=”$3″
    [ “$MAC” == Any ] && MAC=””
    CONFIG=$REGISTER/system/cp
    cd $CONFIG/FreeClients
    LAST=10#`ls -d * 2>/dev/null |tail -1`
    if [ -z “$LAST” ] ; then
    NEW=0000
    else
    # if [ “${LAST:0:1}” == 0 ] ; then
    # LAST=”${LAST:1:1}”
    # fi
    NEW=”$((LAST+1))”
    if [ “$NEW” -lt 10 ] ; then
    NEW=000$NEW
    elif [ “$NEW” -lt 100 ] ; then
    NEW=00$NEW
    elif [ “$NEW” -lt 1000 ] ; then
    NEW=0$NEW
    fi
    fi
    mkdir $NEW
    echo “$DESC” > $CONFIG/FreeClients/$NEW/Desc
    echo “$IP” > $CONFIG/FreeClients/$NEW/IP
    echo “$MAC” > $CONFIG/FreeClients/$NEW/MAC
    $SCRIPTS/cpAddClientIPT “$IP” “$MAC”

    ==== PASTE above – UPDATED SCRIPT ====

    – now login to the web administration panel
    – under setup startup/cron enter the following

    cp /Database/scripts/cpAddClient /root/kerbynet.cgi/scripts

    – then enable and save (this step is important, beacuse after each restart the script gets copied now)
    – restart your zeroshell, and now you should be able to add 9999 Free Authorized Clients to your ZeroShell via Web Interface

    maybe Fulvio can remove this limitation in its original distribution some day.

    – Regards Mike

    #50982

    miketheknife
    Member

    Hello all,

    i uncommented the following lines out of the cpAddClient script. As i am not a bourne shell expert, i could not find out what those lines do. Can someone explain to me, or give me a hint where i can find a documentation about this.

    if [ “${LAST:0:1}” == 0 ] ; then
    LAST=”${LAST:1:1}”
    fi

    without those lines the creation of the additional FreeClients work, but when i delete some, i have gaps, and they are not getting refilled. look here (ex the 0003 is missing):

    0000 0006 0010 0014 0018 0022 0026 0030 0034 0038 0042 0046 0050
    0001 0007 0011 0015 0019 0023 0027 0031 0035 0039 0043 0047 0051
    0002 0008 0012 0016 0020 0024 0028 0032 0036 0040 0044 0048 0053
    0004 0009 0013 0017 0021 0025 0029 0033 0037 0041 0045 0049

    I think the above mentioned codebit has to do with this.

    Regards, Mike

    #50983

    emisebastian
    Member

    i did all that but i can’t make it work!
    can u tell me how?
    did you forget about something?

    tks

    #50984

    miketheknife
    Member

    @emisebastian wrote:

    i did all that but i can’t make it work!
    can u tell me how?
    did you forget about something?

    tks

    Can you tell me more about what is not working?

    I have just successfully implemented it with another firewall, i am using Beta14. on a Alix Board.

    Greetz Mike

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.