DHCP server with more than nine subnets on one interface

Home Page Forums Network Management Signal a BUG DHCP server with more than nine subnets on one interface

This topic contains 0 replies, has 0 voices, and was last updated by  Mana 9 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44928

    Mana
    Member

    Hi there,

    we have a specific setup where we have more than 9 different subnets and want
    to activate the dhcp server in each. All those subnets are put on one interface.
    This should normally work but the DHCP Server doesn’t start after a certain
    amount of subnets created.
    There happens an error in the dhcp_createconfig script, because the filename
    is too long.
    Line 64

    mv shared "SN$SHARED"

    Example filename:

    SN_192.168.8.0M255.255.255.0_192.168.18.0M255.255.255.0_192.168.20.0M255.255.255.0_192.168.30.0M255.255.255.0_192.168.40.0M255.255.255.0_192.168.50.0M255.255.255.0_192.168.60.0M255.255.255.0_192.168.70.0M255.255.255.0_192.168.80.0M255.255.255.0_192.168.90.0M255.255.255.0_192.168.100.0M255.255.255.0_192.168.110.0M255.255.255.0_192.168.120.0M255.255.255.0_192.168.130.0M255.255.255.0

    We developed two patches for this.


    --- a/dhcp_configfile 2017-07-06 06:12:53.000000000 +0200
    +++ b/dhcp_configfile 2017-08-02 14:30:06.464000000 +0200
    @@ -141,7 +141,8 @@
    SHAREDNETWORKS=`ls -d SN_* 2>/dev/null`
    for H in $SHAREDNETWORKS ; do
    cd $TMPSUBNETS/$H
    - echo "shared-network $H {"
    + SHAREDSUM=$(echo $H | cut -f 2 -d '_')
    + echo "shared-network SN$(cat $TMPSUBNETS/CNF_$SHAREDSUM) {"
    create_subnet
    echo "}"
    done

    --- a/dhcp_createconfig 2017-07-06 06:12:53.000000000 +0200
    +++ b/dhcp_createconfig 2017-08-02 14:30:18.576000000 +0200
    @@ -61,7 +61,9 @@
    done
    done
    if ! [ -z "$SHARED" ] ; then
    - mv shared "SN$SHARED"
    + SHAREDSUM="$(shasum < << $SHARED | cut -f 1 -d ' ')"
    + echo -n $SHARED > CNF_$SHAREDSUM
    + mv shared "SN_$SHAREDSUM"
    fi
    fi
    fi

    This creates a fixed name length file and adds the config string otherwise set
    as the filename to another file.
    We hope this helps with findig the issue and probably fixing it.

    #54668

    tuxad
    Member

    in the fix decription is a small mistake:

    This creates a fixed name length file and adds the config string otherwise set
    as the filename to another file.

    This creates a fixed name length directory and adds the config string otherwise set as the directory name to another file.

    This is my training because I released the error description.

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

You must be logged in to reply to this topic.