Skip to content

openvpn-tools with many clients #8

@emmanuelgeoffray

Description

@emmanuelgeoffray

Hello,

I am using openvpn-tools on a server with a vpn where I manage a list of ~ 70 clients.
I have some issues with the last added clients to connect to the vpn.
I found out in clients.list that last clients have an IP_ID of 289, 293 ....
When they succeed to connect, it is with overflowed IP, for exemple a client with an IP_ID of 273, will connect with IP 10.11.12.18
But that breaks the connection for the computer that has an IP_ID of 17.

I examined the openvpn-tools and from what I read, each IP_ID is in a sequence of + 4: 17, 21, 25, etc.
But only two slots are used:

    # Computing client IP ID.
    IP_ID=5
    while [ -n "$(command grep " ${IP_ID}$" "${INSTANCE_CLIENTS_LIST_PATH}")" ]; do
      IP_ID=$((${IP_ID} + 4))
    done

    # Add client to instance client list.
    echo "${CLIENT_LONG_NAME} ${IP_ID}" >> "${INSTANCE_CLIENTS_LIST_PATH}"

    # Create client advanced config file, and fixing IP.
    SERVER_SIDE_IP="${CURRENT_IP_RANGE}.$((${IP_ID} + 1))"
    CLIENT_SIDE_IP="${CURRENT_IP_RANGE}.${IP_ID}"

https://github.com/biapy/howto.biapy.com/blob/master/openvpn/openvpn-tools#L2340

Can I safely change from IP_ID=$((${IP_ID} + 4)) to IP_ID=$((${IP_ID} + 2)) ?

Thank you,
Emmanuel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions